Skip to content

new command cbacktrace (#36), minor improvements for internal frame handling...

Simon Sobisch requested to merge ssobisch/cbl-gdb:patch-25 into version427

new command cbacktrace (#36 (closed)), minor improvements for internal frame handling (now cares for "outer" COBOL frames, too)

Fixes #36 (closed), new command is only registered for GDB 8.3+ (Python Frame-Filter API came with GDB 7.7).

Instead of the old

(gdb) backtrace
#0  0x00007fffe455dc87 in PRG9 (...) at /me/src/a/PRG9.cob:221
#1  0x00007fffb8751edb in PRG4_ (...) at /me/src/STRING.cpy:13
#2  0x00007fffb86f5ec1 in PRG4 () at /me/src/b/PRG4.cob:85
#3  0x00007fffe7499a2e in STARTER_ (...) at /me/src/c/STARTER.cob:189
#4  0x00007fffe745d6f1 in STARTER () at /me/src/c/STARTER.cob:131
#5  0x0000000000401a00 in main (...) at cobcrun.c:421
(gdb) backtrace 2
#0  0x00007fffe455dc87 in PRG9 (...) at /me/src/a/PRG9.cob:221
#1  0x00007fffb8751edb in PRG4_ (...) at /me/src/STRING.cpy:13
(gdb) backtrace -2
#4  0x00007fffe745d6f1 in STARTER () at /me/src/c/STARTER.cob:131
#5  0x0000000000401a00 in main (...) at cobcrun.c:421

(remark, frame 0 allows to "view" the source and set breakpoints, but no variables - it is the outer "shell" that originates from "step" into the CALL or from plain b PRG9)

we get the new default:

(gdb) backtrace
#0  0x00007fffe455dc87 in PRG9 (...) at /me/src/a/PRG9.cob:221
#1  0x00007fffb8751edb in PRG4_ (...) at /me/src/STRING.cpy:13
    #2  0x00007fffb86f5ec1 in PRG4 () at /me/src/b/PRG4.cob:85
#3  0x00007fffe7499a2e in STARTER_ (...) at /me/src/c/STARTER.cob:189
    #4  0x00007fffe745d6f1 in STARTER () at /me/src/c/STARTER.cob:131
#5  0x0000000000401a00 in main (...) at cobcrun.c:421
(gdb) backtrace 2
#0  0x00007fffe455dc87 in PRG9 (...) at /me/src/a/PRG9.cob:221
#1  0x00007fffb8751edb in PRG4_ (...) at /me/src/STRING.cpy:13
    #2  0x00007fffb86f5ec1 in PRG4 () at /me/src/b/PRG4.cob:85
(gdb) backtrace -2
#3  0x00007fffe7499a2e in STARTER_ (...) at /me/src/c/STARTER.cob:189
    #4  0x00007fffe745d6f1 in STARTER () at /me/src/c/STARTER.cob:131
#5  0x0000000000401a00 in main (...) at cobcrun.c:421

and a new command that supports every parameter that backtrace supports:

(gdb) cbacktrace
#0  0x00007fffe455dc87 in PRG9 (...) at /me/src/a/PRG9.cob:221
#1  PRG4 (...) at /me/src/STRING.cpy:13
#3  STARTER (...) at /me/src/c/STARTER.cob:189
(gdb) cbacktrace 2
#0  0x00007fffe455dc87 in PRG9 (...) at /me/src/a/PRG9.cob:221
#1  PRG4 (...) at /me/src/STRING.cpy:13
(gdb) cbacktrace -2
#1  PRG4 (...) at /me/src/STRING.cpy:13
#3  STARTER (...) at /me/src/c/STARTER.cob:189

Merge request reports

Loading