Skip to content

Commit 31e2ec6

Browse files
committed
Fix phpGH-15923: GDB: Python Exception <class 'TypeError'>: exceptions 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.
1 parent 43dc2eb commit 31e2ec6

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

NEWS

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33
?? ??? ????, PHP 8.4.0RC1
44

5+
- Debugging:
6+
. Fixed bug GH-15923 (GDB: Python Exception <class 'TypeError'>:
7+
exceptions must derive from BaseException). (nielsdos)
8+
59
- DOM:
610
. Fix XML serializer errata: xmlns="" serialization should be allowed.
711
(nielsdos)

main/debug_gdb_scripts.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -971,7 +971,7 @@ asm(
971971
".ascii \"\\n\"\n"
972972
".ascii \" (symbol,_) = gdb.lookup_symbol(\\\"zend_gc_refcount\\\")\\n\"\n"
973973
".ascii \" if symbol == None:\\n\"\n"
974-
".ascii \" raise \\\"Could not find zend_types.h: symbol zend_gc_refcount not found\\\"\\n\"\n"
974+
".ascii \" raise Exception(\\\"Could not find zend_types.h: symbol zend_gc_refcount not found\\\")\\n\"\n"
975975
".ascii \" filename = symbol.symtab.fullname()\\n\"\n"
976976
".ascii \"\\n\"\n"
977977
".ascii \" bits = {}\\n\"\n"

scripts/gdb/php_gdb.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ def load_type_bits():
301301

302302
(symbol,_) = gdb.lookup_symbol("zend_gc_refcount")
303303
if symbol == None:
304-
raise "Could not find zend_types.h: symbol zend_gc_refcount not found"
304+
raise Exception("Could not find zend_types.h: symbol zend_gc_refcount not found")
305305
filename = symbol.symtab.fullname()
306306

307307
bits = {}

0 commit comments

Comments
 (0)