Git Product home page Git Product logo

Comments (3)

calixteman avatar calixteman commented on July 30, 2024

After thinking about that: if my reasoning is correct, then it means we should keep a sorted Vec of (PdbInternalSectionOffset, DebugSubsection) (sorted on offset) and then make a binary search to get the correct DS.
It should fix in the mean time the complexity of lines_at_offset (which is currently linear) which should become log (I'd have prefer constant but doesn't seem possible).

from pdb.

jan-auer avatar jan-auer commented on July 30, 2024

We can probably merge this with the fix for #61. The fix would be pretty much what you proposed, except I would propose a BTreeMap<Offset, DS>.

However, in PDBs there is always a separate subsection per function. So if you search for the function's start offset, you should always have an exact hit. What is the offset that you're feeding into lines_at_offset? This obviously includes the function epilogue, which might account for the difference of 0x10.

from pdb.

calixteman avatar calixteman commented on July 30, 2024

I used lines_at_offset with proc_symbol.offset (ie: {s: 0x1, o: 0x8990}).
I printed DebugLinesSubsections for this line_program (this is the only one):
DebugLinesSubsection { header: DebugLinesHeader { offset: PdbInternalSectionOffset { section: 0x1, offset: 0x8980 }, flags: 0, code_size: 49 }, data: [0, 0, 0, 0, 9, 0, 0, 0, 84, 0, 0, 0, 16, 0, 0, 0, 45, 0, 0, 128, 16, 0, 0, 0, 47, 0, 0, 128, 23, 0, 0, 0, 48, 0, 0, 128, 26, 0, 0, 0, 49, 0, 0, 128, 30, 0, 0, 0, 50, 0, 0, 128, 35, 0, 0, 0, 51, 0, 0, 128, 38, 0, 0, 0, 52, 0, 0, 128, 40, 0, 0, 0, 62, 0, 0, 128, 44, 0, 0, 0, 66, 0, 0, 128] }

So it seems that it's "almost always" or maybe I'm doing something wrong.

from pdb.

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.