Giter Club home page Giter Club logo

Comments (2)

gregg-miskelly avatar gregg-miskelly commented on June 14, 2024

Is your question how do obtain disassembly around the current instruction?
Or how do you decide that a disassembly that you previously requested is still valid?

For the former, assuming you would like to put the instruction in the center of your text buffer of height lines, what should work is:

  • Take the StackFrame.instructionPointerReference to see where you are
  • Issue a disassemble request with
    • memoryReference = instructionPointerReference
    • instructionOffset = -height/2 (or more if you want to be able to page back without requesting more instructions)
    • instructionCount = height (or more if you want)
    • resolveSymbols = true (or false, up to you)

If the later, you could either:

  • Just always update, to make sure that self-modifying code is handled. You could do something so that if the instructions you get back are the same and scrolling is unnecessary, you just move the current instruction indicator.
    -or-
  • Issue a readMemory request with count=0, and check if the address is within the range of disassembly that you have.

from debug-adapter-protocol.

puremourning avatar puremourning commented on June 14, 2024

Ok thanks. I was really just trying to work out which instruction was current.

But I think you answered with the fist part, combined with this :

An adapter must return exactly this number of instructions - any

  • unavailable instructions should be replaced with an implementation-defined
  • 'invalid instruction' value.

Point being, if I ask for 100 instructions with an offset of -50 then the 51st instruction is the one matching the memory reference.

Seems obvious now, thanks.

from debug-adapter-protocol.

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.