Author Topic: Codeblocks, gdbserver and beagleboard  (Read 21165 times)

Offline doragasu

  • Single posting newcomer
  • *
  • Posts: 7
Codeblocks, gdbserver and beagleboard
« on: April 23, 2009, 01:50:22 pm »
Hi all!

I've been using codeblocks for some months, developing x86 Linux applications, and it's a great app. Now I have to debug applications for a beagleboard running Angstrom Linux distribution (ARM Cortex A8). I have gdbserver running in the beagleboard, and I could connect and debug applications using arm-angstrom-linux-gnueabi-gdb (the cross debugger), connecting it to the gdbserver in the beagleboard.

The problem is when I try to debug with codeblocks. I have configured gdb with the ip/port of the Beagleboard, and with some custom commands. When I launch the debugger in Codeblocks, it connects with gdbserver in the beagleboard, but the application starts, and finish without hitting the the breakpoints.

I suspect the error may be due to Codeblocks calling gdb instead of arm-angstrom-linux-gnueabi-gdb. How can I make C::B call arm-angstrom-linux-gnueabi-gdb instead of gdb?

Any suggestions are greatly appreciated.

Thanks for reading.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Codeblocks, gdbserver and beagleboard
« Reply #1 on: April 23, 2009, 04:53:31 pm »
I suspect the error may be due to Codeblocks calling gdb instead of arm-angstrom-linux-gnueabi-gdb. How can I make C::B call arm-angstrom-linux-gnueabi-gdb instead of gdb?
Did you try setting the name of the debugger's executable in the compiler settings -> toolchain options?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline doragasu

  • Single posting newcomer
  • *
  • Posts: 7
Re: Codeblocks, gdbserver and beagleboard
« Reply #2 on: May 04, 2009, 05:42:12 pm »
I couldn't have a look to this until today. I didn't notice you can configure the different toolchains under 'Settings/Compiler and debugger...'. I was compiling my project using a custom makefile. I'll try to configure the toolchain in C::B and if it works, then I will try also to use the debugger.

Thanks a lot MortenMacFly!

Offline doragasu

  • Single posting newcomer
  • *
  • Posts: 7
Re: Codeblocks, gdbserver and beagleboard
« Reply #3 on: May 05, 2009, 06:18:06 pm »
Finally I got it to work. Using Morten suggestions, I can build the project and remote-debug it with C::B interface.

Only one thing lasts to reach the perfect-remote-debugging-experience. I have to manually copy the generated executable to the beagleboard (I use scp for this) and manually launch gdbserver in the beagleboard (I use ssh for this). Can these two steps also be automated? It would be great if each time I hit F8 for debugging, the generated binary was transferred to the beagleboard and gdbserver was launched before starting the debug session. I think it can be done each time I build the file, but can be done each time I start the debug session?

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: Codeblocks, gdbserver and beagleboard
« Reply #4 on: May 05, 2009, 08:34:26 pm »
Hi !

Did you try the post build steps ?

Dje

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5490
Re: Codeblocks, gdbserver and beagleboard
« Reply #5 on: May 05, 2009, 10:09:40 pm »
we are working on some pre/post debug commands (i.e. additional shell commands), the gui is already there, but the actions are not carried out yet.

Offline doragasu

  • Single posting newcomer
  • *
  • Posts: 7
Re: Codeblocks, gdbserver and beagleboard
« Reply #6 on: May 06, 2009, 03:36:42 pm »
What language are the scripts written in? I tried to launch a shell script in the post build steps, and didn't work (I got several errors). The script copies a file using scp and launchs gdbserver:

Code
scp ./bin/Debug/SDSN_BB root@192.168.1.110:SDSN_BB
ssh root@192.168.1.110 "gdbserver localhost:5000 SDSN_BB"

I browsed the codeblocks manual and I haven't seen documentation about scripts. The manual tells how to launch them, but I haven't seen any more documentation about scripts.

Offline Kaijun

  • Multiple posting newcomer
  • *
  • Posts: 25
Re: Codeblocks, gdbserver and beagleboard
« Reply #7 on: January 26, 2011, 06:49:48 pm »
I tried C::B 10.05 on the beagleboard. I got the same problem. I built in openembedded., then debug in C::B. the debugger pointer doesn't appear.