Giter Site home page Giter Site logo

Comments (3)

daniel5151 avatar daniel5151 commented on May 5, 2024 1

Ah, yes, I've definitely encountered something like this before. My first guess would be that you're not adjusting the PC correctly after a breakpoint is hit.

Here's the relevant line in the documentation:

https://sourceware.org/gdb/current/onlinedocs/gdb/Stop-Reply-Packets.html#swbreak-stop-reason

On some architectures, such as x86, at the architecture level, when a breakpoint instruction executes the program counter points at the breakpoint address plus an offset. On such targets, the stub is responsible for adjusting the PC to point back at the breakpoint address.

Try playing around with that, and if it's still not working, could you please return debug logs from GDB and gdbstub?
Specifically, call set debug remote 1 in GDB, and run your server with the environment variable RUST_LOG=gdbstub=trace (if possible, enabling the std feature would be good, as it will also log packet responses, not just incoming packets)

from gdbstub.

daniel5151 avatar daniel5151 commented on May 5, 2024 1

No problem! Glad you sorted it out 😄

I have a feeling this is going to be a fairly common stumbling block, so I'm going to re-open + rename this issue to remind myself to update the Target::resume docs with a note regarding adjusting the PC.

from gdbstub.

jamcleod avatar jamcleod commented on May 5, 2024

Wow you're 100% right! Funny enough I went off to fix the bug about the PC not updating properly immediately after submitting this issue. Thanks!!

from gdbstub.

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.