Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Memory Analysis: (4 Items)
   
Memory Analysis  
What would prevent the entry in the Session view to display a pid.
The program is running and the debugger is attached to it. I can see the Memory Analysis Service as part of the GDB 
session. 

Don't know if that's a clue or not but I ran pidin fd on the target and no one as /dev/dbgmem opened?
Re: Memory Analysis  
> 
> What would prevent the entry in the Session view to display a pid.
> The program is running and the debugger is attached to it. I can see the 
> Memory Analysis Service as part of the GDB session. 
> 
> Don't know if that's a clue or not but I ran pidin fd on the target and no one
>  as /dev/dbgmem opened?


Got it, seems you can't attach to an already existing process.  Must launch it from the IDE  ??


RE: Memory Analysis  
Hi Mario,

You can attach to a running process.

All you need to do is (part of IDE Help Documentation - Finding Memory
Errors - Attaching to a running process):

Launching with debug malloc
To start a program using the debug malloc library: 
Launch the program using the LD_PRELOAD (set to the debug malloc library)
and MALLOC_CTHREAD (set to 1) environment variables: 
LD_PRELOAD=/tmp/libmalloc_g.so MALLOC_CTHREAD=1 ./my_app
Attaching to a running process
As mentioned above, you can analyze memory events and traces for a running
process. To do this, you need to create a launch profile, as follows: 

If the Run menu doesn't include a Profile entry, add it like this: 
Choose Customize Perspective ... from the Window menu. 
Choose the Commands tab. 
In the list of checkboxes, enable the Profile checkbox. 
Click OK. 
Choose Run-->Profile.... 
Set up the launch configuration. 
After launching, a dialog appears with a list of the running processes on
the box. Choose the process you want to attach to; the Session view then
lists it. When you select the process in the Session view, the editor
displays the information about it. 

When you're done, disconnect from the process and let it continue. 


Hope this helps!
Cheers,
Yov Yovchev


-----Original Message-----
From: Mario Charest [mailto:mcharest@zinformatic.com] 
Sent: Friday, 01 February, 2008 12:34
To: general-ide
Subject: Re: Memory Analysis

> 
> What would prevent the entry in the Session view to display a pid.
> The program is running and the debugger is attached to it. I can see the 
> Memory Analysis Service as part of the GDB session. 
> 
> Don't know if that's a clue or not but I ran pidin fd on the target and no
one
>  as /dev/dbgmem opened?


Got it, seems you can't attach to an already existing process.  Must launch
it from the IDE  ??




_______________________________________________
General
http://community.qnx.com/sf/go/post4742
RE: Memory Analysis  
You can attach to running process but you have to run it with specific
options (env vars set). Minimum you have to set LD_PRELOAD=libmalloc_g.so
and MALLOC_CTHREAD=1
After you attach to it (using profile->attach configuration) you can switch
to Settings page and enable more options. If you debugging program at the
same time, be aware that when program is stopped control options and data
transmitting would not work until you resume the program because these tasks
is part of the application you are debugging.