This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] MI: Event notification
On Thursday 04 January 2007 23:49, Nick Roberts wrote:
> > > The general idea is to report changes in program state to the frontend so
> > > that it only updates the parts that need it. For example, after "up"
> > > frame_changed_hook triggers and the frontend knows it has to update the
> > > locals display.
> >
> > You mean, after "up" emitted explicitly by the user? If the frontend changes
> > the frame itself, it does not need any notifications.
>
> It might not be by clicking on a button but by typing "up" or even "u" from
> the console (GUD buffer). In such a case how would the frontend know that
> the frame has changed?
>
> > > This means that stepping through a single frame should be much
> > > quicker. If GDB enters a new frame during execution, stack_changed_hook
> > > triggers and the frontend knows it has to update the call stack display.
> > > I would eventually like to add more hooks like target-changed-hook when
> > > the user attaches to/detaches from a process, kills the process, or
> > > selects a new target with the "file" command.
> >
> > Is this all for user-typed commands? I wonder if notifications for those are
> > really needed. Reloading entire UI state after a user command does not seem
> > too bad -- because user is not likely to enter 10 commands per second anyway
> > -- and is much simpler.
>
> With a large stack and stepping through the program, I think it is very
> noticeable, which is why I frequently try to select a line to run to.
Stepping through the code and typing CLI commands are rather different
activities. For entering CLI, full UI state reload is not so problematic.
For stepping:
1. I have a proposal for "-var-list --locals" that I think will
make work with local variables very convenient and fast. I'll post
that tomorrow.
2. As for -stack-* -- if there any reason why that code cannot detect
that stack has not changed and quickly return "cached" result.
That will optimize all existing frontends automatically.
> > > The hooks are inserted/removed through "interpreter-exec console
> > > cli-command"
> >
> > Sorry, can you clarify?
>
> In mi_cmd_interpreter_exec, there are calls to mi_insert_notify_hooks and
> mi_remove_notify_hooks.
Ok.
> > > so I envisage not using MI commands like -exec-run,
> > > -exec-next, -stack-select-frame that change that state.
>
> mi_cmd_interpreter_exec only gets called with "interpreter-exec" so there
> would be no event notification in this case.
I suppose frontend can check if the input starts with "-" and do full reload
in that case, anyway?
- Volodya