Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Retrieving data from events

Hello Gidi,

You may want to listen to the more specialised IContainerResumedDMEvent which has IContainerResumedDMEvent.getTriggeringContexts() if the thread is known. There is a similar one for suspended, IContainerSuspendedDMEvent which has a getTriggeringContexts, and even a subclass of it called IBreakpointHitDMEvent, which additionally has getBreakpoints. The latter can be passed to IBreakpoints.getBreakpointDMData() for more data (such as the line and file that was hit).

Although probably not needed at this point, to get the threads within a process use IGDBProcesses.getProcessesBeingDebugged() passing the container context. See my previous email on how to use it.

PS What is the context of these questions? As CDT is evolving effort is going into a new debug implementation that is simpler and based on the debug protocol. However the CDT community needs to know how extenders are actually using CDT in practice, so please let me know. Additionally I would like to know what is it that made this topic come up now. Is this a dormant project being restarted, or an active project that hasn't upgraded in a long time? The reason I ask is IBM was highly involved in CDT in the past, but the code you are referring to was deprecated years ago and finally removed in June 2016. While there is no current plan to remove DSF, it will likely be deprecated once the new debug implementation is at approximate feature parity. Please keep us informed and join us so that your use cases can be considered part of feature parity.


Jonah Graham
Kichwa Coders

On Mon, 9 Dec 2019 at 10:30, Gidi Gal1 <GGal1@xxxxxxxxxx> wrote:

My CDT extension listens to old DebugEvent events and extracts some data. I would like to extract this data with DSF.
The following data is extracted:

- Thread name
        Retrieved by ((IThread)DebugEvent.getSource()).getName() (Assuming the the source is IThread)
        I found there is IThreadDMContext, which represents a thread. Once you have this context, you can retrieve IThreadDMData, which has getName() function. I look at the returned value of IResumedDMEvent.getDMContext(). It returns GDBContainerDMC_7_4 - it extends (eventually) IContainerDMContext, which represents a process, not a thread. I could not find a method which retrieves IThreadDMContext(s) from IContainerDMContext. Is it possible ?

- Detail - retreived by DebugEvent.getDetail();
        I assume that the method IResumedDMEvent.getReason() should supply the information for detail. Is this correct ?

- Line & location - retrieved by IThread.getBreakpoints() and then inspecting the first instance. If getMarker() does not return null, location will be IMarker..getResource().getFullPath().toOSString(). If the breakpoint is ILineBreakpoint, line is retrieved by ILineBreakpoint.getLineNumber().
        I found IBreakpointsExtension which retrives IBreakpointDMContext(s) from IExecutionDMContext. From there I assume I should use IBreakpoints.getBreakpointDMData which seems to have this data. Is this correct ?

cdt-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit

Back to the top