Skip to content

Commit 063235f

Browse files
author
deadwood
committed
Backport: Add workaround for problem visible in C++ code
In C code, p SysBase gives $1 = (struct ExecBase *)addr, however when first C++ debugging information is loaded, this is change into $1 = (ExecBase *)addr. This results in $SysBase = (ExecBase *)addr and gdb complaining about ExecBase type not being known. The hack makes sure that output is always $SysBase = (struct ExecBase*)addr
1 parent 0122e77 commit 063235f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

developer/debug/gdb/_gdbinit

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,13 @@ define symbol_check
2323
ignore-errors p $arg0
2424
end_log
2525

26+
# Turns $1 = (type)addr into $symbol = (type)addr
2627
shell sed -i -e '/^[^\$]/d' -e 's/^\$[0-9]* =/set $'$arg0' =/' symbol.tmp
28+
29+
# Hack. In case of C++, type is displayed without struct keyword and loading fails.
30+
# Add struct keyword uncoditionally to any type after first removing it if it was there
31+
shell sed -i -e 's/(APTR)//' -e 's/= (struct /= (/' -e 's/= (/= (struct /' symbol.tmp
32+
2733
source symbol.tmp
2834
end
2935

0 commit comments

Comments
 (0)