Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Freeze / Deadlock in GdbMemoryBlock.fetchMemoryBlock

Hi,

I came to a solution of my problem and just wanted to let you know what I did.

The problem was most likely caused by deadlocking the worker thread and main thread. I implemented if differently to do the memory-retrieval in a Job, synchronizing the Data by a RequestMonitor - and now, I am able to acquire as much memory as I want without deadlocking. 

final RequestMonitor rm = new RequestMonitor(block, address);
		
Job job = new Job("Retrieving Some Memory") {
   protected IStatus run(IProgressMonitor monitor) {
   if (!monitor.isCanceled()) {
       getBytes(rm);
   }
   return Status.OK_STATUS;
  }
};
job.setSystem(true);
job.setRule(new NotifyRule());
job.schedule();

This job gets re-scheduled again and again until I have all bytes acquired. While this is no AAA software-engineering, yet, at least it solves my memory deadlock issue.

Thank you Pawel for guiding me in the right direction.

Kind regards,

Tobias.

> Date: Mon, 31 Jan 2011 08:59:15 -0800
> From: Pawel Piech <pawel.piech@xxxxxxxxxxxxx>
> 
> Hi Tobias,
> Do you see the requests for memory being completed in the GDB trace (you 
> can see it in the console view).  Also, if the request is never 
> completing, you should trace the execution in the MIMemory service.
> 
> Hope this helps,
> Pawel
> 
> 
> On 01/31/2011 12:32 AM, Tobias Tost wrote:
> > Hello there,
> >
> > I'm currently playing around with the CDT/Eclipse plugin functionalities. Now, I am at the point where I am a little bit desperate how to proceed - being > overwhelmed by the huge API.
> >
> > My current goal: add a MemoryView that fetches data from the GDB connection to a remote host, convert it to image data and siplay it in the memory view > pane. Sadly, I'm not able to fetch enough data to achieve this - I always get stalls/freezes when asking for more than 32K, which will easily be beaten by even small > images. The stack is this:
> >
> > Object.wait(long) line: not available [native method]	
> > Query$QueryRm(Object).wait() line: 485 [local variables unavailable]	
> > GdbMemoryBlock$1(Query<V>).get() line: 105	
> > GdbMemoryBlock.fetchMemoryBlock(BigInteger, long) line: 176	
> > GdbMemoryBlock(DsfMemoryBlock).getBytesFromAddress(BigInteger, long) line: 310	
> > GdbMemoryBlock(DsfMemoryBlock).getBytesFromOffset(BigInteger, long) line: 275	
> >
> > - it is simply whaiting for ever for a request to be done
> >
> > while (!isDone()) {
> >       fRm.wait();
> >   }
> >
> > I already tried to
> > - split the fetchMemoryBlock-Calls to 4K units
> > - shift the base-address of my IMemoryBlockExtension during the loop
> > - inserting Thread.sleep in the loop
> >
> > Also, I'm currently tinkering the addresses by using manual memory offsets in the style of
> >
> > adress += sizeof(CTypes.kCType_int, baseSize);
> > int pitch = toInt(block.getBytesFromAddress(new BigInteger(adress .toString()), sizeof(CTypes.kCType_int, baseSize)));
> >
> > which is ugly and not very reliable - is there a way to use the debug information that must be available to retrieve the correct variable data as it is shown in the > Variables-View?
> >
> > Sorry if I mixed up two topics with one mail.
> >
> > Thanks in Advance,
> >
> > Tobias

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
NSM-LOEWEN ENTERTAINMENT GmbH
Saarlandstrasse 240, 55411 Bingen am Rhein
Postanschrift: Postfach 1564, 55385 Bingen
Tel.: +49 6721 407-0
E-Mail: info@xxxxxxxxx
Web: http://www.loewen.de 
Geschaeftsfuehrer: Christian Arras (Vorsitzender), Willi Granold
Vorsitz im Aufsichtsrat: Dr. Theo Waigel
Amtsgericht Mainz, HRB 23327 
USt-Id.-Nr. DE 148266135



Back to the top