[LLVMdev] debug information for functions

Vasudev.Negi at microchip.com Vasudev.Negi at microchip.com
Mon Jun 8 03:25:27 PDT 2009


Suppose I have fun.h as:

 

static  void fun() {

  int a =10;

}

 

Now I have two files foo.c and goo.c as 

foo.c :

#include "fun.h"

void foo() 

{

  fun();

}

 

goo.c:

#include "fun.h"

void goo()

{

  fun();

}

 

I get .bc files for foo.c and foo.bc through clang. Now I run llvm-ld
with -disable-opt for foo.bc and goo.bc. In the resulting .bc files, one
of the two functions fun, is renamed to fun<number>. There are two
llvm.dbg.subprogram descriptors created for the two fun functions. Both
have name foo . So there is no way to know which descriptor represents
which function. I am trying to get this information in assembly printer.

 


Proposed solution :  llvm.dbg.subprogram.type should have a reference to
function is represents. This is in the same way as
llvm.dbg.global_variable.type has a reference to global variable it
represents.

 

Thanks

Vasudev

-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 5980 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090608/ac253293/attachment.bin>


More information about the llvm-dev mailing list