Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Debugging a running process...: (22 Items)
   
Debugging a running process...  
How does one go about connecting to a running process to debug it?
RE: Debugging a running process...  
Debug configurations->C/C++ Qnx Attach to Process w/Qconn (IP)

-----Original Message-----
From: Frank Rudolph [mailto:rudolph@beaconpower.com] 
Sent: January 11, 2008 3:53 PM
To: momenticsgs-community
Subject: Debugging a running process...

How does one go about connecting to a running process to debug it?

_______________________________________________
QNX Momentics Getting Started
http://community.qnx.com/sf/go/post4247
Re: RE: Debugging a running process...  
>> Debug configurations->C/C++ Qnx Attach to Process w/Qconn (IP)

Hate to be a dunce, but where do I find "Debug Configurations"?

- Frank
 
RE: RE: Debugging a running process...  
Launch configurations dialog. In my version Run->Open Debug Dialog...
Are you sure it is not mentioned in Help documentation anywhere?
Re: RE: RE: Debugging a running process...  
>> In my version Run->Open Debug Dialog...

AHA! There's no "RUN" menu item on my main menu toolbar.
I thought there was one previously, but not now. I've check all the perspectives... same story.

- Frank
RE: RE: RE: Debugging a running process...  
I have IDE 4.5. If you have 4.0.1 it may be called differently (eclipse guys
renamed it), but it is same dialog where run/debug configurations. How to
you normally edit debug configuration???
Try right click Debug As...-> Open Debug Dialog... or soothing like this.

-----Original Message-----
From: Frank Rudolph [mailto:rudolph@beaconpower.com] 
Sent: January 11, 2008 4:40 PM
To: momenticsgs-community
Subject: Re: RE: RE: Debugging a running process...

>> In my version Run->Open Debug Dialog...

AHA! There's no "RUN" menu item on my main menu toolbar.
I thought there was one previously, but not now. I've check all the
perspectives... same story.

- Frank


_______________________________________________
QNX Momentics Getting Started
http://community.qnx.com/sf/go/post4256
Re: RE: RE: Debugging a running process...  
On Jan 11, 2008 4:39 PM, Frank Rudolph <rudolph@beaconpower.com> wrote:

> >> In my version Run->Open Debug Dialog...
>
> AHA! There's no "RUN" menu item on my main menu toolbar.
> I thought there was one previously, but not now. I've check all the
> perspectives... same story.
>
Perspectives can be configured with different commands, which in turn will
populate the toolbar
and menu bar content.  Generally they try and include the commands which are
most relevant
to the main activity of the perspective, but sometimes that isn't what you
as an end user may
want (sometimes more, sometimes less).

For any given perspective you can customize it:
 Window > Customize Perspective ...

and select the items which are most relevant to you.  Unfortunately, other
than editiing the
plugin, there is no easy way to spread a command across all possible
perspectives .. though
you can create your own perspective that has all the stuff you commonly use.

You might want to take a look through the debugging chapter in the IDE help
documentation
since it covers several of your questions (like how to attach to a running
process) and includes
pictures to help.
 Help > Help Contents

Hope this helps ... and keep asking the good questions, others out there
benefit from the
discussion I'm sure.
 Thomas
RE: RE: RE: Debugging a running process...  
That's all fine and good. But
1. I couldn't find anything in un der Customize Perpectives that allowed
you to change the words at the top of the main menubar. 
2. Today when I came in and tried the same experiments with this
platform, the main menubar read:

"File   Edit   Navigate   Search   Project   Run   Window   Help"

Yesterday it read:

"File   Edit   Navigate   Search   Project   Log   Window   Help"

Under Log, yesterday, it had all the things that today are under Run.

Doesn't that seem a little weird to you?

- Frank


-----Original Message-----
From: Thomas Fletcher [mailto:tfletche@gmail.com] 
Sent: Saturday, January 12, 2008 12:12 PM
To: momenticsgs-community
Subject: Re: RE: RE: Debugging a running process...

On Jan 11, 2008 4:39 PM, Frank Rudolph <rudolph@beaconpower.com> wrote:

