Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Extending Embedded Target Debug Register View(Add peripheral registers to register view using plugin)
Extending Embedded Target Debug Register View [message #1755545] Sun, 05 March 2017 14:15 Go to next message
Colton Murphy is currently offline Colton MurphyFriend
Messages: 6
Registered: July 2015
Junior Member
I am developing a plugin for an eclipse debugging experience based on CDT. The plugin will include several views which talk through DSF and the GDB server to read variables and memory and display them in my views.

Eclipse seems to come with a Register view which allows me to view the general purpose registers for my target (cortex m) while debugging. I would like to pose an inquiry as to whether or not this view can be extended by adding more register groups such as memory mapped peripheral registers.

Is there a way to extend the standard register view such that I can view peripheral registers in the view in my plugin? I am 80% sure this is possible, because IAR has an eclipse plugin that puts all the peripheral registers in the standard register view while debugging... I just don't know how they implemented this.

The reason we are not using one of the register view plugins such as gnu arm eclipse register view or embedded systems register view is because I want to only have a single register view in the perspective with all the registers like the IAR plugin. I do not want to have to use 2 views, one for GP registers and one for peripherals. I would like to investigate if the standard view can be extended first.

Thanks

[Updated on: Sun, 05 March 2017 14:43]

Report message to a moderator

Re: Extending Embedded Target Debug Register View [message #1755563 is a reply to message #1755545] Sun, 05 March 2017 18:01 Go to previous messageGo to next message
Colton Murphy is currently offline Colton MurphyFriend
Messages: 6
Registered: July 2015
Junior Member
I am working on a solution to this which seems promising. The issue is that I wanted to reuse the existing debug register view provided by eclipse because for the general registers, it has all the built in connections to the other views to make them update when a general register is changed. For example if I have a local variable stored in a register and I update that register, the variable in the variables view will also update. Apparently all the connections between the views are done at the DSF service level and not the view level. I am using the MIRegister service to read and write general registers to the target. When I perform a write operation, the other views are registered with the MIRegister service and as a result update when a register changes. This means I do not have to use the built in eclipse register view.

I do not mind making a complete "extended register view" that includes the CPU core registers to replace the built in eclipse register view as long as all the other views update upon service register changes and it looks like they do.

The issue that I face now is getting the debug view stack to update when I change the PC or stack pointer registers. The debug view just sits there dead as a door nail. I am not sure what service I would use to tell the debug view to update and correspondingly move to a new source file location or open up a new source file upon PC and stack pointer changes.

[Updated on: Sun, 05 March 2017 18:04]

Report message to a moderator

Re: Extending Embedded Target Debug Register View [message #1755825 is a reply to message #1755563] Wed, 08 March 2017 13:35 Go to previous message
Alex Freidin is currently offline Alex FreidinFriend
Messages: 32
Registered: July 2009
Member
I am also interested in getting the debug views updated when the PC register changes. The Debug view doesn't update itself when PC changes in the standard CDT on native x86, i.e. by changing EIP register in Registers or Console views.
I guess that DSF didn't implement the connection between the "PC" register and the other views. DSF is independent of the target's register set, so naturally it doesn't know the name of PC register on the target and when "PC" changes. Here is my GDB trace log showing the change of EIP (aka PC) on x86 and it's missing the update commands for other views:

743,888 164-var-create --thread 1 --frame 0 - * $eip
743,904 164^done,name="var4",numchild="0",value="0x40139a <main+14>",type="void (*)()",has_more="0"
743,904 (gdb)
743,904 165-var-assign var4 0x4013c6
743,920 165^done,value="0x4013c6 <main+58>"
743,920 (gdb)
743,967 166-data-list-register-values --thread 1 --frame 0 x 8
743,982 166^done,register-values=[{number="8",value="0x4013c6"}]
743,982 (gdb)
743,982 167-data-list-register-values --thread 1 --frame 0 N 8
743,998 167^done,register-values=[{number="8",value="0x4013c6 <main+58>"}]
743,998 (gdb)

IMO, it is uncommon for the user to update the PC via Registers or Console view. The user should use the menu "Move to Line" instead. So, it seems reasonable only enable the "Refresh" button that updates the debug views. See the yellow refresh icon in the screenshots from CDT FAQ:

https://wiki.eclipse.org/images/6/60/MultiProducerConsumer.png

https://wiki.eclipse.org/images/5/5b/TraceVisualization.png

https://wiki.eclipse.org/images/1/13/CDT_GroupExpr.png

Unfortunately, it is hidden by default. To enable it, switch to Debug perspective, then open Window > Perspective > Customize Perspective > Action Set Availability and check Debug Update Modes. Then, "Refresh Debug Views" button should appear in the views.

Question is how to pre-configure an Eclipse installation, so that it is enabled by default? It is not saved when exporting preferences, so plugin_customization.ini is probably not the place.
On other hand, why is it hidden by default? Shouldn't it be always enabled? Thoughts? Is it active under certain debug configuration, e.g. remote debug or non-stop debug and considered not useful for other setups?
I doubt that a typical user will easily find it.
Previous Topic:Compile for 32bit ARM target on 64bit Ubuntu
Next Topic:Preprocessor include paths missing
Goto Forum:
  


Current Time: Tue Mar 19 02:02:31 GMT 2024

Powered by FUDForum. Page generated in 0.15009 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top