Project Home
Project Home
Source Code
Source Code
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Reading the debug information: (6 Items)
   
Reading the debug information  
Hi all,

         I am really new to the QNX environment.

I want to be able to monitor all the global variables in my application
running on qnx at runtime. There would be another client application
running on another machine which would receive the values of the global
variables over UDP and display them.

I would like to know where all the information regarding a global
variable is stored (type of the variable, its address etc).

In Windows (Visual Studio) all this information is stored in a .pdb
file. Is there a similar file generated if I compile my application on
qnx?

 

Thanks,

Sushma

 

RE: Reading the debug information  
That`s not really the way to go.  First your program should not have global variable, lol!

The exchange of data should be done via messages or shared memory.

If you really want to do it the way you want to, you can include symbol/debug information in the executable and parse 
that.  That`s how gdb, the debugger, does it. You can use gdb`s source code as a reference.


> -----Original Message-----
> From: Sushma Nayak [mailto:community-noreply@qnx.com]
> Sent: March-11-09 12:16 PM
> To: general-toolchain
> Subject: Reading the debug information
> 
> Hi all,
> 
>          I am really new to the QNX environment.
> 
> I want to be able to monitor all the global variables in my application
> running on qnx at runtime. There would be another client application
> running on another machine which would receive the values of the global
> variables over UDP and display them.
> 
> I would like to know where all the information regarding a global
> variable is stored (type of the variable, its address etc).
> 
> In Windows (Visual Studio) all this information is stored in a .pdb
> file. Is there a similar file generated if I compile my application on
> qnx?
> 
> 
> 
> Thanks,
> 
> Sushma
> 
> 
> 
> 
> 
> _______________________________________________
> General
> http://community.qnx.com/sf/go/post24152
> 
Re: RE: Reading the debug information  
I cannot use a debugger as I want to be able to watch the variables change at runtime and also plot them graphically as 
it changes.
As Mario suggested, I would like to include symbol/debug information in the executable and parse that from my 
application. 
I tried using the dlsym function to find the address of a global variable, but it returned a NULL. Are there any 
libraries that I can use to read the symbol information? 
Also, if the variable I am trying to find is a class or a structure, then will I also be able to find the information 
regarding its members?
Re: Reading the debug information  
Symbol table can be printed using "nm" command.
For the rest you need debugger.

Sushma Nayak wrote:
> I cannot use a debugger as I want to be able to watch the variables change at runtime and also plot them graphically 
as it changes.
> As Mario suggested, I would like to include symbol/debug information in the executable and parse that from my 
application. 
> I tried using the dlsym function to find the address of a global variable, but it returned a NULL. Are there any 
libraries that I can use to read the symbol information? 
> Also, if the variable I am trying to find is a class or a structure, then will I also be able to find the information 
regarding its members?
> 
> 
> _______________________________________________
> General
> http://community.qnx.com/sf/go/post24340
> 
Re: Reading the debug information  
I know how to do in IDE, if you running debugger. You add all global variables in the variables view (this list is 
retrieved from binary symbol table).
When you can stop program and inspect the values. You can set watchpoint on them if you interested in when somebody 
changes them.

Sushma Nayak wrote:
> Hi all,
> 
>          I am really new to the QNX environment.
> 
> I want to be able to monitor all the global variables in my application
> running on qnx at runtime. There would be another client application
> running on another machine which would receive the values of the global
> variables over UDP and display them.
> 
> I would like to know where all the information regarding a global
> variable is stored (type of the variable, its address etc).
> 
> In Windows (Visual Studio) all this information is stored in a .pdb
> file. Is there a similar file generated if I compile my application on
> qnx?
> 
>  
> 
> Thanks,
> 
> Sushma
> 
>  
> 
> 
> 
> _______________________________________________
> General
> http://community.qnx.com/sf/go/post24152
> 
Re: Reading the debug information  
Most realistic way is using debugger. If you are interested 
in observing the values at particular point in your program, 
you set your breakpoint there and when stopped, you can 
examine your variables in the debugger. If you want to find 
where exactly is each of the variables changed, you can set 
watchpoints on those variables which will cause debugger to 
stop at instruction that modifies them.

To monitor all this from remote machine, we support remote 
debugging where on your target you run our debugging agent 
called pdebug (or if you are using IDE, qconn). Then from 
your host (for example windows) you can comfortably debug 
your application that is running on qnx machine. You can use 
debugger from command line, or using IDE.

If you are not familiar with gdb (debugger), I suggest using 
IDE.

Hope this helps,

Aleksandar


Elena Laskavaia wrote:
> I know how to do in IDE, if you running debugger. You add all global variables in the variables view (this list is 
retrieved from binary symbol table).
> When you can stop program and inspect the values. You can set watchpoint on them if you interested in when somebody 
changes them.
> 
> Sushma Nayak wrote:
>> Hi all,
>>
>>          I am really new to the QNX environment.
>>
>> I want to be able to monitor all the global variables in my application
>> running on qnx at runtime. There would be another client application
>> running on another machine which would receive the values of the global
>> variables over UDP and display them.
>>
>> I would like to know where all the information regarding a global
>> variable is stored (type of the variable, its address etc).
>>
>> In Windows (Visual Studio) all this information is stored in a .pdb
>> file. Is there a similar file generated if I compile my application on
>> qnx?
>>
>>  
>>
>> Thanks,
>>
>> Sushma
>>
>>  
>>
>>
>>
>> _______________________________________________
>> General
>> http://community.qnx.com/sf/go/post24152
>>
> 
> _______________________________________________
> General
> http://community.qnx.com/sf/go/post24156
>