This is the mail archive of the gdb@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: gdb Digest 16 Jul 2004 16:27:58 -0000 Issue 1529


Alain,

On Jul 16, 2004, at 9:27 AM, gdb-digest-help@sources.redhat.com wrote:




On Jul 15, 2004, at 1:04 PM, Jason Molenda wrote:

For what it's worth, at Apple we've done what Andrew is proposing.
Our method spits out a "MI_HOOK_RESULT" notification on the ^done
result whenever the console command entered by the user has changed
the state in an important way.  e.g.

[...]



FWIW, here's the list of notification hooks we currently generate: breakpoint_create, breakpoint_modify, breakpoint_delete, stack_changed, frame_changed, thread_changed.




how about for "set p 3", changing values.

We don't do that, although that would be interesting.



I should add that we also call output_control_change_notification()
with "stepping" or "continuing" when the user enters a console command
that resumes execution.  e.g.

(gdb)
-interpreter-exec console-quoted step
^stepping
^running
(gdb)
*stopped,time=
{wallclock="0.01470",user="0.00635",system="0.00845",start="1089922425 .6
47144",end="1089922425.661845"},reason="end-stepping-range",thread-
id="1"
(gdb)
-interpreter-exec console-quoted continue
~"Continuing.\n"
^continuing
^running



Good !!
Few questions why "console-quoted", what's wrong with "console" or rather
what is -quoted provide more ?

The Apple gdb version of the interpreter system was reduced a bit when Elena & Keith merged it into the FSF gdb. In particular, FSF gdb doesn't ever actually switch interpreters, it just cooks the ui-outs a bit. But the Apple gdb supports actually switching interpreters:


$ gdb
...
(gdb) set interpreter mi
-file-list-statics
^error,msg="mi_cmd_file_list_statics: Usage: FILE SHLIB PRINT_VALUES [FILTER]"
(gdb)
-interpreter-set console
Switching to interpreter "console".
(gdb) ^done,time= {wallclock="0.00025",user="0.00009",system="0.00008",start="1090000394.8 88013",end="1090000394.888261"}
(gdb)
help
List of classes of commands:


...

This isn't really all that useful programmatically, but for debugging gdb mi commands it is invaluable - you can use the Console interpreter to get up to the mi command you want to test, then switch to the MI interpreter and work there. Not having this would drive me mad, so I preserved our version in the Apple sources.

But that means that

-interpreter-exec console

REALLY uses the console interpreter. Rather than try to go behind its back & cook the output a bit, I just added a quoted console interpreter that presents the console output but mi-quotified... Took about 10 lines of code once you understand how the interpreter stuff works, and it was much cleaner.



What's "^continuing" ? a way to discovered the type of command enter by the user ?
so "^stepping" for step etc ... is it usefull ?

I was asked to do this by the UI guys. I guess if you put up different status messages in the GUI for stepping & continuing, this would be useful. I don't know if they ever used it.


Jim


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