From 99b763af7d344628f519430e64924fc7e7e3ffe7 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Mon, 16 Sep 2024 22:23:45 +0200 Subject: [PATCH] Fix GH-15923: GDB: Python Exception : exceptions must derive from BaseException Triggers on release builds when printing data structures. You can't raise a string, you must raise exceptions. --- main/debug_gdb_scripts.c | 2 +- scripts/gdb/php_gdb.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/main/debug_gdb_scripts.c b/main/debug_gdb_scripts.c index ad03a2c2ba62f..de7d0c5c92df8 100644 --- a/main/debug_gdb_scripts.c +++ b/main/debug_gdb_scripts.c @@ -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" diff --git a/scripts/gdb/php_gdb.py b/scripts/gdb/php_gdb.py index d4db760812687..7fef2ad1f49c8 100644 --- a/scripts/gdb/php_gdb.py +++ b/scripts/gdb/php_gdb.py @@ -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 = {}