> >> In my version Run->Open Debug Dialog...
>
> AHA! There's no "RUN" menu item on my main menu toolbar.
> I thought there was one previously, but not now. I've check all the
> perspectives... same story.
>
Perspectives can be configured with different commands, which in turn
will
populate the toolbar
and menu bar content.  Generally they try and include the commands which
are
most relevant
to the main activity of the perspective, but sometimes that isn't what
you
as an end user may
want (sometimes more, sometimes less).

For any given perspective you can customize it:
 Window > Customize Perspective ...

and select the items which are most relevant to you.  Unfortunately,
other
than editiing the
plugin, there is no easy way to spread a command across all possible
perspectives .. though
you can create your own perspective that has all the stuff you commonly
use.

You might want to take a look through the debugging chapter in the IDE
help
documentation
since it covers several of your questions (like how to attach to a
running
process) and includes
pictures to help.
 Help > Help Contents

Hope this helps ... and keep asking the good questions, others out there
benefit from the
discussion I'm sure.
 Thomas


_______________________________________________
QNX Momentics Getting Started
http://community.qnx.com/sf/go/post4260
Re: RE: RE: Debugging a running process...  
On Jan 14, 2008 6:14 PM, Frank Rudolph <rudolph@beaconpower.com> wrote:

> That's all fine and good. But
> 1. I couldn't find anything in un der Customize Perpectives that allowed
> you to change the words at the top of the main menubar.
> 2. Today when I came in and tried the same experiments with this
> platform, the main menubar read:
>
> "File   Edit   Navigate   Search   Project   Run   Window   Help"
>
> Yesterday it read:
>
> "File   Edit   Navigate   Search   Project   Log   Window   Help"
>
> Under Log, yesterday, it had all the things that today are under Run.
>
> Doesn't that seem a little weird to you?
>
Yes ... though I have seen the same thing myself when I was running a remote
VNC connection.  I think that it has to do with the fact that there is a Log
menu
contribution that provides content into the Run menu items, and a race
condition
on 'who contributes to the menu first' ... at least my current theory,
though I haven't
seen the problem again to come up with a reproducible case for a bug report.

So if you are seeing it repeatedly, lets get a bug report in with your
environment
and see what can be done to fix what is certainly a confusing problem.

Thanks,
 Thomas
RE: RE: RE: Debugging a running process...  
Based on my experience with Wind River, I was wondering when the subject
of log files would come up. Every time I contacted them about a problem
they would tell me to send them the error log file and file a TSR report
to track the problem. Are there similar tools QNX routinely uses to
track down a bug?
- Frank

-----Original Message-----
From: Thomas Fletcher [mailto:tfletche@gmail.com] 
Sent: Monday, January 14, 2008 7:21 PM
To: momenticsgs-community
Subject: Re: RE: RE: Debugging a running process...

On Jan 14, 2008 6:14 PM, Frank Rudolph <rudolph@beaconpower.com> wrote:

> That's all fine and good. But
> 1. I couldn't find anything in un der Customize Perpectives that
allowed
> you to change the words at the top of the main menubar.
> 2. Today when I came in and tried the same experiments with this
> platform, the main menubar read:
>
> "File   Edit   Navigate   Search   Project   Run   Window   Help"
>
> Yesterday it read:
>
> "File   Edit   Navigate   Search   Project   Log   Window   Help"
>
> Under Log, yesterday, it had all the things that today are under Run.
>
> Doesn't that seem a little weird to you?
>
Yes ... though I have seen the same thing myself when I was running a
remote
VNC connection.  I think that it has to do with the fact that there is a
Log
menu
contribution that provides content into the Run menu items, and a race
condition
on 'who contributes to the menu first' ... at least my current theory,
though I haven't
seen the problem again to come up with a reproducible case for a bug
report.

So if you are seeing it repeatedly, lets get a bug report in with your
environment
and see what can be done to fix what is certainly a confusing problem.

Thanks,
 Thomas


_______________________________________________
QNX Momentics Getting Started
http://community.qnx.com/sf/go/post4291
Re: RE: RE: Debugging a running process...  
On Jan 15, 2008 8:31 AM, Frank Rudolph <rudolph@beaconpower.com> wrote:

