Help with using gdbserver

Sysprogs forums Forums VisualGDB Help with using gdbserver

Tagged: 

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #7832
    BitFlipper
    Participant

    I’m using VisualGDB Linux, and I’m debugging a userworld application (non-Android, just a simple Linux app). Due to various reasons I won’t go into right now, I have to use gdbserver. However it isn’t clear to me how to configure VGDB to use gdbserver. I looked at various tutorials, searched for info on this etc but no luck.

    Specifically, can someone show what a typical setup would look like in the Debug settings > Debug section?

    It appears there are 2 ways to use gdbserver:

    1. “Start GDB in the following mode: Debug with a custom gdb stub (gdbserver protocol)”
      In this case, how should “Use custom GDB executable:” be configured?
      How should “GDBServer/stub:” be configured?
      What should the command to run on the target to start gdbserver look like (if any)?
    2. “Start GDB in the following mode: Custom mode”
      In this case, there is a checkbox “Use a gdbserver”.
      How should the “Edit Custom Command” dialog be configured in this case?

     

    Thanks in advance for any help with this.

    #7838
    support
    Keymaster

    Hi,

    First of all, if you configure VisualGDB to build your code one one machine and deploy it to another one, it will configure gdbserver automatically.

    If you don’t want to do that, you can specify the following settings:

    1. Select “custom mode”
    2. Enable the “use a gdbserver” checkbox and configure the following command:
      1. Command: gdbserver
      2. Arguments: :2000 <command line to launch your program>
    3. Target selection command: -target-select remote <gdbserver host>:2000

    You can also replace 2000 with any other port number.

    Let us know if you need more details.

    #7844
    BitFlipper
    Participant

    OK thanks I’ll give it a try!

    #7850
    BitFlipper
    Participant

    OK thanks that worked. However now I’m running into a different problem… It seems VGDB is running out of memory as it loads a huge amount of symbols. I’ll need to figure out how to limit which symbols are loaded.

    #7851
    support
    Keymaster

    Hi,

    The easiest way to limit the loaded symbols is to copy the symbols you need to a separate directory and ensure that it is added to gdb’s solib-search-path and that the original directory containing all of the symbols is actually not listed there.

    Then GDB will only load the symbols you have copied.

    #7853
    BitFlipper
    Participant

    OK I have a follow up question related to using gdbserver…

    Note however that I’m using VGDB for debugging only as I already have an extensive dev framework that compiles/deploys the project. So I don’t want VGDB to compile or copy any files anywhere. Right now I already have VGDB doing only debugging, but this fact might be relevant when considering the below question…

    So IIUC, when using gdbserver, the setting under “Project settings > Remote machine > Deploy executable on a different machine” …must be selected? If not, will GDB run on the same machine where gdbserver runs, which will defeat the purpose? So just to be clear, the address I enter here is where GDB will actually run, even though it specifically refers to where the executable will be deployed?

    #7856
    support
    Keymaster

    Hi,

    Yes, the “computer used for building and debugging” is the one running gdb. The “deployment machine” below is the one with gdbserver.

    You can disable the actual deployment on the Debug Settings page, but the text on the Project page mentions it as it makes sense for most of the projects.

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