Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Advice on load corefile implementation

Dear dev team,

 

I’ve recently been implementing a loadcore functionality into the DSF for a number of teams using CDT, and have run into a number of difficulties with the DSF architecture, where a few clarifications would be much appreciated!

 

The basic idea is people have a number of core files they would like to compare with each other in terms of their variables, registers, memory contents etc. The way that they are used to doing this with another platform is to load in the core file using GDBs sim loadcore, and the differences in the program state to be highlighted.

 

The simplest implementation of this feature I could envisage was loading the core in and using the highlighting features of DSF that

highlight variables etc. when they’ve changed after a step or some execution. However, I’ve run into a couple confusing issues. After the core has been successfully loaded, I’m passing a IContainerSuspendedDMEvent event (I’ve also tried a FullStackRefreshEvent) to the VMAdapter  associated with the DMVMContext of the debug context. The aim of this is to simulate a pause in the debugger and so refresh the views with updated data from GDB. According to my tests, this bubbles down the event to a collection of AbstractCachingVMProviders that create a ModelData to update the views in the necessary ways. However, while the correct deltas seemed to be produced (i.e. identical to those after a step), my event seems to show sporadic if any changes to the views.

 

For example, in the _expression_ view, only the variable’s natural value is updated to reflect the new core file’s state (even this doesn’t work sometimes) by DSF calling -data-evaluate-_expression_; I see that while other formats are requested too, -var-update is not called, unlike when a step takes place, meaning that these all return the old value of the variable.

 

It’s worth noting that a step after the core is loaded performs the highlighting and has the desired behaviour, though stepping in the loaded core goes against the aims of the implementation.

 

So my questions are:

 

1.       Is there are standard or recommended place to ask DSF to update the views in this way?

2.       How can I inform DSF that I would like it to call -var-update for registered variables / expressions , just like when a step happens?

3.       Is this feature something that anyone would be interested in having upstream?

 

If you have any suggestions or comments about any of this topic, that would be

very helpful as I’m aware this feature breaks quite a large number of expectations

about the state of GDB!

 

Thanks very much,

Hugh


Back to the top