[llvm-dev] Get the function boundaries

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[llvm-dev] Get the function boundaries

Bruce Hoult via llvm-dev
Hi

I compiled the binary with option -gdwarf-3. Then I use the llvm-dwarfdump with option -debug-info to help me to dump the dwarf debugging information. The DW_AT_subprogram could tell me the function boundaries of the target function.

However, I found the dwarf info may miss a lot of functions. I query the symbol table and it returns about 600 functions. However, the dwarf info only provide me about 100 functions. A large part of the code is not listed inside the dwarf info. Is this a normal behavior? I compiled the binary without -static option.

Besides, I would like to get the function boundary and the signatures. However, symbol table would just give me the start address. How can I know the end address and the function signature? Many Thanks

Regards
Muhui


_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] Get the function boundaries

Bruce Hoult via llvm-dev

Hi Muhui,

 

It sounds like you are examining the final executable file.  Even without –static it is possible that some libraries are available only statically, and those functions probably will not have debug information.  If that is the case, then yes what you are seeing is normal behavior.

 

If you examine the individual .o files that you compiled, and find functions missing from the debug information, that would be less expected.  There are only a couple of reasons to omit a function from the debug information.  One is if the source has the "nodebug" attribute, then we will not emit it.  I think also in some cases we might not emit debug information for artificial functions, such as compiler-generated constructors, or functions to perform static initialization prior to running main().  The latter two cases would apply only to C++; if you are compiling C code, you don't need to worry about those.

 

Hope this helps,

--paulr

 

From: llvm-dev [mailto:[hidden email]] On Behalf Of Muhui Jiang via llvm-dev
Sent: Thursday, July 05, 2018 10:24 AM
To: llvm-dev
Subject: [llvm-dev] Get the function boundaries

 

Hi

 

I compiled the binary with option -gdwarf-3. Then I use the llvm-dwarfdump with option -debug-info to help me to dump the dwarf debugging information. The DW_AT_subprogram could tell me the function boundaries of the target function.

 

However, I found the dwarf info may miss a lot of functions. I query the symbol table and it returns about 600 functions. However, the dwarf info only provide me about 100 functions. A large part of the code is not listed inside the dwarf info. Is this a normal behavior? I compiled the binary without -static option.

 

Besides, I would like to get the function boundary and the signatures. However, symbol table would just give me the start address. How can I know the end address and the function signature? Many Thanks

 

Regards

Muhui

 


_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev