Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Can't debug: (19 Items)
   
Can't debug  
I'm using 4.5.  I created an C++ Project which is in fact a collection of programs.  I don't use the IDE to build the 
applications but mainly just to edit and debug.

When I want to debug a program i go in the debug manager and create a new configuration.

First thing that is strange is how sluggish the interface becomes. Switching form the the Main tab to the Debugger tab 
for example takes over a second.  Yet only 10% of the CPU is used.  Note that the project lives on a different machine 
so everything goes across the network.  I can see the IDE is loading the executable ( via some windows tools: taskinfo )
  every time I switch tabs.  I'm assuming it's trying to parse it.

Now I click "Browse" to select the executable, but I always get the error "Program not found".  I'm stuck there, the 
DEBUG button stays disabled.

What am I missing.

RE: Can't debug  
Are you using Managed Projects?

Check the project configuration. Make sure you have QNX Binary Parser
enabled. Project->Properties... C/C++ Build->Settings->Binary parsers tab
(and disable others if you have them)

Re: RE: Can't debug  
> Are you using Managed Projects?
> 
> Check the project configuration. Make sure you have QNX Binary Parser
> enabled. Project->Properties... C/C++ Build->Settings->Binary parsers tab
> (and disable others if you have them)
> 

That did it, thanks!  It's still slow while browsing from tab to tab, but I can live with that.

Now onto using the Memory Analysis tool


Re: RE: Can't debug  
On Jan 7, 2008 6:16 PM, Mario Charest <mcharest@zinformatic.com> wrote:

> > Are you using Managed Projects?
> >
> > Check the project configuration. Make sure you have QNX Binary Parser
> > enabled. Project->Properties... C/C++ Build->Settings->Binary parsers
> tab
> > (and disable others if you have them)
> >
>
> That did it, thanks!  It's still slow while browsing from tab to tab, but
> I can live with that.
>
I don't think that I can live with that.  We should be able to short circuit
what ever work we
are doing on tab/configuration changes.

Is the binary particularly large, or just 'across the network'?  Anything
else that is particular
that we could use to ferret out the issue .. which will likely be on the CDT
side of the world.

Thanks,
 Thomas
Re: RE: Can't debug  
> On Jan 7, 2008 6:16 PM, Mario Charest <mcharest@zinformatic.com> wrote:
> 
> > > Are you using Managed Projects?
> > >
> > > Check the project configuration. Make sure you have QNX Binary Parser
> > > enabled. Project->Properties... C/C++ Build->Settings->Binary parsers
> > tab
> > > (and disable others if you have them)
> > >
> >
> > That did it, thanks!  It's still slow while browsing from tab to tab, but
> > I can live with that.
> >
> I don't think that I can live with that.  We should be able to short circuit
> what ever work we
> are doing on tab/configuration changes.

I think so to which is why I mentioned it.
> 
> Is the binary particularly large, or just 'across the network'? 

The debug version is 8M, accessed via Samba.  The non debug version is 600K.

This morning I created a small test case cause I couldn't get Memory analysis to work on my program ( first time I'm 
using that tool). The debug version of that small test case is 189k. It's still very slugish when going from tab to tab.
 

I can see that 189k is transfer almost instantaneously but then the IDE seems to be seeking back in forth into the file.


Just as I'm testing now to get these number, from the Debug dialog I switch configuration from the test case program to 
the real program and the IDE froze for about 5 seconds.  During that 5 seconds the IDE was seeking all around the test 
case executable.

It also seems that the delay is different depending on which tab I go to.  Going from Debugger to Common takes about 1 
seconds. Going from Common to Debugger takes about 7 seconds.  From Debugger to tools 4 seconds. 

> Anything else that is particular that we could use to ferret out the issue .. which will likely be on the CDT
> side of the world.
> 

Hope that's enough.

> Thanks,
>  Thomas


RE: RE: Can't debug  
About Memory Analysis not working - can you try example from cheat sheet
first?

About delays in tabs - I never saw it myself. Do you have workspace
directory on network drive? It may store/read configurations file from
there.
Re: RE: RE: Can't debug  
> About Memory Analysis not working - can you try example from cheat sheet
> first?
> 

