microsoft / MIEngine

The Visual Studio MI Debug Engine ("MIEngine") provides an open-source Visual Studio Debugger extension that works with MI-enabled debuggers such as gdb and lldb.
MIT License
817 stars 217 forks source link

VS 2022 Attach to process (gdb): Docker (Linux container) works, SSH (same container process) hangs loading symbols #1416

Open meastp opened 1 year ago

meastp commented 1 year ago

Hi,

I'm struggling with attaching to a process running in a linux container (Ubuntu 23.04, with openssh-server and gdb installed).

Open empty visual studio / no code.

If I try Attach to Process -> Docker (Linux Container) it works perfectly, with breakpoints etc.

If I try Attach to Process -> SSH (have configured and testet connection ubuntu@localhost port 22 is bound to port 2222 locally.)

This seems to start (I pick the process and Native (GDB) debugger and Attach), but hangs indefinetly (until i kill visual studio) on Loading Symbols Loading symbols for module /lib/x86_64-linux-gnu/libcrypto.so.3

I have checked that the file exists. Also, since attaching through Docker (Linux Container) works, this should be ok.

I have tried to enable logging https://github.com/microsoft/MIEngine/wiki/Logging#enabling-logging-from-visual-studio but I didn't get any output to the console.

Hedges commented 3 weeks ago

It looks like parsing output of ps command fails in PSOutputParser.cs. The command could be changed from ps -o ruser to ps -o user for a quick workaround.