> Based on my experience with Wind River, I was wondering when the subject
> of log files would come up. Every time I contacted them about a problem
> they would tell me to send them the error log file and file a TSR report
> to track the problem. Are there similar tools QNX routinely uses to
> track down a bug?
> - Frank
>
Would we be a software company if we didn't have a bug tracking system =;-)

If you have priority support, then you should work with your priority
support
technical account manager (TAM) to get the issue addressed and a patch
issued if required.  If you only have standard support, then you can report
the issue, and a problem report will be filed on your behalf.  The standard
information should be gathered in both cases: host/target environments and
software versions, any log files or core dumps etc.

It is on the community roadmap to open up the bug tracking system, but the
integration is deeply embedded into many other systems which is why it
hasn't been part of the initial community roll-out.

Working with developers through these forums is also great, but for issues
that are more than simply 'how do I get to A from B" and are true bugs,
we should make sure that they get recorded and tracked officially.

Thanks,
 Thomas ... who is currently on leave from QNX
RE: RE: RE: Debugging a running process...  
What is the difference between "Standard support" and "priority
support"?
If I pay (approx) $1800 per year for support, which is this?
- Frank

-----Original Message-----
From: Thomas Fletcher [mailto:tfletche@gmail.com] 
Sent: Tuesday, January 15, 2008 9:10 AM
To: momenticsgs-community
Subject: Re: RE: RE: Debugging a running process...

On Jan 15, 2008 8:31 AM, Frank Rudolph <rudolph@beaconpower.com> wrote:

> Based on my experience with Wind River, I was wondering when the
subject
> of log files would come up. Every time I contacted them about a
problem
> they would tell me to send them the error log file and file a TSR
report
> to track the problem. Are there similar tools QNX routinely uses to
> track down a bug?
> - Frank
>
Would we be a software company if we didn't have a bug tracking system
=;-)

If you have priority support, then you should work with your priority
support
technical account manager (TAM) to get the issue addressed and a patch
issued if required.  If you only have standard support, then you can
report
the issue, and a problem report will be filed on your behalf.  The
standard
information should be gathered in both cases: host/target environments
and
software versions, any log files or core dumps etc.

It is on the community roadmap to open up the bug tracking system, but
the
integration is deeply embedded into many other systems which is why it
hasn't been part of the initial community roll-out.

Working with developers through these forums is also great, but for
issues
that are more than simply 'how do I get to A from B" and are true bugs,
we should make sure that they get recorded and tracked officially.

Thanks,
 Thomas ... who is currently on leave from QNX


_______________________________________________
QNX Momentics Getting Started
http://community.qnx.com/sf/go/post4305
RE: RE: RE: Debugging a running process...  
Call qnx support line, or write mail to standard@qnx.com
They should be able to clarify it for you. Also it you have support plan it
might be faster to talk to them directly rather than in the open forum.
RE: RE: RE: Debugging a running process...  
Let me clarify what you have done and what is not working.

You have sources and binaries mounted using samba on host machine.
You compile on target machine, and this is a same as "debugging" target.
In this case the following scenario should work:

- Create standard make project 
- Inside a project create a linked resource pointing to mounted directory
(Or create a project in "non standard" location pointing to mounted
directory)
- After every re-build of source hit Refresh on the project

To debug:
- Create QNX Qconn (IP) launch configuration
- Select executable in main tab pointing to host executable
- Select run executable on target in Download tab and select executable on
target
- In source tab Add..->Path Mapping->Ok. Click Edit... on Path Mapping and
add path mapping between host and target source path
- Launch debugger

RE: RE: RE: Debugging a running process...  
I need a little more specifics...

How do I "create a linked resource pointing to mounted directory"
How do I " create a project in "non standard" location pointing to
mounted
Directory"

What I have done instead is to just import the source code and the
binary executable. This seems to work, but as for automatic
synchronization between the resource and the host resident source code,
I have had to use a source compare utility to synchronize them.

Thanks again
- Frank