It took about 1 minute after I clicked run to get something in the MemoryAnalysis Session View entry ( I though it 
wasn't working at first). When it showed up data, there was 2 pids?  Each with the process name mallocbad.

I just tried it again after deleting the MemoryAnalysis entry in the Session View.  Tooki about 15 seconds to see the 
list of files show up in the Console View.  The data appeared about 1 minutes later.  Still with 2 pids.

Strangely the Overview: Request Allocations graph shows negative sizes. Graph size go from -2096 to 2096.  The details::
Allocations view contains no data.

If I go in the statistic tab, under the Allocation tab there is no data, but backtrace, outstanding traces and error do 
have data in.


I tried with memory_leak and this time only one pid showed up and I could see the data being updated.  However Details:
Allocations is empty but under statistic there is some data.  Overview Requestion Allocations still shows up negative 
value.

> About delays in tabs - I never saw it myself. Do you have workspace
> directory on network drive? It may store/read configurations file from
> there.

The workspace is local.  Everything else is on a network drive.



Re: RE: RE: Can't debug  
Just realized I'm using 20071116 *( as seen from the About dialog ).

I'll update to 20071206 to see if that makes a difference.

- Mario
Re: RE: RE: Can't debug  
> Just realized I'm using 20071116 *( as seen from the About dialog ).
> 
> I'll update to 20071206 to see if that makes a difference.
> 
Different behavior but not much better.

Browsing through tab is still low.

When starting malloc bad it took only about 15 seconds to show up with some data.  After about 1 second though the 
memory_leak in Session View showed an entry for pid 1, then 14 seconds later 2 pids showd up. All of them are named 
mallocbad.

This time Overview:: Request Allocations showed size value to be between -1 and 1. 

I tried this on Trinity and 6.3.2 with no difference.

> - Mario


Re: RE: RE: Can't debug  
Tried it on a freshly installed 6.3.2 (Windows) and on a freshly installed target 6.3.2 and still the same behavior.

Mario
memory analysis  
Memory Analysis (you should have started the other thread too with different
subj :)

Two pids can be caused by unkilled old process, check process information
view to see how many mallocbad processes are running when you launch memory
analysis (unfortunately it will not filter data on only process that you
launched at this point, but you can filter it by simply double clicking on
pid that you need).

Delays in data is currently part of the deal, because when process crashes
it require some timeout expired to make sure it is not some network
disconnect (and it would be the case with mallocbad - it will crash at the
end).

For the other unexplained issues please read the manual about allocations of
negative size and what need to be done to populate other tabs if you need
them. You also can read an article about Memory Profiling at
http://community.qnx.com/sf/docman/do/downloadDocument/projects.ide/docman.r
oot.design/doc1242


Re: memory analysis  
> 
> Memory Analysis (you should have started the other thread too with different
> subj :)
> 
;-)
> Two pids can be caused by unkilled old process, check process information
> view to see how many mallocbad processes are running when you launch memory
> analysis (unfortunately it will not filter data on only process that you
> launched at this point, but you can filter it by simply double clicking on
> pid that you need).
> 
> Delays in data is currently part of the deal, because when process crashes
> it require some timeout expired to make sure it is not some network
> disconnect (and it would be the case with mallocbad - it will crash at the
> end).
> 

There is got to be a way to find out faster if the process really crashed or if it's a network issue.

> For the other unexplained issues please read the manual about allocations of
> negative size and what need to be done to populate other tabs if you need
> them. You also can read an article about Memory Profiling at
> http://community.qnx.com/sf/docman/do/downloadDocument/projects.ide/docman.r
> oot.design/doc1242
> 

Ouch a real case of RTFM, thanks for pointing that out to me.

> 


Re: RE: Can't debug  
> Are you using Managed Projects?
> 
> Check the project configuration. Make sure you have QNX Binary Parser
> enabled. Project->Properties... C/C++ Build->Settings->Binary parsers tab
> (and disable others if you have them)
> 


I am having a similar problem.
I get a "[Main]: Program not found" message, and I have tried to follow your instructions. 

I  found a Binary Parsers tab and the QNX binary parser is the only one enabled. 

What is very mysterious is that this project used to be debuggable.
I started trying to debug a DIFFERENT application (with a new project) and got this error message. I hacked on the 2 
project configurations to try and see what the difference between them was. During the hacking around, something changed
 (accidentally?) and suddenly neither of the projects were debuggable.

