-
Notifications
You must be signed in to change notification settings - Fork 116
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
gdb attach: make auto-continue configurable: introduce "haltOnAttach" #244
Comments
This would be really useful to me! |
I really need this feature as well. Currently I can't debug some very low level startup code running on an embedded target because of this. The auto-continue feature refuses to let me halt at breakpoints or break on attach. |
Yes, please add the
That's strange, it should halt at breakpoints, but obviously this can only work if you attach before this code was executed. It sounds like you want either gdbserver to start the executable (launch gdbserver separately on the target, then attach via this extension and in the Unrelated side note: I suggest Windows users to use gdb-multiarch.exe found in MSYS2, which should theoretically be able to attach and debug any remote (I'm using that to debug GNU/Linux from a Windows Client, others use that for debugging on ARM)... and additionally enjoy a recent GDB (10.x currently), too. |
@GitMensch: Thanks for looking into it and your proposal. But IMHO "stopOnEntry" would be misleading for the attach use case. I am not very familiar with gdbserver, but you could think of the gdbserver running in an OpenOCD HW debugger which attaches a running HW board as well. It would stop execution at the point where the HW board is running at, not at the "Entry". In my use case I do not want to start it (I think that's anyway not intended when "attaching") but attach to a running debug session. I had QEMU, i.e. the gdbserver configured not to continue on startup ("-S") and I wanted to attach right in that stage. I added "haltOnAttach" to the title in order to hopefully clarify the enhancement request a little. |
This is an enhancement request.
In my use-case I am working in Windows, run aarch64 bare-metal software in QEMU started with options "-s -S" -> gdb server, halted at start. I want to source-level debug the remote code using VS code.
When attaching with VS code using Native Debug (and an external aarch64-gdb, remote=true) the code continues immediately after attaching. This is not what I wanted in this case. I wanted that VS code shows me the code location at attach time and does not continue execution automatically.
I found the presumed reason in out/src/gdb.js, GDBDebugSession::attachRequest()
this.needContinue = true;
When changing this line to
this.needContinue = false;
I get exactly the behaviour I want in this special use-case.
Enhancement request: It would be awesome if there would be a launch.js configuration option "haltOnAttach" or something similar I could use for changing the default behaviour (auto-continue) to "halt".
Great piece of software - thanks!
Jörg
The text was updated successfully, but these errors were encountered: