This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] new command: 'maintenance info lines'


Fernando Nasser wrote:

The maintenance commands are to be used to debug (or test) GDB only.
We could say you'd be dumping the line table but that is hardly what is being done and we don't have a real need for that anyway.

well, WE have a real need for this command (is there a wrong way to use gdb?). but we sure don't need it to maintain gdb.

If you really want to use a CLI command, you need to add a set/show variable to request that the source lines are included in the 'disassemble' command output.
do you mean something like:

(gdb) set disassem dump-source-or-something 1
(gdb) disassemble main
Dump of assembler code for function main:
Line ../gdb/main.c:757
0x50ce4 <main>: save %sp, -120, %sp
0x50ce8 <main+4>: std %i0, [ %fp + -24 ]
0x50cec <main+8>: sethi %hi(0x50000), %o0
0x50cf0 <main+12>: or %o0, 0x16c, %o0 ! 0x5016c <captured_main>
0x50cf4 <main+16>: sethi %hi(0x2a7c00), %o2
Line ../gdb/main.c:759
0x50cf8 <main+20>: add %fp, -24, %o1
0x50cfc <main+24>: or %o2, 0x3c0, %o2
0x50d00 <main+28>: call 0xb2374 <catch_errors>
0x50d04 <main+32>: mov 6, %o3
Line ../gdb/main.c:775
0x50d08 <main+36>: ret
0x50d0c <main+40>: restore %g0, 0, %o0
End of assembler dump.

that would be a great solution for our needs. how about setting the dump-source to 1 to show line location, and 2 to try presenting the actual source lines (like mixed list and disassemble)

The newer disassembler code that handles mixed output is still in the MI subdirectory (and in an older form in the gdbtk subdir) but it is intended to replace the one in printcmd.c. It shouldn't be too difficult and you can always ask if you have any doubts.
?? please explain

thanks - jezra




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]