While I continued my trial and error session to find the reason for the problem, the debug button lit up (even though 
the error message was still there). I expected that the debug session would start with no source visible, but instead 
the debug session tried to start and then a new message box popped up saying there had been a timeout when trying to 
activate the code coverage tool (which I didn't want nor had I enabled). 

Sadly (or happily, depending on your viewpoint) now I can't replicate this problem. 
I finally arrived at this conclusion:

Under C/C++ Application in the main tab of the debug configuration, if I Search the project for the executable file, the
 error message goes away. If I browse directly to the target file system to find THE SAME DAMN FILE, the error message 
persists and prevents debugging.

I have no problem with this state of affairs except that after I have built this project over and over again to try and 
get to this point, I am completely stumped as to how the executable made it into the project. In the other versions of 
this project, when I selected "Search Project" the underlying screen came up blank.

What is further confounding is that SOMETIMES (I don't know how) SOME versions of the project allowed me to browse 
directly to the target file system and debug just fine.

I think there are some problems with this strategy of using the target system as the build platform and just debugging 
from Momentics, but I have no choice in my case. I can't put a Momentics style project make together until after I 
migrate the existing code (a huge body of code with a hand-crafted Makefile that is not Momentics friendly).  I wish you
 guys had a GOOD step by step tutorial that covered this type of project use. The toy projects you provide showing "
Hello World", and various applications of semaphores and MUTEXes are interesting, but are pretty much self-evident. 

The problems that one encounters migrating large applications from Linux to QNX are NOT!!

Now what was my question, again??? Oh yeah, how does one make sure the binary executable ends up in the project?

Thanks - Frank
Re: RE: Can't debug  
Good lord!
Now I have tried (with my recent "success" fresh on my mind) to create a new project.

This time, since I selected a project type of "Standard C++ Makefile", instead of "Standard C Makefile" project, AND I 
imported the executable into the project (which seems to have worked by eliminating the Program Not Found message)

Now I can no longer select the QNX GDB debugger

No matter which debugger I select, Cygwin, gdb, gdb/mi or gdbserver, I get a popup message that says "Invalid debugger 
type"

So if I use C++ syntax in much of the code, must I select a C++ Makefile?
Perhaps a Standard C Makefile, which apparently brings the QNX gdb debugger with it by default, is good enough?

The bad news is that even after building a new project with Standard C Makefile as its type, I STILL can't see the QNX 
GDB Debugger and still get the same invalid debugger type error.

AAARRRGGHHH!

Suggestions?

- Frank
Re: RE: Can't debug  

Hello Frank,

Would you kindly start a separate thread (which a reference to this one ). Because my guess is the causes of the problem
 are different then mine and it's going to make the thread hard to follow.

Kind regards,

Mario

> > Are you using Managed Projects?
> > 
> > Check the project configuration. Make sure you have QNX Binary Parser
> > enabled. Project->Properties... C/C++ Build->Settings->Binary parsers tab
> > (and disable others if you have them)
> > 
> 
> 
> I am having a similar problem.
> I get a "[Main]: Program not found" message, and I have tried to follow your 
> instructions. 
> 
> I  found a Binary Parsers tab and the QNX binary parser is the only one 
> enabled. 
> 
> What is very mysterious is that this project used to be debuggable.
> I started trying to debug a DIFFERENT application (with a new project) and got
>  this error message. I hacked on the 2 project configurations to try and see 
> what the difference between them was. During the hacking around, something 
> changed (accidentally?) and suddenly neither of the projects were debuggable.
> 
> While I continued my trial and error session to find the reason for the 
> problem, the debug button lit up (even though the error message was still 
> there). I expected that the debug session would start with no source visible, 
> but instead the debug session tried to start and then a new message box popped
>  up saying there had been a timeout when trying to activate the code coverage 
> tool (which I didn't want nor had I enabled). 
> 
> Sadly (or happily, depending on your viewpoint) now I can't replicate this 
> problem. 
> I finally arrived at this conclusion:
> 
> Under C/C++ Application in the main tab of the debug configuration, if I 
> Search the project for the executable file, the error message goes away. If I 
> browse directly to the target file system to find THE SAME DAMN FILE, the 
> error message persists and prevents debugging.
> 
> I have no problem with this state of affairs except that after I have built 
> this project over and over again to try and get to this point, I am completely
>  stumped as to how the executable made it into the project. In the other 
> versions of this project, when I selected "Search Project" the underlying 
> screen came up blank.
> 
> What is further confounding is that SOMETIMES (I don't know how) SOME versions
>  of the project allowed me to browse directly to the target file system and 
> debug just fine.
> 
> I think there are some problems with this strategy of using the target system 
> as the build platform and just debugging from Momentics, but I have no choice 
> in my case. I can't put a Momentics style project make together until after I 
> migrate the existing code (a huge body of code with a hand-crafted Makefile 
> that is not Momentics friendly).  I wish you guys had a GOOD step by step 
> tutorial that covered this type of project use. The toy projects you provide 
> showing "Hello World", and various applications of semaphores and MUTEXes are 
> interesting, but are pretty much self-evident. 
> 
> The problems that one encounters migrating large applications from Linux to 
> QNX are NOT!!
> 
> Now what was my question, again??? Oh yeah, how does one make sure the binary 
> executable ends up in the project?
> 
> Thanks - Frank


Re: RE: Can't debug  
Certainly.
Sorry to take up bandwidth here. I just figured out how to get to the appropriate forum and start a new thread.
- Frank

PS: Does this forum allow the poster to remove a post? If so, how?
Getting your code into the IDE (was Re: RE: Can't debug)  
On Jan 9, 2008 5:01 PM, Frank Rudolph <rudolph@beaconpower.com> wrote:

[ Tales of woe and frustration with the debugger & code coverage launch
snipped ]


> I think there are some problems with this strategy of using the 
target
> system as the build platform and just debugging from Momentics, but I have
> no choice in my case. I can't put a Momentics style project make together
> until after I migrate the existing code (a huge body of code with a
> hand-crafted Makefile that is not Momentics friendly).  I wish you guys had
> a GOOD step by step tutorial that covered this type of project use. The toy
> projects you provide showing "Hello World", and various applications of
> semaphores and MUTEXes are interesting, but are pretty much self-evident.
>
> The problems that one encounters migrating large applications from Linux
> to QNX are NOT!!
>
I run into developers who feel the same frustration over and over again ...
until they realize that the problem(s) are
really only _partially_ an IDE problem.

Perception #1: I need to convert my build to a "Momentics style project" to
use the IDE

Reality:  The IDE wants you to narrow down the scope of what it needs to
know about (source, binaries etc) so you need to create
a project _associated_ with your source/binaries and this project is in turn
_associated_ with a workspace.  This project doesn't have
to be in the workspace, it can be anywhere you want it to be.  Here are some
options:
* Source lives in a project which lives in the workspace.  This is the
default when you create a new project or bring source into the
IDE using Import from filesystem (which _can_ do a copy, but doesn' t have
to) or using a version control plugin

* Source lives somewhere in the filesystem and we want to overlay a project
at that location.   You can achieve this by creating a
project and changing the default location from the workspace to the location
of the source.

* Source lives somwhere in the filesystem, but we don't want to create any
metadata files in that location.  In that case, create a
project (in the workspace or elsewhere as in the previous scenario) that is
empty. Then create a folder in that project and make
the folder location 'point' to the source in the filesystem using the
>>Advanced section of the dialog.  This is like a unix symlink,
but exists only in the IDE workspace.

... but what project do I choose you ask?

 Perception #2: I need to convert my build process to match an IDE project

Reality #2:  The process of selecting a project type appears more
complicated than it is.  For _nearly_ every type of existing
code with a build process, you will want to choose the "Standard C (or C++)
Make Project" type.  Why?  Because this project type
just calls out to some external build program to build the source.  Most of
the time this is 'make', hence the name of the project,
but it could be JAM, ANT, dmake, cons or any other builder.

If you have the luxury of starting your project from scratch, then the QNX
Projects are interesting because they allow you to
build multiple processors (more generally 'variants', including OS'es) with
a single build based on the QNX recursive make
framework.  They won't 'port' well to other systems however.  Managed Make
Projects are interesting because they provide
a full IDE graphical control and configuration, familiar to those coming
from Visual Studio, and can really take advantage of
the Eclipse frameowork (ie incremental compiles, links etc) but are still
relatively immature.

... and if you are never going to run your build from the IDE (I never say
never), then the choice is even simpler: Standard Make
all the time just to identify the source as "C/C++" source and help identify
the binary types.

Perception #3: Nothing is showing up anywhere, this IDE thing is totally
_busted_!

Reality #3:  Since one of the goals of...
View Full Message
RE: Getting your code into the IDE (was Re: RE: Can't debug)  
Thomas:

First: Thanks for your reply. I have gotten going again thanks to the
intervention of Brent Waniga and Keith O'Dell, who visited me yesterday.

Your pointers are helpful, but raise a couple of questions:

>> b) The binary parser is mis-configured, so go and check it out:
Should be >> QNX ELF

How do I do this, in practice??


Next: I can't use the browse button to browse to a binary located on the
target (although I swear that worked earlier this week). So I import the
binary from the target. Now I have a bit of uncertainty about the
imported binary being up to date with the one that resides on the
target. I seem to have had spotty results there to the extent that I
have take to putting a message at the very start of my code that says:

printf("Today is 12 Jan, 2008 at 11:20 AM\n");

Now if I remember to update that message every time I build the project,
I can be certain the code I am debugging is the latest version.

What settings should I make to be certain that every change to the
target-resident binary is reflected in the Windows resident one?

Lastly:
When I change code during the debug session, the code changes on the
Windows host, but not on the target. I must manually synch before I
rebuild (on the host) and restart the debugger. This is OK, but a minor
inconvenience. How do I change this?

Thanks - Frank 

Frank Rudolph, Ph.D., P.E.
Embedded Systems Software Engineer
Beacon Power Corporation
65 Middlesex Road
Tyngsboro, MA 01879
phone: 978-661-2803
email: rudolph@beaconpower.com
Web: www.beaconpower.com



-----Original Message-----
From: Thomas Fletcher [mailto:tfletche@gmail.com] 
Sent: Thursday, January 10, 2008 7:06 PM
To: general-ide
Subject: Getting your code into the IDE (was Re: RE: Can't debug)

On Jan 9, 2008 5:01 PM, Frank Rudolph <rudolph@beaconpower.com> wrote:

[ Tales of woe and frustration with the debugger & code coverage launch
snipped ]


> I think there are some problems with this strategy of using the 
target
> system as the build platform and just debugging from Momentics, but I
have
> no choice in my case. I can't put a Momentics style project make
together
> until after I migrate the existing code (a huge body of code with a
> hand-crafted Makefile that is not Momentics friendly).  I wish you
guys had
> a GOOD step by step tutorial that covered this type of project use.
The toy
> projects you provide showing "Hello World", and various applications
of
> semaphores and MUTEXes are interesting, but are pretty much
self-evident.
>
> The problems that one encounters migrating large applications from
Linux
> to QNX are NOT!!
>
I run into developers who feel the same frustration over and over again
...
until they realize that the problem(s) are
really only _partially_ an IDE problem.

Perception #1: I need to convert my build to a "Momentics style project"
to
use the IDE

Reality:  The IDE wants you to narrow down the scope of what it needs to
know about (source, binaries etc) so you need to create
a project _associated_ with your source/binaries and this project is in
turn
_associated_ with a workspace.  This project doesn't have
to be in the workspace, it can be anywhere you want it to be.  Here are
some
options:
* Source lives in a project which lives in the workspace.  This is the
default when you create a new project or bring source into the
IDE using Import from filesystem (which _can_ do a copy, but doesn' t
have
to) or using a version control plugin

* Source lives somewhere in the filesystem and we want to overlay a
project
at that location.   You can achieve this by creating a
project and changing the default location from the workspace to the
location
of the source.

* Source lives somwhere in the filesystem, but we don't want to create
any
metadata files in that location.  In that case, create a
project (in the...
View Full Message
RE: Getting your code into the IDE (was Re: RE: Can't debug)  
>> b) The binary parser is mis-configured, so go and check it out:
Should be >> QNX ELF

>How do I do this, in practice??

It depends what project type you have created to be container for you
binaries and sources and what version of IDE you are using. For IDE 4.5 and
Managed C/C++ Project it would be right click on project ->Properties...
C/C++ Build->Settings  ->Binary parsers tab


>Next: I can't use the browse button to browse to a binary located on the
>target (although I swear that worked earlier this week). So I import the
>binary from the target. 

Binary selection in Main tab of Launch configuration does now work on
target. This is binary on HOST site for debugger to resolve symbols.
Target selection that was working is in Download tab. When you select "Use
executable on target" - it is what is executed on target.
If you compile on host it is easy to synchronize - select option download
executable on target in Downloads tab. Going other way around - upload
binary from target automatically - not possible.