Author Topic: Commands sent to debugger  (Read 5446 times)

Offline kschwan

  • Single posting newcomer
  • *
  • Posts: 3
Commands sent to debugger
« on: February 26, 2012, 03:30:24 am »
Hello everyone.

I've recently started using Code::Blocks as my IDE for both C++ and C (for embedded systems), which I work on as a part of my university studies.

Currently I'm working with a micro-controller and have successfully gotten it hooked up to GDB (CodeSourcery arm-none-eabi) via. OpenOCD and through the C::B IDE.
I have one little problem though: When I launch the debugger, it seems to be sending the continue command "by itself". I find that rather annoying as I would like to keep my uC in a halted state. I "halt" the uC when OpenOCD receives an incoming GDB connection (specified in the OpenOCD configuration).

Is this intended behaviour? And is there any way to avoid it? Forgive me if there is an easy answer; I could very well be missing something :)

I'm using the 7844 SVN C::B build on Ubuntu 11.10, OpenOCD 0.5.0 and GDB 7.2.50.20100908

Thanks for the time invested in this great IDE!

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Commands sent to debugger
« Reply #1 on: February 26, 2012, 10:39:22 am »
Hm, we've discussed such an issue in this topic: http://forums.codeblocks.org/index.php/topic,15947.0.html but it was for the windows version of codesourcery's gdb.
Can you paste the full log of the debugger? (using code tags)

Also can you try to compile vanilla gdb yourself, the target should arm-none-eabi?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline kschwan

  • Single posting newcomer
  • *
  • Posts: 3
Re: Commands sent to debugger
« Reply #2 on: February 26, 2012, 04:09:46 pm »
Sure

This is what gdb puts out when I'm connection through the command line
Code
$ arm-none-eabi-gdb ~/code-projects/lm3s6965/src/led-counter/bin/Debug/led-counter
GNU gdb (Sourcery CodeBench Lite 2011.09-69) 7.2.50.20100908-cvs
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-pc-linux-gnu --target=arm-none-eabi".
For bug reporting instructions, please see:
<https://support.codesourcery.com/GNUToolchain/>...
Reading symbols from /home/schwan/code-projects/lm3s6965/src/led-counter/bin/Debug/led-counter...done.
(gdb) target remote localhost:3333
Remote debugging using localhost:3333
ResetISR () at startup.c:128
128 {
(gdb)


And here is the same from within code blocks (no extra gdb commands append in my project options, so I'm not sure where they come from)
Code
LD_LIBRARY_PATH=.:/home/schwan/code-projects/lm3s6965/lib/SW-DRL-8555/driverlib/gcc-cm3:/usr/local/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_EABI/arm-none-eabi/lib:/usr/local/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_EABI/lib/gcc/arm-none-eabi/4.6.1:
Command-line: /usr/local/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_EABI/bin/arm-none-eabi-gdb -nx -fullname  -quiet -args bin/Debug/led-counter
Working dir : /home/schwan/code-projects/lm3s6965/src/led-counter/
Reading symbols from /home/schwan/code-projects/lm3s6965/src/led-counter/bin/Debug/led-counter...done.
(gdb)
> set prompt >>>>>>cb_gdb:
Executing: xterm -T 'Program Console' -e sleep 82203
>>>>>>cb_gdb:
> show version
GNU gdb (Sourcery CodeBench Lite 2011.09-69) 7.2.50.20100908-cvs
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-pc-linux-gnu --target=arm-none-eabi".
For bug reporting instructions, please see:
<https://support.codesourcery.com/GNUToolchain/>.
>>>>>>cb_gdb:
> set confirm off
>>>>>>cb_gdb:
> set width 0
>>>>>>cb_gdb:
> set height 0
>>>>>>cb_gdb:
> set breakpoint pending on
>>>>>>cb_gdb:
> set print asm-demangle on
>>>>>>cb_gdb:
> set unwindonsignal on
>>>>>>cb_gdb:
> set disassembly-flavor intel
No symbol "disassembly" in current context.
>>>>>>cb_gdb:
> catch throw
Function "__cxa_throw" not defined.
Catchpoint 1 (throw)
>>>>>>cb_gdb:
> source /usr/share/codeblocks/scripts/stl-views-1.0.3.gdb
Executing: ps x -o tty,pid,command
>>>>>>cb_gdb:
> cd bin/Debug
>>>>>>cb_gdb:
> directory /home/schwan/code-projects/lm3s6965/src/led-counter/
>>>>>>cb_gdb:
> directory /home/schwan/code-projects/lm3s6965/src/
>>>>>>cb_gdb:
> target remote tcp:localhost:3333
PS result: ?         6606 ps x -o tty,pid,command
PS result: pts/2     6605 sleep 82203
TTY is[/dev/pts/2]
GetConsoleTTY[/dev/pts/2]ConsolePid[6603]
Queued:[tty /dev/pts/2]
ResetISR () at startup.c:128
/home/schwan/code-projects/lm3s6965/src/led-counter/startup.c:128:5581:beg:0xf0
>>>>>>cb_gdb:
> tty /dev/pts/2
>>>>>>cb_gdb:
> continue

I'll compile the latest gcc toolchain for ARM, but I probably won't have time before tomorrow or the day after tomorrow)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Commands sent to debugger
« Reply #3 on: February 26, 2012, 04:57:55 pm »
Have you tried to use the "do not run the debuggee" option in Settings -> Debugger -> GDB Debugger -> Your config?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline kschwan

  • Single posting newcomer
  • *
  • Posts: 3
Re: Commands sent to debugger
« Reply #4 on: February 27, 2012, 01:19:49 pm »
Have you tried to use the "do not run the debuggee" option in Settings -> Debugger -> GDB Debugger -> Your config?

Ah! I knew I had missed something. This was just what I was looking for, thanks!