Re: [PATCH 3/3] Replace TUI's select_frame hook (PR tui/13378)

Pedro Alves
2015-06-30T15:47:09Z

On 06/30/2015 04:12 PM, Patrick Palka wrote:
> On Tue, Jun 30, 2015 at 10:54 AM, Patrick Palka <patrick@parcs.ath.cx> wrote:

> The call to "print_source_lines (sal.symtab, sal.line, sal.line + 1,
> 0);" in the else branch eventually calls "tui_show_source (sal.line);"
> which adjusts the source window so that sal.line is the very first
> line visible.
>
> I'm not sure how easy this would be to fix properly. We want to avoid
> calling print_source_lines in print_frame_info when the TUI is active.
> Of course, I can just guard the code with "if (tui_active)" but that's
> not a good fix.

Indeed.

> Instead of removing the hook yet, what about making
> it (tui_print_frame_info_listing_hook) a no-op in the interim?

If that works, fine with me. Fine with me to leave it be as is too.

>
> BTW, in the CLI, this call to print_source_lines is responsible for
> printing the stopped-at source line to stdout, e.g.

Yeah. Maybe if we move the print_stop_event call out of normal_stop
into TUI/CLI normal_stop observers, then we can tailor CLI/TUI/MI to
print what they need. I actually moved it here:

https://github.com/palves/gdb/commits/palves/merge-more-async-and-sync
https://github.com/palves/gdb/commit/c0a88ed037b645fb9f072290000dc11044524639

That's WIP (still ugly) post 7.10 material.

>
> (gdb) start
> ....
> Temporary breakpoint 2, main () at 13378.c:9
> 9 int i = 0; // THIS LINE
> (gdb)

Thanks,
Pedro Alves