Sysprogs forums › Forums › VisualGDB › Help with using gdbserver
Tagged: gdbserver
- This topic has 6 replies, 2 voices, and was last updated 8 years, 9 months ago by support.
-
AuthorPosts
-
March 25, 2016 at 22:51 #7832BitFlipperParticipant
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:
- “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)? - “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.
March 26, 2016 at 18:28 #7838supportKeymasterHi,
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:
- Select “custom mode”
- Enable the “use a gdbserver” checkbox and configure the following command:
- Command: gdbserver
- Arguments: :2000 <command line to launch your program>
- 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.
March 26, 2016 at 19:35 #7844BitFlipperParticipantOK thanks I’ll give it a try!
March 26, 2016 at 19:51 #7850BitFlipperParticipantOK 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.
March 26, 2016 at 20:37 #7851supportKeymasterHi,
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.
March 26, 2016 at 22:25 #7853BitFlipperParticipantOK 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?
March 28, 2016 at 18:22 #7856supportKeymasterHi,
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.
- “Start GDB in the following mode: Debug with a custom gdb stub (gdbserver protocol)”
-
AuthorPosts
- You must be logged in to reply to this topic.