Re: Refresh TUI source panel after "monitor reset"

"R. Diez via Gdb" <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <[email protected]>
> Pedro Alves wrote:
> Did you try just "frame"?  That's what I typically use to make the source pane refocus on the current frame, where
> the program is stopped.

> Andrew Burgess wrote:
> Completely untested, but I wonder if 'list *$pc' does what you want?

I have been investigating a little more. It's been some time, so I'll start from the beginning again.

I have a bootloader and the main firmware. Normally, I program the main firmware with OpenOCD, so GDB knows where the firmware source code is located.

The bootloader on the target does not normally change. It is a different project, its debug information is in a different .elf file, so its source code is not automatically available when I debug the main firmware.

Say I pause execution by pressing Ctrl+C in GDB. The TUI interface shows then the source line that corresponds to the current PC. So far so good.

Now I do a "monitor reset halt", followed by a "flushregs". However, the TUI interface still shows the old source code position. That is misleading.

If I issue command "print $pc", I can see that the PC register was updated fine.

Command "frame" does not help. It prints the right frame address (the same address as the PC), and that is all.

Command "list *$pc" is ignored, because the PC points to the bootloader, and its source code is not available when debugging the main firmware. It is particularly annoying that no hint or error indication is printed.

Command "disassemble $pc,+10" dumps the disassembly on the command pane, and does not really help.

Say you now switch to "layout split" mode. Both the source panel and the disassembly panel still show the old source code position, which is wrong.

If you now issue command "disassemble $pc,+10", then the disassembly panel jumps to the right position, and the source panel (if any) shows "[ No Source Available ]". That is now more helpful.

However, TUI still remembers its internal "current source position", which is still the old (wrong) one. If you now resize the GDB window with the mouse, then both source and disassembly panels jump to the old, wrong position, which is very misleading. After all, resizing the window should not change the displayed addresses.

TUI's internal "current source position" only gets updated after you execute one assembly instruction. I was hoping there was some way to tell GDB to update that "current display position" right after command "monitor reset halt" and/or "flushregs".

Regards,
   rdiez
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.