From 6071d37c4127aafef84ba1144ac1055972426116 Mon Sep 17 00:00:00 2001 From: Fedja Beader Date: Sun, 28 Jan 2024 13:52:38 +0100 Subject: Workaround "Function... not defined in.." (breakpoints not found) (GDB bug) Function "_Z13do_breakpointIN4tmwa3map11script_dataEEvRKT_PKc" not defined in "/builds/specing/tmwa/src/debug-debug/map-script-persist.cpp". Breakpoint 1 (/builds/specing/tmwa/src/debug-debug/map-script-persist.cpp:'_Z13do_breakpointIN4tmwa3map11script_dataEEvRKT_PKc') pending. void do_breakpoint(tmwa::map::script_data const&, char const*); Thanks to ssbssa@#gdb for pointing this out. --- tools/debug-debug.gdb | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tools/debug-debug.gdb b/tools/debug-debug.gdb index 2e59437..b50a49b 100644 --- a/tools/debug-debug.gdb +++ b/tools/debug-debug.gdb @@ -42,8 +42,21 @@ set print frame-arguments none set python print-stack full set logging on -rbreak do_breakpoint +# Workaround "Function... not defined in.." (breakpoints not found) (GDB bug) +# https://sourceware.org/bugzilla/show_bug.cgi?id=15962 +# In some gdb versions rbreak works, in some break does. +# This code should work for any. +python +bpoint = gdb.Breakpoint("do_breakpoint") + +if bpoint.pending: + print("`break ...` found no breakpoints, trying `rbreak ...`") + bpoint.delete() + gdb.execute("rbreak do_breakpoint") + +end set logging off + commands silent python hit_breakpoint() -- cgit v1.2.3-60-g2f50