Open Dmitri-Botcharnikov opened 7 years ago
@Dmitri-Botcharnikov: I know that at least for several versions of GDB, program output will not get the '@' prefix. So I don't think we would ever want to do this by default. Maybe we could have some way to achieve this though...
@gregg-miskelly: Could we do this at least for LLDB mode? If you point me where to look in source code, I can try to prepare patch.
@pieandcakes, @Dmitri-Botcharnikov do you know if LLDB will always use the '@'?
Dmitri, I believe the code that will receive those is here: https://github.com/Microsoft/MIEngine/blob/5608ce58b026e605153e7c60fb4f24898a4df67b/src/MIDebugEngine/Engine.Impl/DebuggedProcess.cs#L86
One thought -- Visual Studio has some support for filtering debug output window content if you right click on the output window:
Maybe we could put non-'@' prefixed messages in one of those categories so that one can remove it. If we wanted to do is that way, we would switch to using 'OnOutputMessage' instead of 'OnOutputString' and use one of the enum_MESSAGETYPE120.MT_REASON_*
values for MessageType.
@gregg-miskelly In our VSCode instance, if externalConsole is set to true, the output in the terminal window does not have @ sign. If it is set to false, all output in the debug Console has the @ sign.
@gregg-miskelly: LLDB-MI prefixes all process' stdout & stderr with '@' before displaying prompt so I think it's the safe assumption. We're using MIEngine with remote lldb-mi through plink.exe utility and in this scenario it seems that _connected is always false and we never reach OnOutputString.
For me there are also &
prefixes for internal debug messages:
1: (12074) <-1051-exec-step
1: (12074) ->1051^running
1: (12075) ->*running,thread-id="all"
1: (12076) ->&"26479.073519 skip: checking if file /usr/include/c++/9/bits/unique_ptr.h matches glob /usr/include/c++/*/*/*...\n"
1: (12076) ->&"26479.073537 yes.\n"
1: (12076) ->*stopped,reason="end-stepping-range"...
MIEngine copies all debugger output to Debug Output window in Visual Studio:
Is it possible to leave only debugged program output (prefixed with '@')?