LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-31-2012, 04:37 AM   #1
webquinty
Member
 
Registered: Apr 2008
Location: Espaņa
Distribution: Suse
Posts: 227

Rep: Reputation: 32
LIBDWARF How to obtain die attributes .....


Hello,

I would like to make a small version of dwarfdump to obtain the desired debug information of process.

libdwarf has a example called "simplereader" to read dwarf information but I have not enought information about how to make it.

For example:
dwarfdump give me this information......
Quote:
< 1><0x000000b9> DW_TAG_base_type
DW_AT_byte_size 0x00000004
DW_AT_encoding DW_ATE_float
DW_AT_name "float"
And simplereader example return me the follow line....
Quote:
<1> tag: 36 DW_TAG_base_type name: "float"
How can I obtain, for example byte size?

Other example...

Quote:
< 1><0x00001523> DW_TAG_variable
DW_AT_name "INDEX_TXPDO"
DW_AT_decl_file 0x0000000a
DW_AT_decl_line 0x00000011
DW_AT_type <0x00001513>
DW_AT_external yes(1)
DW_AT_location DW_OP_addr 0x08171e40
And simplereader return me.......

Quote:
<1> tag: 52 DW_TAG_variable name: "INDEX_TXPDO"
How can I obtain name, type and location??

Best regards
John Martin.
 
Old 11-02-2012, 09:47 AM   #2
webquinty
Member
 
Registered: Apr 2008
Location: Espaņa
Distribution: Suse
Posts: 227

Original Poster
Rep: Reputation: 32
Hello,

I know that the question is somewhat general and I apologize for that.

I would like to change my question for better one.
I have make some test with gdb, but i would like to use it in my process ( write a piece of code inside my own process, for example, to request a value of some vars ).

is it posible to do it?
For example in gdb, if i print "p myvar" return me a value.
Could I execute this command inside a C programm and capture value?

Best regards
John Martin.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Open source must die die die LXer Syndicated Linux News 0 01-28-2006 08:16 PM
Die Miva, Die! Apache Woes, Cannot kill Miva linchat Linux - Software 3 09-16-2005 08:03 PM
Die, lotus notes, die (sorry for ranting) slackist General 10 01-10-2005 10:42 AM
Die Caps lock Die! tfdml37 Linux - General 1 06-26-2004 02:00 AM
Name the attributes alaios General 5 10-29-2003 06:50 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration