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: [RFC] Add new command to spit out the linetable for a given file


> I believe that this command has been proposed before - I vaguely
> remember it even being implemented but I don't know what happened to
> the patch.  It was "maint info lines" or something similar...
> 
> Would be within the past year in the list archives somewhere but I
> can't find it.

Thanks Daniel, I think I found the message. I vaguely remembered this
too, but couldn't find it in the archives until you reminded me of the
proposed syntax.

   http://sources.redhat.com/ml/gdb-patches/2002-09/msg00084.html

This command is associating line numbers from PC addresses, or from
a range of addresses. The intent was to be able to generate a mixed
source/assembly view of the code. But the patch never got approved
because it was felt that this was not the best approach to solve this
problem, and because there is already a CLI command that does exactly
what the author needed (-data-disassemble).

What GVD needs is the opposite: get the PC addresses for each line of a
file. We could extend a bit the flexibility of this command by allowing
the user to specify a range of line numbers too, to allow a front-end to
limit the query to the lines currently visible in the source view, for
instance.

FernandoN made a very good point that "maint" commands are only intended
for debugging or testing GDB. That's why I chose to stay in the "info"
commands realm. I first thought about calling this command "info
linetable", but dropped this because of completion clashes with
the current "info line". So I came up with "info sloc", which I find
only so so, but was the best I could find.

We are not familiar with the GDB/MI commands yet, but if it is felt that
this new functionality would be more suitable if implemented as a MI
command, we would be happy to look into that too.

Let me know what you think. I believe this new command could be very
useful to all GDB frontends. Being able to tell at a glance which lines
have code is really a cool and helpful feature.

-- 
Joel


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