Comments (1)
There are a couple of problems with the current LineInformation implementation.
The first one that you suspected is the issue of address ranges with the same starting and ending value (an empty range if it is half closed). The records produced by the DWARF state machine used to encode the line map table are defined such that the address for a line is inclusive as are any addresses up to but not including the address of the next line in the map (if the address is larger). This is easily fixed by changing ranges [x, x) to [x, x+1) as this matches DWARF semantics.
The second problem is that the implementation assumes non-overlapping ranges. If ranges overlap then the results of an address query to a statement will in most cases will be incorrect. When I create a pathological line maps containing all different types of overlaps and query addresses between and at all boundaries the results are correct for the lowest address and then everything else is incorrect with statements missing that should have been included as their range contains the address, and statements included that should not have been as their range does not contain the address, or both.
I see two ways to fix this.
- use an index sorted by the address range pair (this is what is currently done, along with another index sorted on the high address which can go away). To query would entail starting at the lowest pair, stopping when the low address of the pair is greater than the address. The time to create this data and the memory used would be less than the current implementation, but the query time becomes O(#line map entries for the module).
- switch to a real interval data structure, which is more complicated to create in terms of time and memory as you now have a data structure where each interval is a vector of line map entries. The intervals cover distinct ranges and must be split is new entries overlap and do not have the exact same range. On the plus side has performance of address queries is O(log #intervals).
The trade off is then how many queries are going to be performed vs the extra expense in memory and CPU to create the interval data structure instead of the simpler map. If the number of line map intervals is large and the number of bytes in a module is large, and the number of queries is large, then options 2 would be called for, otherwise it may be best to stick with option 1.
@mplegendre do you feel your use case would benefit by option 2?
from dyninst.
Related Issues (20)
- BPatch_funcCallExpr does not conform to ARMv8 ABI HOT 14
- aarch64 stackwalking needs work. HOT 1
- Segmentation fault on libc-2.27.so:i386
- Make Parser::getSyscallNumber architecture-agnostic and handle multiple syscall arguments
- Issues with Static Instruction Insertion using Dyninst HOT 4
- Difficulty Inserting Instructions Using Dyninst Toolkit: Seeking Unified Solution HOT 1
- GitHub Release for 13.0.0 HOT 3
- release cmake configury: unable to install under /usr/lib64/... HOT 7
- AMD GPU Instruction Decoder Failed to expand operand HOT 1
- Upgrading SelectiveTaint: Replacing dyninst9.3 with dyninst13.0 in Ubuntu 14.04 Environment HOT 13
- (Unintentional) dependency in C++ static constructor order; causes SIGFPE when source files are reordered HOT 1
- How to instrument a non-x86_64 binary with dyninst library built upon x86_64 ? HOT 2
- Substantial increase in build times with gcc-14. HOT 1
- Build failures with gcc-14 HOT 1
- strange runtime error: odd - couldn't find kept register 2 HOT 1
- Instruction Operation missing x86 FLAG read/write properties
- Just upgrde gcc version to 8.5.0, also do those soft link trick,but found issue"Dyninst requires gcc >= 6.0" HOT 1
- Segmentation fault when -O2 used to compile application. HOT 4
- Incorrect jump table detection HOT 2
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 dyninst.