Comments (15)
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.
Does this only occur for object files? We don't currently process relocations.
from addr2line.
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.
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.
We'll want to implement this for split debuginfo support in backtrace-rs too.
from addr2line.
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.
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.
Ooohh, I see. Thanks for the pointers!
from addr2line.
I think I have everything I need then.
from addr2line.
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.
It's because of this check:
Line 478 in a8757e5
The first line row starts at address 0 in this object. This check makes us ignore all the rows.
from addr2line.
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.
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.
Deleting the 0 check looks okay and matches other tools. I'll do a PR for that once #178 is merged.
from addr2line.
Awesome, thank you!
from addr2line.
Related Issues (20)
- Bump `object` to `0.23.0`
- Doesn't seem to live up to performance claims? HOT 7
- Ability to shrink the library? HOT 4
- `Context` is not `Send` anymore HOT 10
- Add Line to Address Functionality HOT 2
- Broken link in Readme HOT 1
- Leftover Travis CI references
- osx binary HOT 3
- empty output '??:?' HOT 2
- Duplicated `comp-dir` HOT 1
- Consider switching from memmap crate dependency
- Promote the CLI example to a `bin` crate HOT 2
- No line information found in jitted-1234-56.so files generated by perf inject --jit HOT 5
- Can't resolve libc symbol - which is found by C addr2line HOT 4
- New release HOT 3
- Remove `Context::new` HOT 1
- Tests are failing with nightly rust due to packed debuginfo HOT 4
- Errors when parsing DWARF from Wasm objects HOT 20
- Broken with clang-16 debug info on Linux HOT 2
- How to locate a symbol using this crate? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from addr2line.