Open lingr7 opened 2 years ago
In your launch.json
's setupCommands
you want to add:
"setupCommands": [
{
"text": "set logging on",
"description": "Enable File Logging",
"ignoreFailures": false
},
{
"text": "set logging file logfile.log",
"description": "Log GDB Output to logfile.log",
"ignoreFailures": false
},
]
See https://sourceware.org/gdb/onlinedocs/gdb/Logging-Output.html
sorry, maybe my descript is not clear. Why I think use 1 >
is I want to get the terminal show things(but not the gdb level log). now I find our own program itself has done save our set log to file, but the file does not include the result printf()
and the depend library's log show in run in terminal.So I want to save what I can see in terminal to file to use like grep
to find what I care about in this run.
In launch.json
's setupCommands
now has
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
now show like
I want to redirect the output to logfile, how can I do this? but the 1> is used by Microsoft-MIEngine