Fix GH-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 GH-15928.
This commit is contained in:
Niels Dossche 2024-09-16 22:23:45 +02:00
parent 43dc2eb6d8
commit 31e2ec63d8
No known key found for this signature in database
GPG Key ID: B8A8AD166DF0E2E5
3 changed files with 6 additions and 2 deletions

4
NEWS
View File

@ -2,6 +2,10 @@ PHP NEWS
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? ????, PHP 8.4.0RC1 ?? ??? ????, PHP 8.4.0RC1
- Debugging:
. Fixed bug GH-15923 (GDB: Python Exception <class 'TypeError'>:
exceptions must derive from BaseException). (nielsdos)
- DOM: - DOM:
. Fix XML serializer errata: xmlns="" serialization should be allowed. . Fix XML serializer errata: xmlns="" serialization should be allowed.
(nielsdos) (nielsdos)

View File

@ -971,7 +971,7 @@ asm(
".ascii \"\\n\"\n" ".ascii \"\\n\"\n"
".ascii \" (symbol,_) = gdb.lookup_symbol(\\\"zend_gc_refcount\\\")\\n\"\n" ".ascii \" (symbol,_) = gdb.lookup_symbol(\\\"zend_gc_refcount\\\")\\n\"\n"
".ascii \" if symbol == None:\\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 \" filename = symbol.symtab.fullname()\\n\"\n"
".ascii \"\\n\"\n" ".ascii \"\\n\"\n"
".ascii \" bits = {}\\n\"\n" ".ascii \" bits = {}\\n\"\n"

View File

@ -301,7 +301,7 @@ def load_type_bits():
(symbol,_) = gdb.lookup_symbol("zend_gc_refcount") (symbol,_) = gdb.lookup_symbol("zend_gc_refcount")
if symbol == None: 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() filename = symbol.symtab.fullname()
bits = {} bits = {}