Using gdb to debug program on target

Man I use to be a pro with gdb and debugging remote programs. I wrote a target-side stub for heaven’s sake. Now I can’t even remember how to do a basic connection. sad.

Setup:

Host: x86_64 Ubuntu (192.168.1.18)

Target: ARM-based board (192.168.1.38)

Procedure:

  1. Copy program from Host to Target.
    • $ scp Hello root@192.168.1.38:/tmp/Hello
  2. On target:
    • $ gdbserver 192.168.1.18:1234 Hello
  3. On Host:
    • $ arm-none-linux-gnueabi-gdb Hello
    • (gdb) target remote 192.168.1.38:1234

Usage:

scp <HOST>:PROGRAM <TARGET>:/PATH/TO/PROGRAM

gdbserver <HOST>:<PORT#> PROGRAM

Advertisements
This entry was posted in troubleshooting and tagged , , . Bookmark the permalink.

2 Responses to Using gdb to debug program on target

  1. Ester says:

    Hi Mitchell!
    Nice to come across your examples while googling to fix a pulseaudio problem 🙂
    Ester

    • fangstar says:

      hehe. there are few pulseaudio programmatic examples. I’ll probably be writing some stuff about PulseAudio. Maybe this student can help his teacher? I know your soundcontroller code so well now! One thing I’m trying to figure out for PulseAudio is the data callbacks for threaded mainloop. The signal(cxt, 1) and approve doesn’t work for me so I’m just doing the basic callback.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s