Thread overview
Saturday night stack tracing
Jan 13, 2008
Robert Fraser
Jan 13, 2008
Jascha Wetzel
Jan 15, 2008
Robert Fraser
Jan 13, 2008
Frank Benoit
Jan 13, 2008
Frank Benoit
Jan 13, 2008
John Reimer
Jan 15, 2008
Robert Fraser
January 13, 2008
Hi --

I've been using Flectioned for stack tracing, which has been doing some wonderful things to me. However, the stack trace, though nice, doesn't show the file/line where each function is defined. This isn't a MAJOR problem for me, since I can report the function overload & search for the function based on that, however in the interests of time it might be nice to get the exact line the function was called on.

Is there any way to do this, perhaps by using the debug info & comparing the call address against that somehow? I'm not too up on these things, but it seems like it would be possible.

Thanks!
January 13, 2008
Robert Fraser wrote:
> Hi --
> 
> I've been using Flectioned for stack tracing, which has been doing some wonderful things to me. However, the stack trace, though nice, doesn't show the file/line where each function is defined. This isn't a MAJOR problem for me, since I can report the function overload & search for the function based on that, however in the interests of time it might be nice to get the exact line the function was called on.
> 
> Is there any way to do this, perhaps by using the debug info & comparing the call address against that somehow? I'm not too up on these things, but it seems like it would be possible.
> 
> Thanks!

you'll need to parse the debug info that contains lists of address-range to line number mappings. if you're interested in doing this, i can give you the ddbg source to check out how it's done for codeview debug info. for dwarf there is libdwarf, which appears to be pretty good. i'd recommend looking at that before implementing a dwarf parser from scratch.
January 13, 2008
Robert Fraser schrieb:
> Hi --
> 
> I've been using Flectioned for stack tracing, which has been doing some wonderful things to me. However, the stack trace, though nice, doesn't show the file/line where each function is defined. This isn't a MAJOR problem for me, since I can report the function overload & search for the function based on that, however in the interests of time it might be nice to get the exact line the function was called on.
> 
> Is there any way to do this, perhaps by using the debug info & comparing the call address against that somehow? I'm not too up on these things, but it seems like it would be possible.
> 
> Thanks!

on linux I use addr2line

addr2line -e myprog 0x12345678

January 13, 2008
Frank Benoit schrieb:
> Robert Fraser schrieb:
>> Hi --
>>
>> I've been using Flectioned for stack tracing, which has been doing some wonderful things to me. However, the stack trace, though nice, doesn't show the file/line where each function is defined. This isn't a MAJOR problem for me, since I can report the function overload & search for the function based on that, however in the interests of time it might be nice to get the exact line the function was called on.
>>
>> Is there any way to do this, perhaps by using the debug info & comparing the call address against that somehow? I'm not too up on these things, but it seems like it would be possible.
>>
>> Thanks!
> 
> on linux I use addr2line
> 
> addr2line -e myprog 0x12345678
> 

Actually i use the jive stacktrace which contains all available line numbers. See http://zygfryd.net/hg
January 13, 2008
Robert Fraser wrote:

> Hi --
> 
> I've been using Flectioned for stack tracing, which has been doing some wonderful things to me. However, the stack trace, though nice, doesn't show the file/line where each function is defined. This isn't a MAJOR problem for me, since I can report the function overload & search for the function based on that, however in the interests of time it might be nice to get the exact line the function was called on.
> 
> Is there any way to do this, perhaps by using the debug info & comparing the call address against that somehow? I'm not too up on these things, but it seems like it would be possible.
> 


Have you tried zerobugs yet?
January 15, 2008
John Reimer wrote:
> Robert Fraser wrote:
> 
>> Hi --
>>
>> I've been using Flectioned for stack tracing, which has been doing some
>> wonderful things to me. However, the stack trace, though nice, doesn't
>> show the file/line where each function is defined. This isn't a MAJOR
>> problem for me, since I can report the function overload & search for
>> the function based on that, however in the interests of time it might be
>> nice to get the exact line the function was called on.
>>
>> Is there any way to do this, perhaps by using the debug info & comparing
>> the call address against that somehow? I'm not too up on these things,
>> but it seems like it would be possible.
>>
> 
> 
> Have you tried zerobugs yet?

I'm trying to integrate the line no. info into Flectioned, not get a stack trace for any one exception.
January 15, 2008
Jascha Wetzel wrote:
> Robert Fraser wrote:
>> Hi --
>>
>> I've been using Flectioned for stack tracing, which has been doing some wonderful things to me. However, the stack trace, though nice, doesn't show the file/line where each function is defined. This isn't a MAJOR problem for me, since I can report the function overload & search for the function based on that, however in the interests of time it might be nice to get the exact line the function was called on.
>>
>> Is there any way to do this, perhaps by using the debug info & comparing the call address against that somehow? I'm not too up on these things, but it seems like it would be possible.
>>
>> Thanks!
> 
> you'll need to parse the debug info that contains lists of address-range to line number mappings. if you're interested in doing this, i can give you the ddbg source to check out how it's done for codeview debug info. for dwarf there is libdwarf, which appears to be pretty good. i'd recommend looking at that before implementing a dwarf parser from scratch.

Thanks! Could you send me the source just related to the line no. stuff?