Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tcf-dev] Retrieve memory programmatically from a TCF target
  • From: Eugene Tarassov <eugenet@xxxxxxxxxx>
  • Date: Tue, 24 Nov 2020 20:25:24 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=xilinx.com; dmarc=pass action=none header.from=xilinx.com; dkim=pass header.d=xilinx.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BWxWjBhlUJufUYGOL7St2DRWP42UkiTKYUGHMAEwhGI=; b=mtwBeOl61YQvbfGpNm0ozDsXGwZSIJGSxwBwDi1FU2w4rMNCnZ6RVBwC9Zon7CWNQ2F0ZDiPlaaFlufZjvKrmqh2XNiZ/ZrbB0ghfn1cpEVOkskfPK4I144/u+QnJ1JxSv9CAysyakfzqFtziwJXGkCjZv4D9U8BG6VL0zgxTqK/ciR+bAvNXvMAYzQfDp5bpdavNPrYEuXfqj1RyT1dne705vfeV6l551y9zW7Iab8TjFimkjWGaFKoUBOQzdl5INpvqqGvPuq3lmI5BkO+e+o3UYWiQWLwXTemnJhJkF4WNguZ2mc2XLGyeN1wHATfMWb+VjQfYfzomlI8vpls9w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Yh+G9tfgvcJaeFwZMAmGjp6B45+DVezjf2DgTv7VPl3YjWQ8DQDkfzzDsa9DfpeAE6r8sm4R5N24Qi+3hEmh794y4D6r3i+GuGvwBwgLcac2V2blQyqNg02y06J9Wq773gTY3YvochHzTNZirT5gv6h5D55CFS/Q8Y3Td+vQYPwj7QeJG0Cf5CSUg48PdEQT+TKf28yz3huL+5zi6Jcn/mD4q0gMf8q1yTKJQUEGkIfd6nZPesymQAfdU1YawV81/MLcr/VepEZy0iVl6pVghwGs7XQflE9MbHsM+l6ah0zy07HiM7KzfJ+t6jxrKVuUZiIUN35u/uVbas4Uk9E4Xg==
  • Delivered-to: tcf-dev@xxxxxxxxxxx
  • List-archive: <https://www.eclipse.org/mailman/private/tcf-dev>
  • List-help: <mailto:tcf-dev-request@eclipse.org?subject=help>
  • List-subscribe: <https://www.eclipse.org/mailman/listinfo/tcf-dev>, <mailto:tcf-dev-request@eclipse.org?subject=subscribe>
  • List-unsubscribe: <https://www.eclipse.org/mailman/options/tcf-dev>, <mailto:tcf-dev-request@eclipse.org?subject=unsubscribe>
  • Thread-index: AdbCYnLaPLywzG3TT0G2H9JwMKYHiAAISnLQAAWrdiAAATw8YA==
  • Thread-topic: Retrieve memory programmatically from a TCF target

You need to call getBytesFromAddress or getBytesFromOffset, not getBytes().

 

Regards,

Eugene

 

From: tcf-dev-bounces@xxxxxxxxxxx <tcf-dev-bounces@xxxxxxxxxxx> On Behalf Of Alexis Bouffies
Sent: Tuesday, November 24, 2020 11:54 AM
To: TCF Development <tcf-dev@xxxxxxxxxxx>
Subject: Re: [tcf-dev] Retrieve memory programmatically from a TCF target

 

CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email.

 

Hi Eugene,

 

Thanks a lot for your answer. I tried the following code based on your recommendation:

 

IAdaptable context = DebugUITools.getDebugContext();

IMemoryBlockRetrievalExtension mem_retrieval = (IMemoryBlockRetrievalExtension)context.getAdapter(IMemoryBlockRetrievalExtension.class);

try {

                IMemoryBlock mem_block = mem_retrieval.getMemoryBlock(134533120, 1000);

                byte[] bytes = mem_block.getBytes();

} catch (DebugException e) {

                e.printStackTrace();

}

 

However I always get a byte array that is empty (whether the target is running or not). It seems that the memory block I retrieve has always null data. Am I correctly using the context?

 

If I cannot make this solution work I will take a look at the TCF APIs.

 

Thanks,

Alexis

 

From: tcf-dev-bounces@xxxxxxxxxxx [mailto:tcf-dev-bounces@xxxxxxxxxxx] On Behalf Of Eugene Tarassov
Sent: November 24, 2020 12:29 PM
To: TCF Development
Subject: Re: [tcf-dev] Retrieve memory programmatically from a TCF target

 

Hi Alexis,

 

You can use IMemoryBlockRetrievalExtension API from the Eclipse platform.

It should work with any debugger. For example:

 

IMemoryBlockRetrievalExtension mem_retrieval = (IMemoryBlockRetrievalExtension)debug_view_element.getAdapter(IMemoryBlockRetrievalExtension.class);

IMemoryBlock mem_block = mem_retrieval.getMemoryBlock(addr, size);

 

If you need better performance and more options, you can use TCF APIs directly.

See implementation of TCFMemoryBlock.getBytesFromAddress as an example.

 

Regards,

Eugene

 

From: tcf-dev-bounces@xxxxxxxxxxx <tcf-dev-bounces@xxxxxxxxxxx> On Behalf Of Alexis Bouffies
Sent: Tuesday, November 24, 2020 5:05 AM
To: tcf-dev@xxxxxxxxxxx
Subject: [tcf-dev] Retrieve memory programmatically from a TCF target

 

CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email.

 

Hi Everyone,

 

I am trying to develop an Eclipse plug-in that would allow to retrieve a memory bloc from a TCF target. I want it be generic enough so it is independent from the target hardware. The plug-in would be based on the TCF plug-in, and capable of retrieving a memory bloc based on the start address and the size. Is there any API provided as part of TCF that I could use from my plug-in?

 

I have a similar implementation for a GDB server, but I would like to be able to support both “Target Protocol”. For GDB I use DSF, but I am not able to find anything in TCF that would allow to reuse what I did in DSF.

 

Thanks in advance for your help,

Alexis


Back to the top