Need help setting up local cross compile and debug on remote

Sysprogs forums Forums VisualGDB Need help setting up local cross compile and debug on remote

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #713
    jchl
    Participant

    I’m new to using VisualGDB (or GDB in general). I created a Linux project using the “Linux Project Wizard”. During the setup I choose the “Build the project locally with a cross-compiler” option. For the cross-toolchain setup, I set it up to use the cross tools I got from the cygwin ports (http://sourceware.org/cygwinports/) and made sure I updated the GCC/G++/AR/OBJCOPY executable to point to the x86_64-pc-linux-gnu-XXX.exe versions. I also set it up to deploy to a Linux Virtual Machine. After I clicked next, it did some self test and everything seems to went through fine. Then I continue to create the project.

    After the project is created, it built fine. But when I tried to set a break point and click debug, I get a warning dialog box from VisualGDB saying:
    “Warning: The gdbserver has exited with code 1. Do you want to abort debugging?”
    If I clicked no, I just get another error dialog box saying:
    Failed to start debugging session. GDB has reported the following error: ^error.msg=”The program is not being run.”

    On the GDB Session window, I see:
    E:utilscygwin64bingdb.exe –interpreter mi “C:TmpLinuxTestProject/Debug/LinuxTestProject”
    Remote register badly formatted: T0506:0000000000000000;07:f0ebffffff7f0000;10:b0b6ddf7ff7f0000;thread:p30d0.30d0;core:0;
    here: 00000000;07:f0ebffffff7f0000;10:b0b6ddf7ff7f0000;thread:p30d0.30d0;core:0;
    The program is not being run.
    Invalid thread id: 1
    No registers.

    And the gdbserver windows has:
    Process /tmp/LinuxTestProject created; pid = 21927
    Can’t bind address: Address already in use.
    Killing process(es): 21927

    Does anyone know what is going on?

    From my Visual Studio’s “VisualGDB Launcher Output” window, I do see that the built binary is successfully deployed (and I confirmed that the file do exists on my Linux VM on the indicated path):
    VisualGDB: Executing predebug actions
    VisualGDB: Deploying C:TmpLinuxTestProject/Debug/LinuxTestProject to /tmp/LinuxTestProject on testlinuxvm…
    VisualGDB: Copy file C:TmpLinuxTestProject/Debug/LinuxTestProject on local computer to /tmp/LinuxTestProject on testlinuxvm
    VisualGDB: Launching gdbserver
    VisualGDB: Run “gdbserver :2000 “$(DeployPath)” ” in directory “$(DeployDir)” on testusr@testlinuxvm (SSH)
    VisualGDB: Launching custom program console
    VisualGDB: Launching gdb

    Can we do local cross compile build and debug on remote machine at all?

    Just as a quick test to see if it is an issue with using a Linux virtual machine, I did tried creating a new identical default project to build on remote using the same Linux VM. That works fine.

    If anyone knows what I did wrong, please let me know. Any help is appreciated.

    John

    #2870
    jchl
    Participant

    After I submitted this post, I just realized that I the gdb.exe that I have was targeted for x86_64-pc-cygwin and that might be my problem. I’ll see if I can get one that is target for x86_64-pc-linux-gnu.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.