* fullname descriptor with -break-list
@ 2005-02-06 23:18 Nick Roberts
2005-02-07 0:17 ` Bob Rossi
0 siblings, 1 reply; 9+ messages in thread
From: Nick Roberts @ 2005-02-06 23:18 UTC (permalink / raw)
To: gdb
I am trying to migrate the GDB user interface in Emacs from annotations to
MI. To help with this process, I would like to add the fullname, as used in
-file-list-exec-source-file and -file-list-exec-source-files, to the MI
command -break-list.
i.e the example in the manual would look like:
-break-list
^done,BreakpointTable={nr_rows="1",nr_cols="6",
hdr=[{width="3",alignment="-1",col_name="number",colhdr="Num"},
{width="14",alignment="-1",col_name="type",colhdr="Type"},
{width="4",alignment="-1",col_name="disp",colhdr="Disp"},
{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},
{width="10",alignment="-1",col_name="addr",colhdr="Address"},
{width="40",alignment="2",col_name="what",colhdr="What"}],
body=[bkpt={number="1",type="breakpoint",disp="keep",enabled="y",
addr="0x000100d0",func="main",file="hello.c",
fullname="/home/nick/hello.c",line="5",cond="1",times="0",ignore="3"}]}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Would such a patch be acceptable?
Nick
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: fullname descriptor with -break-list
2005-02-06 23:18 fullname descriptor with -break-list Nick Roberts
@ 2005-02-07 0:17 ` Bob Rossi
2005-02-07 2:49 ` Nick Roberts
2005-02-07 15:22 ` Andrew Cagney
0 siblings, 2 replies; 9+ messages in thread
From: Bob Rossi @ 2005-02-07 0:17 UTC (permalink / raw)
To: Nick Roberts; +Cc: gdb
On Mon, Feb 07, 2005 at 09:04:18AM +1300, Nick Roberts wrote:
>
> I am trying to migrate the GDB user interface in Emacs from annotations to
> MI. To help with this process, I would like to add the fullname, as used in
> -file-list-exec-source-file and -file-list-exec-source-files, to the MI
> command -break-list.
>
> i.e the example in the manual would look like:
>
> -break-list
> ^done,BreakpointTable={nr_rows="1",nr_cols="6",
> hdr=[{width="3",alignment="-1",col_name="number",colhdr="Num"},
> {width="14",alignment="-1",col_name="type",colhdr="Type"},
> {width="4",alignment="-1",col_name="disp",colhdr="Disp"},
> {width="3",alignment="-1",col_name="enabled",colhdr="Enb"},
> {width="10",alignment="-1",col_name="addr",colhdr="Address"},
> {width="40",alignment="2",col_name="what",colhdr="What"}],
> body=[bkpt={number="1",type="breakpoint",disp="keep",enabled="y",
> addr="0x000100d0",func="main",file="hello.c",
> fullname="/home/nick/hello.c",line="5",cond="1",times="0",ignore="3"}]}
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> Would such a patch be acceptable?
I believe it would be, when I added the -file-list commands, I was asked
to add the information to the breakpoints and to the stack command.
I didn't do it simply for time reasons. You can use the
symtab_to_fullname or psymtab_to_fullname functions to get the data you
need.
In the long run, it would probably be usefull to output the fullname
everywhere that "file" is used.
Bob Rossi
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: fullname descriptor with -break-list
2005-02-07 0:17 ` Bob Rossi
@ 2005-02-07 2:49 ` Nick Roberts
2005-02-07 14:54 ` Bob Rossi
2005-02-07 15:22 ` Andrew Cagney
1 sibling, 1 reply; 9+ messages in thread
From: Nick Roberts @ 2005-02-07 2:49 UTC (permalink / raw)
To: Bob Rossi; +Cc: gdb
> > Would such a patch be acceptable?
>
> I believe it would be, when I added the -file-list commands, I was asked
> to add the information to the breakpoints and to the stack command.
>
> I didn't do it simply for time reasons. You can use the
> symtab_to_fullname or psymtab_to_fullname functions to get the data you
> need.
>
> In the long run, it would probably be usefull to output the fullname
> everywhere that "file" is used.
For the moment, I will start GDB with annotations and convert as many of the
CLI commands to MI as I can. I already use variable objects and I will add to
this. I don't currently need the fullname in the stack output because it
always gets printed for the current frame by annotations. Eventually I will
need to get this information from MI output. I notice, however, that, in MI,
the fullname *doesn't* get printed when execution stops:
-exec-run
^running
(gdb)
*stopped,reason="breakpoint-hit",bkptno="1",thread-id="0",frame={addr="0x080486e2",func="myprint",args=[{name="i",value="0"},{name="j",value="0"}],file="myprint.c",line="5"}
I seem to recall there was some discussion about this earlier but I didn't
follow the thread closely. Can somebody please tell me what the outcome was?
Nick
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: fullname descriptor with -break-list
2005-02-07 2:49 ` Nick Roberts
@ 2005-02-07 14:54 ` Bob Rossi
2005-02-07 20:14 ` Andrew Cagney
0 siblings, 1 reply; 9+ messages in thread
From: Bob Rossi @ 2005-02-07 14:54 UTC (permalink / raw)
To: Nick Roberts; +Cc: gdb
On Mon, Feb 07, 2005 at 01:10:06PM +1300, Nick Roberts wrote:
> > > Would such a patch be acceptable?
> >
> > I believe it would be, when I added the -file-list commands, I was asked
> > to add the information to the breakpoints and to the stack command.
> >
> > I didn't do it simply for time reasons. You can use the
> > symtab_to_fullname or psymtab_to_fullname functions to get the data you
> > need.
> >
> > In the long run, it would probably be usefull to output the fullname
> > everywhere that "file" is used.
>
> For the moment, I will start GDB with annotations and convert as many of the
> CLI commands to MI as I can. I already use variable objects and I will add to
> this. I don't currently need the fullname in the stack output because it
> always gets printed for the current frame by annotations. Eventually I will
> need to get this information from MI output. I notice, however, that, in MI,
> the fullname *doesn't* get printed when execution stops:
>
> -exec-run
> ^running
> (gdb)
> *stopped,reason="breakpoint-hit",bkptno="1",thread-id="0",frame={addr="0x080486e2",func="myprint",args=[{name="i",value="0"},{name="j",value="0"}],file="myprint.c",line="5"}
O wow, it would be great to add this. I've been working on the MI
testsuite lately, and after I'm done with that, I'll most likely end up
wanting this exact feature. Otherwise, I'll have to call
-file-list-exec-source-file every time instead.
> I seem to recall there was some discussion about this earlier but I didn't
> follow the thread closely. Can somebody please tell me what the outcome was?
I don't recall anything about this. Sorry.
Bob Rossi
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: fullname descriptor with -break-list
2005-02-07 0:17 ` Bob Rossi
2005-02-07 2:49 ` Nick Roberts
@ 2005-02-07 15:22 ` Andrew Cagney
1 sibling, 0 replies; 9+ messages in thread
From: Andrew Cagney @ 2005-02-07 15:22 UTC (permalink / raw)
To: Bob Rossi; +Cc: Nick Roberts, gdb
Bob Rossi wrote:
> On Mon, Feb 07, 2005 at 09:04:18AM +1300, Nick Roberts wrote:
>
>>I am trying to migrate the GDB user interface in Emacs from annotations to
>>MI. To help with this process, I would like to add the fullname, as used in
>>-file-list-exec-source-file and -file-list-exec-source-files, to the MI
>>command -break-list.
>>
>>i.e the example in the manual would look like:
>>
>> -break-list
>> ^done,BreakpointTable={nr_rows="1",nr_cols="6",
>> hdr=[{width="3",alignment="-1",col_name="number",colhdr="Num"},
>> {width="14",alignment="-1",col_name="type",colhdr="Type"},
>> {width="4",alignment="-1",col_name="disp",colhdr="Disp"},
>> {width="3",alignment="-1",col_name="enabled",colhdr="Enb"},
>> {width="10",alignment="-1",col_name="addr",colhdr="Address"},
>> {width="40",alignment="2",col_name="what",colhdr="What"}],
>> body=[bkpt={number="1",type="breakpoint",disp="keep",enabled="y",
>> addr="0x000100d0",func="main",file="hello.c",
>> fullname="/home/nick/hello.c",line="5",cond="1",times="0",ignore="3"}]}
>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>
>>Would such a patch be acceptable?
>
>
> I believe it would be, when I added the -file-list commands, I was asked
> to add the information to the breakpoints and to the stack command.
>
> I didn't do it simply for time reasons. You can use the
> symtab_to_fullname or psymtab_to_fullname functions to get the data you
> need.
>
> In the long run, it would probably be usefull to output the fullname
> everywhere that "file" is used.
Sounds good.
Andrew
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: fullname descriptor with -break-list
2005-02-07 14:54 ` Bob Rossi
@ 2005-02-07 20:14 ` Andrew Cagney
2005-02-08 1:54 ` Event notification in MI (was Re: fullname descriptor with -break-list) Nick Roberts
2005-03-04 7:24 ` fullname descriptor with -break-list Nick Roberts
0 siblings, 2 replies; 9+ messages in thread
From: Andrew Cagney @ 2005-02-07 20:14 UTC (permalink / raw)
To: Bob Rossi; +Cc: Nick Roberts, gdb
>>-exec-run
>>^running
>>(gdb)
>>*stopped,reason="breakpoint-hit",bkptno="1",thread-id="0",frame={addr="0x080486e2",func="myprint",args=[{name="i",value="0"},{name="j",value="0"}],file="myprint.c",line="5"}
>
>
> O wow, it would be great to add this. I've been working on the MI
> testsuite lately, and after I'm done with that, I'll most likely end up
> wanting this exact feature. Otherwise, I'll have to call
> -file-list-exec-source-file every time instead.
>
>
>>I seem to recall there was some discussion about this earlier but I didn't
>>follow the thread closely. Can somebody please tell me what the outcome was?
>
>
> I don't recall anything about this. Sorry.
The way that message is generated is a massive kludge - so the
underlying code could do with a cleanup - separate the code determining
why the process stopped from the code printing the stop reason.
Andrew
^ permalink raw reply [flat|nested] 9+ messages in thread
* Event notification in MI (was Re: fullname descriptor with -break-list)
2005-02-07 20:14 ` Andrew Cagney
@ 2005-02-08 1:54 ` Nick Roberts
2005-03-04 7:24 ` fullname descriptor with -break-list Nick Roberts
1 sibling, 0 replies; 9+ messages in thread
From: Nick Roberts @ 2005-02-08 1:54 UTC (permalink / raw)
To: Andrew Cagney; +Cc: Bob Rossi, Jason Molenda, gdb
Andrew Cagney writes:
>
> >>-exec-run
> >>^running
> >>(gdb)
> >>*stopped,reason="breakpoint-hit",bkptno="1",thread-id="0",frame={addr="0x080486e2",func="myprint",args=[{name="i",value="0"},{name="j",value="0"}],file="myprint.c",line="5"}
...
> The way that message is generated is a massive kludge - so the
> underlying code could do with a cleanup - separate the code determining
> why the process stopped from the code printing the stop reason.
I think I finally understand what you were saying in an earlier thread
(Re: How does GDB/MI give the current frame - June 2004):
AC> When the user does "up", "down", the debugger should generate a selected
AC> CLI frame changed event (it currently doesn't). If the GUI so chooses,
AC> it can track the users "selected" frame, by responding to these events.
I guess that this output is not associated with a particular MI command but a
change of state. In this way, the same output would be generated by a CLI
command if it produced the same change of state (I was arguing that it
shouldn't at the time), although presumably it would be only be turned on by
selecting the MI interpreter.
This complies with Richard Stallman's requirement that Emacs doesn't lose the
GUD buffer. Previously I had in mind replacing each CLI command that I used
with an MI equivalent "info break" -> -break-list, "info stack" ->
-stack-list-frames etc and updating after every user command. This is probably
less efficient and CLI commands would not always work.
Currently, "*stopped" seems to be the only such event notification implemented
in GNU GDB. Jason Molenda described a list of notifications that are
currently used by Apple's version:
JW> FWIW, here's the list of notification hooks we currently generate:
JW> breakpoint_create, breakpoint_modify, breakpoint_delete, stack_changed,
JW> frame_changed, thread_changed.
It would be good to have these available to GNU GDB. If Apple can merge these
changes in that would be ideal. Failing that I would like to try to implement
them in GNU GDB (using observers?). This latter approach would take much
longer, of course, and also make it harder to keep the Xcode and GNU gdb
versions in sync.
Nick
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: fullname descriptor with -break-list
2005-02-07 20:14 ` Andrew Cagney
2005-02-08 1:54 ` Event notification in MI (was Re: fullname descriptor with -break-list) Nick Roberts
@ 2005-03-04 7:24 ` Nick Roberts
2005-03-04 11:23 ` Bob Rossi
1 sibling, 1 reply; 9+ messages in thread
From: Nick Roberts @ 2005-03-04 7:24 UTC (permalink / raw)
To: Andrew Cagney; +Cc: Bob Rossi, gdb
> >>-exec-run
> >>^running
> >>(gdb)
> >>*stopped,reason="breakpoint-hit",bkptno="1",thread-id="0",frame={addr="0x080486e2",func="myprint",args=[{name="i",value="0"},{name="j",value="0"}],file="myprint.c",line="5"}
...
> The way that message is generated is a massive kludge - so the
> underlying code could do with a cleanup - separate the code determining
> why the process stopped from the code printing the stop reason.
Just a short note for the future:
As *stopped is asynchronous output and not that of a specific MI command, I
also think this output should appear even if a CLI command has been invoked.
Currently a GDB session might look like:
&"b main\n"
~"Breakpoint 1 at 0x80484cf: file myprog.c, line 48.\n"
^done
(gdb)
run
&"run\n"
~"Starting program: /home/nick/myprog \n"
~"\n"
~"Breakpoint 1, main (argc=1, argv=0xbffff794) at myprog.c:48\n"
~"48\t int i, n, m[10]={0,1,4,9,16,25,36,49,64,81};\n"
^done
(gdb)
but I think it should look something like:
&"b main\n"
~"Breakpoint 1 at 0x80484cf: file myprog.c, line 48.\n"
^done
(gdb)
run
&"run\n"
~"Starting program: /home/nick/myprog \n"
~"\n"
~"Breakpoint 1, main (argc=1, argv=0xbffff794) at myprog.c:48\n"
~"48\t int i, n, m[10]={0,1,4,9,16,25,36,49,64,81};\n"
^done
(gdb)
*stopped,reason="breakpoint-hit",bkptno="1",thread-id="0",frame={addr="0x080484cf",func="main",args=[{name="argc",value="1"},{name="argv",value="0xbffff794"}],file="myprog.c",line="48"}
(gdb)
or with "-interpreter-exec console run" if direct CLI is going to be removed.
From Emacs point of view, this would mean the CLI commands could be entered in
the GUD buffer.
Nick
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: fullname descriptor with -break-list
2005-03-04 7:24 ` fullname descriptor with -break-list Nick Roberts
@ 2005-03-04 11:23 ` Bob Rossi
0 siblings, 0 replies; 9+ messages in thread
From: Bob Rossi @ 2005-03-04 11:23 UTC (permalink / raw)
To: Nick Roberts; +Cc: Andrew Cagney, gdb
On Fri, Mar 04, 2005 at 08:22:14PM +1300, Nick Roberts wrote:
> > >>-exec-run
> > >>^running
> > >>(gdb)
> > >>*stopped,reason="breakpoint-hit",bkptno="1",thread-id="0",frame={addr="0x080486e2",func="myprint",args=[{name="i",value="0"},{name="j",value="0"}],file="myprint.c",line="5"}
> ...
> > The way that message is generated is a massive kludge - so the
> > underlying code could do with a cleanup - separate the code determining
> > why the process stopped from the code printing the stop reason.
>
> Just a short note for the future:
>
> As *stopped is asynchronous output and not that of a specific MI command, I
> also think this output should appear even if a CLI command has been invoked.
If you are refering to the fact that you want to know what MI output
command is being sent to you when the command is asynchronous, I
completly agree. In fact, I have plans, if accepted, to put the type of
MI output command directly into the MI output command.
The Apple guys said they patched GDB to behave like this, but only for
asynchronous commands.
Bob Rossi
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2005-03-04 11:23 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-06 23:18 fullname descriptor with -break-list Nick Roberts
2005-02-07 0:17 ` Bob Rossi
2005-02-07 2:49 ` Nick Roberts
2005-02-07 14:54 ` Bob Rossi
2005-02-07 20:14 ` Andrew Cagney
2005-02-08 1:54 ` Event notification in MI (was Re: fullname descriptor with -break-list) Nick Roberts
2005-03-04 7:24 ` fullname descriptor with -break-list Nick Roberts
2005-03-04 11:23 ` Bob Rossi
2005-02-07 15:22 ` Andrew Cagney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox