GithubHelp home page GithubHelp logo

Comments (15)

mstange avatar mstange commented on June 26, 2024

More importantly, atos also finds the information:

atos -o /Users/mstange/code/obj-m-opt/toolkit/xre/nsEmbedFunctions.o 0x104d 0x1051 0x1052
XRE_InitChildProcess(int, char**, XREChildData const*) (in nsEmbedFunctions.o) (nsEmbedFunctions.cpp:740)
XRE_InitChildProcess(int, char**, XREChildData const*) (in nsEmbedFunctions.o) (nsEmbedFunctions.cpp:740)
XRE_InitChildProcess(int, char**, XREChildData const*) (in nsEmbedFunctions.o) (nsEmbedFunctions.cpp:744)

from addr2line.

philipc avatar philipc commented on June 26, 2024

Does this only occur for object files? We don't currently process relocations.

from addr2line.

mstange avatar mstange commented on June 26, 2024

Ah, yes, it's likely that this only happens for object files.
If I run dsymutil (which takes 3.5 minutes) and look up the corresponding address in XUL.dSYM, addr2line does find the correct filename + line information.

How hard would it be to add support for object files?

from addr2line.

philipc avatar philipc commented on June 26, 2024

The dwarfdump example in gimli can handle them, so not hard to do in the addr2line example. I assume you want this in a library you can use too though?

from addr2line.

philipc avatar philipc commented on June 26, 2024

We'll want to implement this for split debuginfo support in backtrace-rs too.

from addr2line.

mstange avatar mstange commented on June 26, 2024

Not sure I completely understand the question, but I'd want addr2line::Context::find_frames to find this information in object files. Here's where I'm calling it.

(And I have homegrown split debuginfo code here which I'd love to replace with something from object.)

from addr2line.

philipc avatar philipc commented on June 26, 2024

find_frames will work as long as the Reader supports relocations. You're currently using EndianSlice, which can't handle relocations. dwarfdump has its own Reader implementation, so that will need to be put in a library somewhere. It relies on object though, and gimli has tried to remain independent of object.

Thanks for the split debuginfo link, I plan to add that to object soon. I'm also aware of an implementation in https://github.com/mozilla/fix-stacks

from addr2line.

mstange avatar mstange commented on June 26, 2024

Ooohh, I see. Thanks for the pointers!

from addr2line.

mstange avatar mstange commented on June 26, 2024

I think I have everything I need then.

from addr2line.

mstange avatar mstange commented on June 26, 2024

The problem doesn't seem to be related to relocations. If I comment out the call to add_relocations in the dwarfdump example, it still finds the lines.

And cargo run --release --example simple_line -- /Users/mstange/code/obj-m-opt/toolkit/xre/nsEmbedFunctions.o also works, and from what I can tell the simple_line example doesn't seem to handle relocations:

...
104a /Users/mstange/code/mozilla/toolkit/xre/nsEmbedFunctions.cpp:740:34
1052 /Users/mstange/code/mozilla/toolkit/xre/nsEmbedFunctions.cpp:744:16
...

I'm looking into it some more.

from addr2line.

mstange avatar mstange commented on June 26, 2024

It's because of this check:

if start != 0 {

The first line row starts at address 0 in this object. This check makes us ignore all the rows.

from addr2line.

philipc avatar philipc commented on June 26, 2024

Ah right. So I'm pretty sure we need that check for executables, because I think the linker leaves the address at 0 for functions that are omitted, instead of deleting the line information (and same for DIEs). So maybe we need to set a flag on Context to say whether it is an object or executable file.

from addr2line.

philipc avatar philipc commented on June 26, 2024

That check was added based on the investigation I did in #67 (comment).

This was when we were still using an interval tree, and so doing a lookup of 0 resulting in poor behaviour. It might be safe to delete the check now. I'll look into it a bit more.

from addr2line.

philipc avatar philipc commented on June 26, 2024

Deleting the 0 check looks okay and matches other tools. I'll do a PR for that once #178 is merged.

from addr2line.

mstange avatar mstange commented on June 26, 2024

Awesome, thank you!

from addr2line.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.