vscode-cpptools icon indicating copy to clipboard operation
vscode-cpptools copied to clipboard

When running the debugger "set stop-on-solib-events 1" is invoked and the debugger is stopped on solib event

Open zenpoy opened this issue 7 years ago • 3 comments

Type: Debugger Input information below

Please review existing issues and our documentation at https://github.com/Microsoft/vscode-cpptools/tree/master/Documentation prior to filing an issue.

Describe the bug

  • OS and Version: Debian 4.9.18-1
  • VS Code Version: 1.30.2
  • C/C++ Extension Version: 0.21.0
  • Other extensions you installed (and if the issue persists after disabling them):
  • A clear and concise description of what the bug is.

I can't attach the logs due to company restriction but I can tell you that when enabling the logger with "engineLogging" I can see that

1: (2569) <-1006-gdb-set stop-on-solib-events 1

and after a while:

1: (7067) ->~"Stopped due to shared library event (no libraries added or removed)\n" 1: (7067) ->*stopped,reason="solib-event",thread-id="1",stopped-threads="all",core="7" Stopped due to shared library event (no libraries added or removed)

This is happening also if I explicitly add a setup command for disabling the "stop-on-solib-events", in that case I first see the "gdb-set stop-on-solib-events 0" is invoked and then the "gdb-set stop-on-solib-events 1" is invoked (and overrides the first command)

I removed all .initgdb files, and also tried to run gdb with "-nx" arg to eliminate any use of config files, where do these config are coming from and how to edit them?

zenpoy avatar Mar 03 '19 11:03 zenpoy

The command is sent within the debugger engine.

It is set here: https://github.com/Microsoft/MIEngine/blob/d1189348e9bfd4e7843cbceb9db16509284acf76/src/MIDebugEngine/Engine.Impl/DebuggedProcess.cs#L692 Then unset here: https://github.com/Microsoft/MIEngine/blob/d1189348e9bfd4e7843cbceb9db16509284acf76/src/MIDebugEngine/Engine.Impl/DebuggedProcess.cs#L345

It seems like we stop on a solib event to clear an terminal error message from a gdb bug.

// The stop cause by first module load seems to be the perfect timing to clear the terminal, // that's why we still need to initially turn stop-on-solib-events on then turn it off after the first stop.

https://github.com/Microsoft/MIEngine/blob/d1189348e9bfd4e7843cbceb9db16509284acf76/src/MIDebugEngine/Engine.Impl/DebuggedProcess.cs#L684

WardenGnaw avatar Mar 04 '19 18:03 WardenGnaw

Is there an update on this? I have the same problem, and as you said it seems to reset the console to clear a messge (due to the "Failed to set controlling terminal: Operation not permitted" bug mentioned in the source code) However it doesn't seem to unset the stop-on-solib-events to 0.

spencerolsondke avatar Apr 03 '20 11:04 spencerolsondke

Note that this makes it really hard to use the new "Logpoint" feature because the debug console is flooded with:

"Stopped due to shared library event:"

messages. Is there anyway to hide the shared library event output?

ryanpholt avatar Jul 17 '20 17:07 ryanpholt