Project Home
Project Home
Source Code
Source Code
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Reading the symbols using LIB BFD: (2 Items)
   
Reading the symbols using LIB BFD  
Hi all,

     I am new to qnx programming.

I would like to read the symbol information i.e., type, address and
value for a given symbol using the libbfd.a

If the symbol is a structure, I would like to read the information of
all its members.

I would like to know if anyone has any information or sample code on how
to achieve this.

 

Thanks,

Sushma

Re: Reading the symbols using LIB BFD  
Sushma Nayak wrote:
> Hi all,
> 
>      I am new to qnx programming.
> 
> I would like to read the symbol information i.e., type, address and
> value for a given symbol using the libbfd.a
> 
> If the symbol is a structure, I would like to read the information of
> all its members.
> 
> I would like to know if anyone has any information or sample code on how
> to achieve this.

Hello Sushma,

Have you tried BFD docs? 
http://sourceware.org/binutils/docs/bfd/index.html


There is also information about that encoded in C language 
in gdb and binutils (and probably many other) projects.

I would suggest looking at files gdb/dwarf2*.c.
http://community.qnx.com/integration/viewcvs/viewcvs.cgi/tools/gdb/trunk/gdb-6.8/gdb/?root=core-dev-tools&system=
exsy1001
(note that much of the code there will be specific to gdb 
and its internal representation of debug information which 
is intentionally made generic due to desire to read 
different debug formats).


Or, maybe it is cleaner and simpler binutils/dwarf.c 
http://community.qnx.com/integration/viewcvs/viewcvs.cgi/tools/binutils/trunk/binutils/dwarf.c?root=core-dev-tools&rev=
279&system=exsy1001&view=markup


Hope this helps,

Aleksandar