-
Notifications
You must be signed in to change notification settings - Fork 116
-
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
How to use this extension with coredumps [missing in README]? #360
Comments
For the last question with that issue see #121, which gave the better workaround of modifying the debugger arguments to prevent running the executable: {
"version": "0.2.0",
"configurations": [
{
"type": "gdb",
"request": "launch",
"name": "load core",
"target": "a.out",
"cwd": "${workspaceRoot}",
"debugger_args": [
"${workspaceRoot}/a.out", "${workspaceRoot}/core"
]
}
]
} |
As noted in #385 this seems to have been possible years ago, but it isn't any more, because Current work-around attach to a dummy process (it must exist and you must have debugging rights - most easy by {
"version": "0.2.0",
"configurations": [
{
"type": "gdb",
"request": "attach",
"name": "load core",
"target": "123456",
"cwd": "${workspaceRoot}",
"autorun": [
"detach",
"file ${workspaceRoot}/a.out",
"target core ${workspaceRoot}/core"
],
"stopAtConnect": true,
}
]
} And if you use the It would be much better to directly support coredumps, for example by checking the @brownts That sounds like a reasonable plan for the next release, no? As an alternative we could do the same as the cpptools extension and add a |
You can also do this by utilizing the "extended-remote" option as well. Have a {
"type": "gdb",
"request": "attach",
"name": "GDB: Attach Extended Remote (Core File)",
"executable": "hello_world",
"target": "extended-remote :2345",
"stopAtConnect": true,
"cwd": "${workspaceFolder}",
"preLaunchTask": "gdbserver:multi-once",
"autorun": ["file hello_world", "target core core.3359659"]
} It's still a "hack" on what should be available as straight forward attach. Yes, this does seem reasonable for the next feature release. This is what I had hinted about in #330. |
How is your prelaunch task defined? The following does not work: "label": "gdbserver:multi-once",
"windows": {
"command": "C:\\MinGW\\bin\\gdb-multiarch.exe",
},
"linux": {
"command": "gdbserver",
},
"args": [
"--once",
"--multi", ":2345",
],
"isBackground": true,
"group": "none",
"problemMatcher": [],
"presentation": {
"echo": false,
"reveal": "never",
"focus": false,
"panel": "shared",
"showReuseMessage": false,
"clear": false
} |
This is what I'm successfully using on Linux. Which platform are you running this on? Also, is your Windows command running {
"label": "gdbserver:multi-once",
"type": "process",
"command": "gdbserver",
"args": ["--once", "--multi", ":2345"],
"isBackground": true,
"problemMatcher": {
"pattern": {
"regexp": ".",
"file": 1,
"location": 2,
"message": 3
},
"background": {
"activeOnStart": true,
"beginsPattern": ".",
"endsPattern": "."
}
},
"group": "test"
} |
I see, that's microsoft/vscode#6209, one needs an explicit problem matcher, that's... special. Note: I don't see any interaction to show local variables - should there be some? Did I somewhere possibly dropped that with a setting? [note: hovering over variables leads to the |
Yeah, getting the matcher correct is a pain, but I remember running across that in the past and had this in my back pocket from some previous launcher I had cobbled together. Not sure why it's not working for you. With that setup, at least on Linux, I'm not having any problem launching gdbserver.
Not quite sure exactly what you're seeing, but I do see many local variables shown. I do see that some seem to have problems (which should be investigated), but others are displayed fine. Here are a couple snapshots from my hello_world example. I just ran this and when it's in the sleep loop, I ran "gcore" on it to generate a core file. Then loaded it as previously described. |
One question about the local issue you are seeing, I was wondering if you're running with the latest. There was a local variable issue I fixed in #342. If you don't have that fix, then depending on which stack frame you're looking at, you might not see local variables. That wouldn't be specific to the core file, but to the extension in general. |
I'm using the last release, as most people :-) 0.26.0 - that fix is not included there. |
So far I've only started the application, then used the debugging console or
autorun
to load a core file.But there is likely a better way, isn't there?
Thinking about that it would be likely useful to have an extra launch type for that which has no pause/run/step active (if this is actually possible with the dap).
Additional:
On systems with installed
systemd-coredump
all created coredumps are taken into its db and the last one can always be inspected with gdb usingcoredumpclt debug
(you can filter for example with pid or executable name, too).It would be really nice to start this instead of GDB - but I have no clue if this would work, I guess via its
--debuger
(default is gdb - we'd just set the gdbpath there) and via--debugger-arguments=
(to pass the collected startup commands).That would be useful both locally and for ssh-remote. Maybe a new type "core" with an optional boolean argument
coredumpclt
?The text was updated successfully, but these errors were encountered: