-
Notifications
You must be signed in to change notification settings - Fork 58
Line number #97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Line number #97
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #97 +/- ##
==========================================
- Coverage 51.11% 51.06% -0.05%
==========================================
Files 15 15
Lines 2160 2166 +6
Branches 824 830 +6
==========================================
+ Hits 1104 1106 +2
- Misses 809 811 +2
- Partials 247 249 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Thanks for the explanations. I spent some time today trying to understand the issue. I got a rough picture of what A few preliminary thoughts:
|
|
I will try to create a test case. I also thought about it, but didn't know how to force the compiler to create the file that I wanted. BTW the github mirror of elftoolchain has not been updated in years. The original repo is https://sourceforge.net/projects/elftoolchain/, but there I tested 3 other implementations
|
|
I took a look at dwarfstack and I liked it. dwarfstack uses almost the same code that I wrote for drmingw, but it's better. At least now after I fixed a couple of bugs in dwarfstack. I benchmarked it and found a performance problem that I fixed in dwarfstack v2.3. If I had known about dwarfstack I would not have written my code. I have created a branch https://github.com/oltolm/drmingw/tree/dwarfstack where I have replaced the code in mgwhelp with code that uses dwarfstack. All tests pass. I had to fork dwarfstack because the interface didn't fit mgwhelp, but there are almost no functional changes to dwarfstack. I could open a PR and close this one. |
I think I have fixed it properly this time, but I will leave it as draft for a while.
I will explain what the problem was. It has something to do with sequences, but the previous fix was wrong.
I am executing
it prints this (I added debug logging)
which is wrong.
If we look at
objdump -WLoutput we see thisIt compares two addresses from difference sequences.
It should have found this instead
The solution is to reset the search each time we encounter the end of sequence
DW_LNE_end_sequence. This is what libdwarf has to sayIf we find a
DW_LNE_end_sequencewe ignore the file and line information and reset the state of the loop so that in never compares addresses from different sequence or line-tables as libdwarf calls it.