Skip to content

Commit

Permalink
Fix phpGH-15923: GDB: Python Exception <class 'TypeError'>: exception…
Browse files Browse the repository at this point in the history
…s must derive from BaseException

Triggers on release builds when printing data structures.
You can't raise a string, you must raise exceptions.

Closes phpGH-15928.
  • Loading branch information
nielsdos committed Sep 17, 2024
1 parent 43dc2eb commit 31e2ec6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? ????, PHP 8.4.0RC1

- Debugging:
. Fixed bug GH-15923 (GDB: Python Exception <class 'TypeError'>:
exceptions must derive from BaseException). (nielsdos)

- DOM:
. Fix XML serializer errata: xmlns="" serialization should be allowed.
(nielsdos)
Expand Down
2 changes: 1 addition & 1 deletion main/debug_gdb_scripts.c
Original file line number Diff line number Diff line change
Expand Up @@ -971,7 +971,7 @@ asm(
".ascii \"\\n\"\n"
".ascii \" (symbol,_) = gdb.lookup_symbol(\\\"zend_gc_refcount\\\")\\n\"\n"
".ascii \" if symbol == None:\\n\"\n"
".ascii \" raise \\\"Could not find zend_types.h: symbol zend_gc_refcount not found\\\"\\n\"\n"
".ascii \" raise Exception(\\\"Could not find zend_types.h: symbol zend_gc_refcount not found\\\")\\n\"\n"
".ascii \" filename = symbol.symtab.fullname()\\n\"\n"
".ascii \"\\n\"\n"
".ascii \" bits = {}\\n\"\n"
Expand Down
2 changes: 1 addition & 1 deletion scripts/gdb/php_gdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ def load_type_bits():

(symbol,_) = gdb.lookup_symbol("zend_gc_refcount")
if symbol == None:
raise "Could not find zend_types.h: symbol zend_gc_refcount not found"
raise Exception("Could not find zend_types.h: symbol zend_gc_refcount not found")
filename = symbol.symtab.fullname()

bits = {}
Expand Down

0 comments on commit 31e2ec6

Please sign in to comment.