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]

[RFA] new GDB/MI command: -symbol-info-linetable


Hello,

To follow a suggestion made by Joel in this message:
http://sources.redhat.com/ml/gdb-patches/2003-03/msg00000.html

I have implemented in a new command that dumps the linetable
for a given source file. As recommended, I have made it a GDB/MI
command, intead of a CLI command.

Here is an example (from the documentation I wrote) of this command in
action:

    (gdb)
    -symbol-info-linetable basics.c
    ^done,linetable=[{pc="0x08048554",line="7"},{pc="0x0804855a",line="8"}]
    (gdb)

Here is the ChangeLog:

2003-03-09  Thierry Schneider  <tpschneider1 at yahoo dot com>

        * mi-main.c (mi_cmd_symbol_info_linetable): New function.
        * mi-cmds.h (mi_cmd_symbol_info_linetable): Add declaration.
        * mi-cmds.c (mi_cmds): Add entry for new MI command.
        * gdbmi.texinfo (GDB/MI Symbol Query): Add documentation for
        new MI command.

Regarding new mi_cmd_symbol_info_linetable(), I think it should be
located in a new file, named mi-cmd-symbol.c. For the moment, I took
a simpler approach (less changes required) of putting it in mi-main.c,
which seems to be hosting a few orphan command implementations. But
I can certainly modify this patch to add this new file.

I have also created a small testcase in gdb.mi:

2003-03-09  Thierry Schneider  <tpschneider1 at yahoo dot com>

        * mi1-linetable.exp: New file.

I unfortunately do not have a valid FSF assignement on file, yet.
I have sent my application to the FSF, and I am waiting for the papers
to arrive by mail.

FYI: Since I do not have the priviledge to commit these changes myself
if/when they are approved, Joel Brobecker has offered to do it for me.

Finally, those of us who are still using GDB 5.3 won't be able to use
this MI command from the CLI, since the interpreter command has been
implemented after 5.3 has been released. For these people, I hacked
a CLI command "-symbol-info-linetable" which produces the exact same
output than the equivalent MI command. This will certainly be useful
to the GVD developpers :-). The patch to source.c is attached.

Thierry S.
(GDB newbie)

Attachment: symbol-info-linetable.diff
Description: Text document

Attachment: gdbmi.texinfo.diff
Description: Text document

Attachment: mi1-linetable.exp
Description: Text document

Attachment: source.c.diff
Description: Text document


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