-----Original Message-----
From: Elena Laskavaia [mailto:elaskavaia@qnx.com] 
Sent: Tuesday, January 15, 2008 10:47 AM
To: momenticsgs-community
Subject: RE: RE: RE: Debugging a running process...

Let me clarify what you have done and what is not working.

You have sources and binaries mounted using samba on host machine.
You compile on target machine, and this is a same as "debugging" target.
In this case the following scenario should work:

- Create standard make project 
- Inside a project create a linked resource pointing to mounted
directory
(Or create a project in "non standard" location pointing to mounted
directory)
- After every re-build of source hit Refresh on the project

To debug:
- Create QNX Qconn (IP) launch configuration
- Select executable in main tab pointing to host executable
- Select run executable on target in Download tab and select executable
on
target
- In source tab Add..->Path Mapping->Ok. Click Edit... on Path Mapping
and
add path mapping between host and target source path
- Launch debugger



_______________________________________________
QNX Momentics Getting Started
http://community.qnx.com/sf/go/post4310
RE: RE: RE: Debugging a running process...  
I still need to know the version of IDE you are using, because steps are
different.

To create a link folder 
Right click on Project -> New -> Folder
Click Advanced>>
Select Link to folder in file system
Browse...

To create project in non standard location (it must be read-write in this
case)
Pick a wizard for new project creation for standard make project (steps are
different for different version)
In first page of wizard uncheck "Use default location"
Navigate to mounted directory that contain root of project and select it
RE: RE: Debugging a running process...  
Just checked user doc on it for IDE. It does not describe debug Attach...
Sorry about that, I will submit a pr.
Re: Debugging a running process...  
On Fri, Jan 11, 2008 at 03:52:57PM -0500, Frank Rudolph wrote:
> How does one go about connecting to a running process to debug it?

localhost:/home/seanb >cat &
[1] 974900
localhost:/home/seanb >gdb /bin/cat 974900
GNU gdb 5.2.1qnx-nto
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for
details.
This GDB was configured as "ntox86"...(no debugging symbols found)...
Attaching to program `/bin/cat', process 974900
Reading symbols from /home/seanb/svn/stage/x86/lib/libc.so.2...done.
Loaded symbols for /home/seanb/svn/stage/x86/lib/libc.so.2
[Switching to process 974900]
0xb0331833 in MsgSend () from /home/seanb/svn/stage/x86/lib/libc.so.2
(gdb) bt
#0  0xb0331833 in MsgSend () from
/home/seanb/svn/stage/x86/lib/libc.so.2
#1  0xb03178bd in read () from /home/seanb/svn/stage/x86/lib/libc.so.2
#2  0x080486ba in _btext ()
#3  0x08048914 in main ()
(gdb)
Re: Debugging a running process...  
Thank you. 

Although I was actually wondering how to do it from the IDE, this will be useful too!

- Frank
Re: Debugging a running process...  
On Fri, 2008-01-11 at 15:52 -0500, Frank Rudolph wrote:
> How does one go about connecting to a running process to debug it?

Look at the 'attach' command in gdb.

All that 'attach' needs is the pid of the running process.  For a local
process, that's all you need.

If you are debugging on a remote system, then 'pdebug' needs to run on
the remote system, and gdb needs to connect to pdebug before you run
gdb's 'attach'  ('target qnx <target_ip_addr> <pdebug_tcp_port>' command
in gdb).

Of course, all of this is done automagically if you use the IDE with
qconn.

But if you are a minimalist, you can just run gdb+pdebug from the
command line.

Re: Debugging a running process...  
OK ... Time-out. Can we get back to the original question?

How do I attach to a remote process using the latest Momentics 4.0.1? I see "C/C++ QNX Attach to a Process w/QConn" in 
the DEbug Configuration but I don't understand the steps required setup a configuration and actually attach to a process
.

Can some one please be specific?
RE: Debugging a running process...  
Create a configuration under C/C++ QNX Attach to a Process w/Qconn
- select a binary matching running process
- select a project
- select a target
Run process on a target (or it is already running)
Select this configuration from Run->Debug... and click Debug button 
Window with process list would pop up
Select a process that you want to attach
Debugger would start in IDE