microsoft / microsoft/vscode-cpptools
Troubleshooting set history save on in GDB History Logging in Visual Studio Code
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 1.7k
- Avg merge
- 14h 46m
- Merged PRs (30d)
- 61
Description
Environment
- OS and version: Ubuntu 18.04
- VS Code: v1.85.1
- C/C++ extension: v1.18.5
- OS and version of remote machine (if applicable):
- GDB / LLDB version: 10.2
Bug Summary and Steps to Reproduce
I am trying to capture the commands executed in GDB (GNU Debugger) while debugging a program in Visual Studio Code (VS Code). The logging feature in GDB can be used for this purpose, but it tends to produce a lot of unnecessary information along with the commands, which makes it less ideal for my needs.
I have also tried using set history save on in GDB to save the command history to a file, but I encountered issues with this approach in VS Code. Despite enabling history saving, the commands executed in GDB were not properly recorded in the history file.
I am looking for a simpler and more effective way to dump the instructions (commands) passed to GDB during debugging in VS Code. The goal is to have a clean and concise log of the commands without the excess information produced by the logging feature. If there is a straightforward method or alternative approach to achieve this in VS Code, I would greatly appreciate any suggestions or solutions.
Debugger Configurations
`layout.json`
{
"version": "0.2.0",
"configurations": [
{
"name": "C++ Launch",
"type": "cppdbg",
"request": "launch",
"cwd": "${workspaceFolder}",
"program": "${workspaceFolder}/example",
"MIMode": "gdb",
"logging": { "engineLogging": true, "trace": true, "traceResponse": true },
"setupCommands": [
{
"description": "history file save",
"text": "set history filename debug_history.txt"
},
{
"description": "History saving",
"text": "set history save on",
"ignoreFailures": true
}
]
}
]
}
tasks.json
{
"tasks": [
{
"type": "cppbuild",
"label": "C/C++: gcc build active file",
"command": "/usr/bin/gcc",
"args": [
"-fdiagnostics-color=always",
"-g",
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}",
"-lpthread"
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "Task generated by Debugger."
}
],
"version": "2.0.0"
}
### Debugger Logs
```shell
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (62) LaunchOptions{\"name\":\"C++ Launch\",\"type\":\"cppdbg\",\"request\":\"launch\",\"cwd\":\"/home/pankaj/git/parallel-bug-injection/code/demoTso\",\"program\":\"/home/pankaj/git/parallel-bug-injection/code/demoTso/example\",\"MIMode\":\"gdb\",\"logging\":{\"engineLogging\":true,\"trace\":true,\"traceResponse\":true},\"setupCommands\":[{\"description\":\"history file save\",\"text\":\"set history filename debug_history.txt\"},{\"description\":\"History saving\",\"text\":\"set history save on\",\"ignoreFailures\":true}],\"__configurationTarget\":6,\"__sessionId\":\"9bc13825-2d75-497e-8ce9-3cdbea44e57d\"}\n"},"seq":2}
1: (62) LaunchOptions{"name":"C++ Launch","type":"cppdbg","request":"launch","cwd":"/home/pankaj/git/parallel-bug-injection/code/demoTso","program":"/home/pankaj/git/parallel-bug-injection/code/demoTso/example","MIMode":"gdb","logging":{"engineLogging":true,"trace":true,"traceResponse":true},"setupCommands":[{"description":"history file save","text":"set history filename debug_history.txt"},{"description":"History saving","text":"set history save on","ignoreFailures":true}],"__configurationTarget":6,"__sessionId":"9bc13825-2d75-497e-8ce9-3cdbea44e57d"}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (106) DbgCmd:echo $$ > /tmp/Microsoft-MIEngine-Pid-fvufef5n.suw ; cd \"/home/pankaj/git/parallel-bug-injection/code/demoTso\" ; DbgTerm=`tty` ; set -o monitor ; trap 'rm \"/tmp/Microsoft-MIEngine-In-p4ayoepr.mk0\" \"/tmp/Microsoft-MIEngine-Out-gxtkpe0l.ouu\" \"/tmp/Microsoft-MIEngine-Pid-fvufef5n.suw\" \"/tmp/Microsoft-MIEngine-Cmd-cwb5lvte.o23\"' EXIT ; \"/usr/bin/gdb\" --interpreter=mi --tty=$DbgTerm < \"/tmp/Microsoft-MIEngine-In-p4ayoepr.mk0\" > \"/tmp/Microsoft-MIEngine-Out-gxtkpe0l.ouu\" & clear; pid=$! ; echo $pid > \"/tmp/Microsoft-MIEngine-Pid-fvufef5n.suw\" ; wait $pid; \n"},"seq":4}
1: (106) DbgCmd:echo $$ > /tmp/Microsoft-MIEngine-Pid-fvufef5n.suw ; cd "/home/pankaj/git/parallel-bug-injection/code/demoTso" ; DbgTerm=`tty` ; set -o monitor ; trap 'rm "/tmp/Microsoft-MIEngine-In-p4ayoepr.mk0" "/tmp/Microsoft-MIEngine-Out-gxtkpe0l.ouu" "/tmp/Microsoft-MIEngine-Pid-fvufef5n.suw" "/tmp/Microsoft-MIEngine-Cmd-cwb5lvte.o23"' EXIT ; "/usr/bin/gdb" --interpreter=mi --tty=$DbgTerm < "/tmp/Microsoft-MIEngine-In-p4ayoepr.mk0" > "/tmp/Microsoft-MIEngine-Out-gxtkpe0l.ouu" & clear; pid=$! ; echo $pid > "/tmp/Microsoft-MIEngine-Pid-fvufef5n.suw" ; wait $pid;
--> C (runInTerminal-6): {"type":"request","command":"runInTerminal","arguments":{"kind":"integrated","title":"cppdbg: example","cwd":"","args":["/bin/sh","/tmp/Microsoft-MIEngine-Cmd-cwb5lvte.o23"],"env":{}},"seq":6}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (117) Wait for connection completion.\n"},"seq":8}
1: (117) Wait for connection completion.
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (193) ->=thread-group-added,id=\"i1\"\n"},"seq":10}
1: (193) ->=thread-group-added,id="i1"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (194) ->~\"GNU gdb (Ubuntu 10.2-0ubuntu1~18.04~2) 10.2\\n\"\n"},"seq":12}
1: (194) ->~"GNU gdb (Ubuntu 10.2-0ubuntu1~18.04~2) 10.2\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (195) ->~\"Copyright (C) 2021 Free Software Foundation, Inc.\\n\"\n"},"seq":14}
1: (195) ->~"Copyright (C) 2021 Free Software Foundation, Inc.\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (195) ->~\"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\\nThis is free software: you are free to change and redistribute it.\\nThere is NO WARRANTY, to the extent permitted by law.\"\n"},"seq":16}
1: (195) ->~"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law."
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (195) ->~\"\\nType \\\"show copying\\\" and \\\"show warranty\\\" for details.\\n\"\n"},"seq":18}
1: (195) ->~"\nType \"show copying\" and \"show warranty\" for details.\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (195) ->~\"This GDB was configured as \\\"x86_64-linux-gnu\\\".\\n\"\n"},"seq":20}
1: (195) ->~"This GDB was configured as \"x86_64-linux-gnu\".\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (195) ->~\"Type \\\"show configuration\\\" for configuration details.\\n\"\n"},"seq":22}
1: (195) ->~"Type \"show configuration\" for configuration details.\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (195) ->~\"For bug reporting instructions, please see:\\n\"\n"},"seq":24}
1: (195) ->~"For bug reporting instructions, please see:\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (195) ->~\"<https://www.gnu.org/software/gdb/bugs/>.\\n\"\n"},"seq":26}
1: (195) ->~"<https://www.gnu.org/software/gdb/bugs/>.\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (195) ->~\"Find the GDB manual and other documentation resources online at:\\n <http://www.gnu.org/software/gdb/documentation/>.\"\n"},"seq":28}
1: (195) ->~"Find the GDB manual and other documentation resources online at:\n <http://www.gnu.org/software/gdb/documentation/>."
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (196) ->~\"\\n\\n\"\n"},"seq":30}
1: (196) ->~"\n\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (196) ->~\"For help, type \\\"help\\\".\\n\"\n"},"seq":32}
1: (196) ->~"For help, type \"help\".\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (196) ->~\"Type \\\"apropos word\\\" to search for commands related to \\\"word\\\".\\n\"\n"},"seq":34}
1: (196) ->~"Type \"apropos word\" to search for commands related to \"word\".\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (196) ->=cmd-param-changed,param=\"history save\",value=\"on\"\n"},"seq":36}
1: (196) ->=cmd-param-changed,param="history save",value="on"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (196) ->(gdb)\n"},"seq":38}
1: (196) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (200) <-1001-gdb-set mi-async on\n"},"seq":40}
1: (200) <-1001-gdb-set mi-async on
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (201) ->1001^done\n"},"seq":42}
1: (201) ->1001^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (201) ->(gdb)\n"},"seq":44}
1: (201) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (203) 1001: elapsed time 3\n"},"seq":46}
1: (203) 1001: elapsed time 3
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (215) <-1002-interpreter-exec console \"set history filename debug_history.txt\"\n"},"seq":48}
1: (215) <-1002-interpreter-exec console "set history filename debug_history.txt"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (215) ->=cmd-param-changed,param=\"history filename\",value=\"/home/pankaj/git/parallel-bug-injection/code/demoTso/debug_history.txt\"\n"},"seq":50}
1: (215) ->=cmd-param-changed,param="history filename",value="/home/pankaj/git/parallel-bug-injection/code/demoTso/debug_history.txt"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (215) ->1002^done\n"},"seq":52}
1: (215) ->1002^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (215) ->(gdb)\n"},"seq":54}
1: (215) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (215) 1002: elapsed time 0\n"},"seq":56}
1: (215) 1002: elapsed time 0
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (216) <-1003-interpreter-exec console \"set history save on\"\n"},"seq":58}
1: (216) <-1003-interpreter-exec console "set history save on"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (216) ->1003^done\n"},"seq":60}
1: (216) ->1003^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (216) ->(gdb)\n"},"seq":62}
1: (216) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (216) 1003: elapsed time 0\n"},"seq":64}
1: (216) 1003: elapsed time 0
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (216) <-1004-interpreter-exec console \"set pagination off\"\n"},"seq":66}
1: (216) <-1004-interpreter-exec console "set pagination off"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (217) ->=cmd-param-changed,param=\"pagination\",value=\"off\"\n"},"seq":68}
1: (217) ->=cmd-param-changed,param="pagination",value="off"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (217) ->1004^done\n"},"seq":70}
1: (217) ->1004^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (217) ->(gdb)\n"},"seq":72}
1: (217) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (217) 1004: elapsed time 0\n"},"seq":74}
1: (217) 1004: elapsed time 0
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (217) <-1005-gdb-set auto-solib-add on\n"},"seq":76}
1: (217) <-1005-gdb-set auto-solib-add on
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (217) ->1005^done\n"},"seq":78}
1: (217) ->1005^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (217) ->(gdb)\n"},"seq":80}
1: (217) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (217) 1005: elapsed time 0\n"},"seq":82}
1: (217) 1005: elapsed time 0
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (217) <-1006-gdb-set solib-search-path /home/pankaj/git/parallel-bug-injection/code/demoTso:\n"},"seq":84}
1: (217) <-1006-gdb-set solib-search-path /home/pankaj/git/parallel-bug-injection/code/demoTso:
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (217) ->1006^done\n"},"seq":86}
1: (217) ->1006^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (218) ->(gdb)\n"},"seq":88}
1: (218) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (218) 1006: elapsed time 0\n"},"seq":90}
1: (218) 1006: elapsed time 0
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (218) <-1007-gdb-set stop-on-solib-events 1\n"},"seq":92}
1: (218) <-1007-gdb-set stop-on-solib-events 1
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (218) ->1007^done\n"},"seq":94}
1: (218) ->1007^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (218) ->(gdb)\n"},"seq":96}
1: (218) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (218) 1007: elapsed time 0\n"},"seq":98}
1: (218) 1007: elapsed time 0
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (218) <-1008-environment-cd /home/pankaj/git/parallel-bug-injection/code/demoTso\n"},"seq":100}
1: (218) <-1008-environment-cd /home/pankaj/git/parallel-bug-injection/code/demoTso
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (218) ->1008^done\n"},"seq":102}
1: (218) ->1008^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (218) ->(gdb)\n"},"seq":104}
1: (218) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (218) 1008: elapsed time 0\n"},"seq":106}
1: (218) 1008: elapsed time 0
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (218) <-1009-file-exec-and-symbols /home/pankaj/git/parallel-bug-injection/code/demoTso/example\n"},"seq":108}
1: (218) <-1009-file-exec-and-symbols /home/pankaj/git/parallel-bug-injection/code/demoTso/example
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (219) ->1009^done\n"},"seq":110}
1: (219) ->1009^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (219) ->(gdb)\n"},"seq":112}
1: (219) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (219) 1009: elapsed time 0\n"},"seq":114}
1: (219) 1009: elapsed time 0
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (219) <-1010-interpreter-exec console \"show architecture\"\n"},"seq":116}
1: (219) <-1010-interpreter-exec console "show architecture"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (220) ->~\"The target architecture is set to \\\"auto\\\" (currently \\\"i386:x86-64\\\").\\n\"\n"},"seq":118}
1: (220) ->~"The target architecture is set to \"auto\" (currently \"i386:x86-64\").\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (220) ->1010^done\n"},"seq":120}
1: (220) ->1010^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (220) ->(gdb)\n"},"seq":122}
1: (220) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (220) 1010: elapsed time 0\n"},"seq":124}
1: (220) 1010: elapsed time 0
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (221) <-1011-break-insert -f main\n"},"seq":126}
1: (221) <-1011-break-insert -f main
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (221) ->1011^done,bkpt={number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0x0000000000000792\",func=\"main\",file=\"/home/pankaj/git/parallel-bug-injection/code/demoTso/example.c\",fullname=\"/home/pankaj/git/parallel-bug-injection/code/demoTso/example.c\",line=\"29\",thread-groups=[\"i1\"],times=\"0\",original-location=\"main\"}\n"},"seq":128}
1: (221) ->1011^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0000000000000792",func="main",file="/home/pankaj/git/parallel-bug-injection/code/demoTso/example.c",fullname="/home/pankaj/git/parallel-bug-injection/code/demoTso/example.c",line="29",thread-groups=["i1"],times="0",original-location="main"}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (221) ->(gdb)\n"},"seq":130}
1: (221) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (226) 1011: elapsed time 5\n"},"seq":132}
1: (226) 1011: elapsed time 5
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (231) Send Event AD7EngineCreateEvent\n"},"seq":134}
1: (231) Send Event AD7EngineCreateEvent
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (232) Send Event AD7ProgramCreateEvent\n"},"seq":136}
1: (232) Send Event AD7ProgramCreateEvent
--> E (output): {"type":"event","event":"output","body":{"category":"telemetry","output":"VS/Diagnostics/Debugger/Launch","data":{"VS.Diagnostics.Debugger.ImplementationName":"Microsoft.MIDebugEngine","VS.Diagnostics.Debugger.EngineVersion":"17.4.30710.1","VS.Diagnostics.Debugger.HostVersion":"17.4.30710.1","VS.Diagnostics.Debugger.AdapterId":"cppdbg","VS.Diagnostics.Debugger.Launch.Duration":181,"VS.Diagnostics.Debugger.MIMode":"gdb","VS.Diagnostics.Debugger.FrameworkVersion":"6.0.1923.31806"}},"seq":138}
--> R (launch-2): {"type":"response","request_seq":2,"success":true,"command":"launch","body":{},"seq":140}
--> E (initialized): {"type":"event","event":"initialized","body":{},"seq":142}
<-- R (runInTerminal-6) [134 ms]: {"type":"response","seq":3,"command":"runInTerminal","request_seq":6,"success":true,"body":{"shellProcessId":15654}}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (255) ShellPid=17479\n"},"seq":145}
1: (255) ShellPid=17479
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (256) DebuggerPid=17481\n"},"seq":147}
1: (256) DebuggerPid=17481
<-- C (setBreakpoints-4): {"command":"setBreakpoints","arguments":{"source":{"name":"example.c","path":"/home/pankaj/git/parallel-bug-injection/code/demoTso/example.c"},"lines":[14,19,21,26],"breakpoints":[{"line":14},{"line":19},{"line":21},{"line":26}],"sourceModified":false},"type":"request","seq":4}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (280) <-1012-break-insert -f example.c:14\n"},"seq":150}
1: (280) <-1012-break-insert -f example.c:14
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (281) ->1012^done,bkpt={number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0x0000000000000726\",func=\"thr1\",file=\"/home/pankaj/git/parallel-bug-injection/code/demoTso/example.c\",fullname=\"/home/pankaj/git/parallel-bug-injection/code/demoTso/example.c\",line=\"16\",thread-groups=[\"i1\"],times=\"0\",original-location=\"example.c:14\"}\n"},"seq":152}
1: (281) ->1012^done,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="0x0000000000000726",func="thr1",file="/home/pankaj/git/parallel-bug-injection/code/demoTso/example.c",fullname="/home/pankaj/git/parallel-bug-injection/code/demoTso/example.c",line="16",thread-groups=["i1"],times="0",original-location="example.c:14"}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (281) ->(gdb)\n"},"seq":154}
1: (281) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (282) 1012: elapsed time 1\n"},"seq":156}
1: (282) 1012: elapsed time 1
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (290) <-1013-symbol-list-lines /home/pankaj/git/parallel-bug-injection/code/demoTso/example.c\n"},"seq":158}
1: (290) <-1013-symbol-list-lines /home/pankaj/git/parallel-bug-injection/code/demoTso/example.c
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (291) ->1013^done,lines=[{pc=\"0x000000000000071a\",line=\"15\"},{pc=\"0x0000000000000726\",line=\"16\"},{pc=\"0x0000000000000730\",line=\"17\"},{pc=\"0x0000000000000739\",line=\"18\"},{pc=\"0x000000000000074f\",line=\"19\"},{pc=\"0x0000000000000752\",line=\"22\"},{pc=\"0x000000000000075e\",line=\"23\"},{pc=\"0x0000000000000768\",line=\"24\"},{pc=\"0x0000000000000771\",line=\"25\"},{pc=\"0x0000000000000787\",line=\"26\"},{pc=\"0x000000000000078a\",line=\"29\"},{pc=\"0x0000000000000792\",line=\"29\"},{pc=\"0x00000000000007a1\",line=\"31\"},{pc=\"0x00000000000007ab\",line=\"32\"},{pc=\"0x00000000000007b5\",line=\"36\"},{pc=\"0x00000000000007d7\",line=\"37\"},{pc=\"0x00000000000007f9\",line=\"39\"},{pc=\"0x0000000000000803\",line=\"0\"}]\n"},"seq":160}
1: (291) ->1013^done,lines=[{pc="0x000000000000071a",line="15"},{pc="0x0000000000000726",line="16"},{pc="0x0000000000000730",line="17"},{pc="0x0000000000000739",line="18"},{pc="0x000000000000074f",line="19"},{pc="0x0000000000000752",line="22"},{pc="0x000000000000075e",line="23"},{pc="0x0000000000000768",line="24"},{pc="0x0000000000000771",line="25"},{pc="0x0000000000000787",line="26"},{pc="0x000000000000078a",line="29"},{pc="0x0000000000000792",line="29"},{pc="0x00000000000007a1",line="31"},{pc="0x00000000000007ab",line="32"},{pc="0x00000000000007b5",line="36"},{pc="0x00000000000007d7",line="37"},{pc="0x00000000000007f9",line="39"},{pc="0x0000000000000803",line="0"}]
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (291) ->(gdb)\n"},"seq":162}
1: (291) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (293) 1013: elapsed time 3\n"},"seq":164}
1: (293) 1013: elapsed time 3
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (300) Send Event AD7BreakpointBoundEvent\n"},"seq":166}
1: (300) Send Event AD7BreakpointBoundEvent
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (303) <-1014-break-insert -f example.c:19\n"},"seq":168}
1: (303) <-1014-break-insert -f example.c:19
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (303) ->1014^done,bkpt={number=\"3\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0x000000000000074f\",func=\"thr1\",file=\"/home/pankaj/git/parallel-bug-injection/code/demoTso/example.c\",fullname=\"/home/pankaj/git/parallel-bug-injection/code/demoTso/example.c\",line=\"19\",thread-groups=[\"i1\"],times=\"0\",original-location=\"example.c:19\"}\n"},"seq":170}
1: (303) ->1014^done,bkpt={number="3",type="breakpoint",disp="keep",enabled="y",addr="0x000000000000074f",func="thr1",file="/home/pankaj/git/parallel-bug-injection/code/demoTso/example.c",fullname="/home/pankaj/git/parallel-bug-injection/code/demoTso/example.c",line="19",thread-groups=["i1"],times="0",original-location="example.c:19"}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (303) ->(gdb)\n"},"seq":172}
1: (303) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (303) 1014: elapsed time 0\n"},"seq":174}
1: (303) 1014: elapsed time 0
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (304) Send Event AD7BreakpointBoundEvent\n"},"seq":176}
1: (304) Send Event AD7BreakpointBoundEvent
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (304) <-1015-break-insert -f example.c:21\n"},"seq":178}
1: (304) <-1015-break-insert -f example.c:21
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (306) ->1015^done,bkpt={number=\"4\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0x000000000000075e\",func=\"thr2\",file=\"/home/pankaj/git/parallel-bug-injection/code/demoTso/example.c\",fullname=\"/home/pankaj/git/parallel-bug-injection/code/demoTso/example.c\",line=\"23\",thread-groups=[\"i1\"],times=\"0\",original-location=\"example.c:21\"}\n"},"seq":180}
1: (306) ->1015^done,bkpt={number="4",type="breakpoint",disp="keep",enabled="y",addr="0x000000000000075e",func="thr2",file="/home/pankaj/git/parallel-bug-injection/code/demoTso/example.c",fullname="/home/pankaj/git/parallel-bug-injection/code/demoTso/example.c",line="23",thread-groups=["i1"],times="0",original-location="example.c:21"}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (307) ->(gdb)\n"},"seq":182}
1: (307) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (307) 1015: elapsed time 2\n"},"seq":184}
1: (307) 1015: elapsed time 2
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (307) Send Event AD7BreakpointBoundEvent\n"},"seq":186}
1: (307) Send Event AD7BreakpointBoundEvent
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (307) <-1016-break-insert -f example.c:26\n"},"seq":188}
1: (307) <-1016-break-insert -f example.c:26
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (307) ->1016^done,bkpt={number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0x0000000000000787\",func=\"thr2\",file=\"/home/pankaj/git/parallel-bug-injection/code/demoTso/example.c\",fullname=\"/home/pankaj/git/parallel-bug-injection/code/demoTso/example.c\",line=\"26\",thread-groups=[\"i1\"],times=\"0\",original-location=\"example.c:26\"}\n"},"seq":190}
1: (307) ->1016^done,bkpt={number="5",type="breakpoint",disp="keep",enabled="y",addr="0x0000000000000787",func="thr2",file="/home/pankaj/git/parallel-bug-injection/code/demoTso/example.c",fullname="/home/pankaj/git/parallel-bug-injection/code/demoTso/example.c",line="26",thread-groups=["i1"],times="0",original-location="example.c:26"}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (307) ->(gdb)\n"},"seq":192}
1: (307) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (307) 1016: elapsed time 0\n"},"seq":194}
1: (307) 1016: elapsed time 0
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (308) Send Event AD7BreakpointBoundEvent\n"},"seq":196}
1: (308) Send Event AD7BreakpointBoundEvent
--> R (setBreakpoints-4): {"type":"response","request_seq":4,"success":true,"command":"setBreakpoints","body":{"breakpoints":[{"id":1,"verified":true,"line":14,"BoundBreakpoints":[]},{"id":2,"verified":true,"line":19,"BoundBreakpoints":[]},{"id":3,"verified":true,"line":21,"BoundBreakpoints":[]},{"id":4,"verified":true,"line":26,"BoundBreakpoints":[]}]},"seq":198}
--> E (breakpoint): {"type":"event","event":"breakpoint","body":{"reason":"changed","breakpoint":{"id":1,"verified":true,"line":16,"BoundBreakpoints":[]}},"seq":200}
--> E (breakpoint): {"type":"event","event":"breakpoint","body":{"reason":"changed","breakpoint":{"id":2,"verified":true,"line":19,"BoundBreakpoints":[]}},"seq":202}
--> E (breakpoint): {"type":"event","event":"breakpoint","body":{"reason":"changed","breakpoint":{"id":3,"verified":true,"line":23,"BoundBreakpoints":[]}},"seq":204}
--> E (breakpoint): {"type":"event","event":"breakpoint","body":{"reason":"changed","breakpoint":{"id":4,"verified":true,"line":26,"BoundBreakpoints":[]}},"seq":206}
<-- C (setFunctionBreakpoints-5): {"command":"setFunctionBreakpoints","arguments":{"breakpoints":[]},"type":"request","seq":5}
--> R (setFunctionBreakpoints-5): {"type":"response","request_seq":5,"success":true,"command":"setFunctionBreakpoints","body":{"breakpoints":[]},"seq":209}
<-- C (setDataBreakpoints-6): {"command":"setDataBreakpoints","arguments":{"breakpoints":[]},"type":"request","seq":6}
--> R (setDataBreakpoints-6): {"type":"response","request_seq":6,"success":true,"command":"setDataBreakpoints","body":{"breakpoints":[]},"seq":212}
<-- C (setInstructionBreakpoints-7): {"command":"setInstructionBreakpoints","arguments":{"breakpoints":[]},"type":"request","seq":7}
--> R (setInstructionBreakpoints-7): {"type":"response","request_seq":7,"success":true,"command":"setInstructionBreakpoints","body":{"breakpoints":[]},"seq":215}
<-- C (setExceptionBreakpoints-8): {"command":"setExceptionBreakpoints","arguments":{"filters":[],"filterOptions":[]},"type":"request","seq":8}
--> R (setExceptionBreakpoints-8): {"type":"response","request_seq":8,"success":true,"command":"setExceptionBreakpoints","body":{"breakpoints":[]},"seq":218}
<-- C (configurationDone-9): {"command":"configurationDone","type":"request","seq":9}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (379) Send Event AD7LoadCompleteEvent\n"},"seq":222}
1: (379) Send Event AD7LoadCompleteEvent
--> R (configurationDone-9): {"type":"response","request_seq":9,"success":true,"command":"configurationDone","body":{},"seq":221}
--> E (output): {"type":"event","event":"output","body":{"category":"stdout","output":"=thread-group-added,id=\"i1\"\nGNU gdb (Ubuntu 10.2-0ubuntu1~18.04~2) 10.2\nCopyright (C) 2021 Free Software Foundation, Inc.\nLicense GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.\nType \"show copying\" and \"show warranty\" for details.\nThis GDB was configured as \"x86_64-linux-gnu\".\nType \"show configuration\" for configuration details.\nFor bug reporting instructions, please see:\n<https://www.gnu.org/software/gdb/bugs/>.\nFind the GDB manual and other documentation resources online at:\n <http://www.gnu.org/software/gdb/documentation/>.\n\nFor help, type \"help\".\nType \"apropos word\" to search for commands related to \"word\".\n=cmd-param-changed,param=\"history save\",value=\"on\"\nWarning: Debuggee TargetArchitecture not detected, assuming x86_64.\n=cmd-param-changed,param=\"pagination\",value=\"off\"\n"},"seq":225}
=thread-group-added,id="i1"
GNU gdb (Ubuntu 10.2-0ubuntu1~18.04~2) 10.2
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
=cmd-param-changed,param="history save",value="on"
Warning: Debuggee TargetArchitecture not detected, assuming x86_64.
=cmd-param-changed,param="pagination",value="off"
<-- C (threads-10): {"command":"threads","type":"request","seq":10}
--> R (threads-10): {"type":"response","request_seq":10,"success":true,"command":"threads","body":{"threads":[]},"seq":228}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (392) <-1017-exec-run\n"},"seq":230}
1: (392) <-1017-exec-run
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (392) ->=thread-group-started,id=\"i1\",pid=\"17512\"\n"},"seq":232}
1: (392) ->=thread-group-started,id="i1",pid="17512"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (392) ->=thread-created,id=\"1\",group-id=\"i1\"\n"},"seq":234}
1: (392) ->=thread-created,id="1",group-id="i1"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (395) <-1018-thread-info 1\n"},"seq":236}
1: (395) <-1018-thread-info 1
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (396) ->=breakpoint-modified,bkpt={number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0x0000555555554792\",func=\"main\",file=\"/home/pankaj/git/parallel-bug-injection/code/demoTso/example.c\",fullname=\"/home/pankaj/git/parallel-bug-injection/code/demoTso/example.c\",line=\"29\",thread-groups=[\"i1\"],times=\"0\",original-location=\"main\"}\n"},"seq":238}
1: (396) ->=breakpoint-modified,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0000555555554792",func="main",file="/home/pankaj/git/parallel-bug-injection/code/demoTso/example.c",fullname="/home/pankaj/git/parallel-bug-injection/code/demoTso/example.c",line="29",thread-groups=["i1"],times="0",original-location="main"}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (396) ->=breakpoint-modified,bkpt={number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0x0000555555554726\",func=\"thr1\",file=\"/home/pankaj/git/parallel-bug-injection/code/demoTso/example.c\",fullname=\"/home/pankaj/git/parallel-bug-injection/code/demoTso/example.c\",line=\"16\",thread-groups=[\"i1\"],times=\"0\",original-location=\"example.c:14\"}\n"},"seq":240}
1: (396) ->=breakpoint-modified,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="0x0000555555554726",func="thr1",file="/home/pankaj/git/parallel-bug-injection/code/demoTso/example.c",fullname="/home/pankaj/git/parallel-bug-injection/code/demoTso/example.c",line="16",thread-groups=["i1"],times="0",original-location="example.c:14"}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (397) ->=breakpoint-modified,bkpt={number=\"3\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0x000055555555474f\",func=\"thr1\",file=\"/home/pankaj/git/parallel-bug-injection/code/demoTso/example.c\",fullname=\"/home/pankaj/git/parallel-bug-injection/code/demoTso/example.c\",line=\"19\",thread-groups=[\"i1\"],times=\"0\",original-location=\"example.c:19\"}\n"},"seq":242}
1: (397) ->=breakpoint-modified,bkpt={number="3",type="breakpoint",disp="keep",enabled="y",addr="0x000055555555474f",func="thr1",file="/home/pankaj/git/parallel-bug-injection/code/demoTso/example.c",fullname="/home/pankaj/git/parallel-bug-injection/code/demoTso/example.c",line="19",thread-groups=["i1"],times="0",original-location="example.c:19"}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (397) ->=breakpoint-modified,bkpt={number=\"4\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0x000055555555475e\",func=\"thr2\",file=\"/home/pankaj/git/parallel-bug-injection/code/demoTso/example.c\",fullname=\"/home/pankaj/git/parallel-bug-injection/code/demoTso/example.c\",line=\"23\",thread-groups=[\"i1\"],times=\"0\",original-location=\"example.c:21\"}\n"},"seq":244}
1: (397) ->=breakpoint-modified,bkpt={number="4",type="breakpoint",disp="keep",enabled="y",addr="0x000055555555475e",func="thr2",file="/home/pankaj/git/parallel-bug-injection/code/demoTso/example.c",fullname="/home/pankaj/git/parallel-bug-injection/code/demoTso/example.c",line="23",thread-groups=["i1"],times="0",original-location="example.c:21"}
Other Extensions
No response
Additional Information
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported behavior using the provided launch configuration, its setupCommands, and GDB 10.2 in MI mode. Read the debugger logs around the history filename and history save commands, then compare the resulting debug_history.txt with the commands sent during the session. Done means the expected command history is captured cleanly, or the limitation and supported alternative are documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, vscode
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 32/100