Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] General API to retreive a Memory Block from different targets

Hi Jonah,

 

Thanks a lot for your answer. I took a look at the IMemory service and I feel it is what I need.

 

I started to implement a solution, but I probably do something wrong. My code is the following:

 

IAdaptable context = DebugUITools.getDebugContext();

IDMContext dmc = context.getAdapter(IDMContext.class);

IMemoryDMContext memContext = context.getAdapter(IMemoryDMContext.class);

DsfSession mi = DsfSession.getSession(dmc.getSessionId());

Executor exec = mi.getExecutor();

DataRequestMonitor<MemoryByte[]> drm = new DataRequestMonitor<MemoryByte[]>(exec, null);

                               

GDBMemory gdbMem =  new GDBMemory(mi);

                               

gdbMem.getMemory(memContext, address, offset, word_size, count, drm);

 

It seems that my memContext variable is always null. I cannot find any other way to get the memory context. However I am not 100% sure I am going into the right direction.

 

Any help would be greatly appreciated.

 

Best regards,

Alexis

 

From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Jonah Graham
Sent: November 17, 2020 8:46 PM
To: CDT General developers list.
Subject: Re: [cdt-dev] General API to retreive a Memory Block from different targets

 

Hi Alexis,

 

I suspect you are looking for the IMemory DSF service (org.eclipse.cdt.dsf.debug.service.IMemory) or one of its sub-interface services (like IGDBMemory or IGDBMemory2). I don't know which of those services TCF uses.

 

The IMemory service provides methods like getMemory, setMemory and fillMemory as well as methods to query items such as addressable size, and events such as memory changed events.

 

HTH,

Jonah


~~~
Jonah Graham
Kichwa Coders
www.kichwacoders.com

 

 

On Tue, 17 Nov 2020 at 16:11, Alexis Bouffies <Alexis.Bouffies@xxxxxx> wrote:

Hi all,

 

I'm trying to use DSF to handle the debugging aspects of my custom C/C++ developer RCP.

 

I would like to develop a plug-in that would allow to extract information from a debugging session independently from the source: for instance I could debug either using a debugger that rely on the TCF protocol, or using a GDB server on target. I noticed that both those “debug options” possess a CDT DSF extension available.

 

One of my use case is to extract a Memory Block during a debug session, without having to duplicate any code for one or the other debug option. I searched for a common API in the Eclipse platform and in the CDT source code, but so far I was not able to find any leads. I am using CDT 9.8 in Eclipse 2019-06.

 

Best regards and thanks in advance,

Alexis

_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/cdt-dev


Back to the top