Home:ALL Converter>Visual Studio 2017 Linux remote debugging (gdbserver)

Visual Studio 2017 Linux remote debugging (gdbserver)

Ask Time:2018-06-29T19:29:35         Author:Simon

Json Formatter

After I installed gdbserver on my remote machine (Ubuntu 16.04.4 LTS), I tested the following c++ code by making a "cross-platform console application (linux)" project in Visual Studio 2017:

#include <cstdio>

int main()
{
    printf("hello from testLinuxDebug!\n");
    return 0;
}

I added the connection information (ip address, id, password) of my Ubuntu machine to connection manager and selected "gdbserver" for debugging mode.

Then I started debugging and got the following message:

Unable to start debugging. Unexpected GDB output from command "-interpreter-exec console "target remote localhost63361"". Remote connection closed.

Message after starting to debugging (Image captured from VS2017)

By the way, I got the following message from the Linux Console Window of debug menu of Visual Studio 2017:

Process /home/.../projects/testLinuxDebug/bin/x64/Debug/testLinuxDebug.out created; pid = 29277 Listening on port 4444 Remote debugging from host 127.0.0.1 /build/gdb-9un5Xp/gdb-7.11.1/gdb/gdbserver/regcache.c:264: A problem > internal to GDBserver has been detected. Unknown register ymm0h requested

Message from Linux Console Window (Image captured from VS2017)

Could anybody help me with this problem?

Author:Simon,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/51100753/visual-studio-2017-linux-remote-debugging-gdbserver
Canella :

I was having this exact same problem on my Ubuntu 16.04 machine.\n\nI went through the source code on gdbserver, and it appears to be a problem with a processor register (ymm0h) which is only available to i386 processors.\n\nThe thing is, I don't know how to fix gdbserver to not use this register in particular, but you can solve the error by upgrading your gdb & gdbserver to version 8.3 on the Ubuntu machine. If my guess is correct, version 8.1 was the one that fixed this issue, but by default, Ubuntu 16.04 has version 7.11.1 for both gdb & gdbserver.\n\nYou can run these commands on the linux machine to do that:\n\nwget \"http://ftp.gnu.org/gnu/gdb/gdb-8.3.tar.gz\"\ntar xzf gdb-8.3.tar.gz\ncd gdb-8.3\n./configure --prefix=/usr --with-system-readline\nmake\nsudo make install\n\n\nYou may need to install some extra packages in order to compile the gdb:\n\nsudo apt-get install libreadline6-dev texinfo\n\n\nIf you still have problems trying to install gdb, try this example from Linux from Scratch.\n\nGood luck!",
2019-05-20T07:54:49
yy