User forums > Using Code::Blocks

How to get a elf-file?? -> Now: Debuging for dummies

<< < (2/3) > >>

starkeeper:

--- Quote from: mariocup on June 07, 2007, 04:07:03 pm ---Hi starkeeper,

you have select Debug as Build Target. This target normally contains debug information. So just check the compiler flag in your build options. Select the category Debugging and deselect "Produce debugging symbols".

Bye,

Mario

--- End quote ---

Is it possible to debug the code with arm-elf-gdb, without debugging symbols?

mariocup:
Hi startkeeper,

it is not possible to debug an target without debug information. This information is stored in the debug section of your elf-File. The normal way is two have two build targets:
Debug and Release.
The Release Targets is generated without debug info and Target Debug with the info.

I do not understand why user should work in a different manner.

Bye,

Mario

starkeeper:
Ok, thanks a lot!

Now to the debugging, which initial debug commands will I have to use?
I used this one here in eclipse:

--- Code: ---target remote localhost:3333
monitor reset
monitor sleep 500
monitor poll
monitor soft_reset_halt
monitor arm7_9 sw_bkpts enable
monitor mww 0xA0000050 0x01c2
monitor mdw 0xA0000050
break main
load
continue
--- End code ---

But this does not work for codeblocks. Starting the debugger with the "Debug/Continue" button gives me this result:

Debugger name and version: GNU gdb 6.5.50.20060612-cvs
In ?? () ()
Continuing...

And thats all, the debugger stops not at the breakpoint and I'm also not able to step through the code.

mariocup:
Hi starkeeper,

did you try to use this command in the command line version of gdb.

arm-elf-gdb <filename>.elf
tar remote localhost:3333
...#
lo
b main
r

Use the run commando instead of the continue command. Eclipse implicitly does some steps, I do not know exactly. Which debugger interface are you using with Eclipse? Embedded CDT from zylin?

We are working on a plugin for starting external debugger for embedded targets like arm with insight. As soon the plugin is stable it will be released to the codeblocks team. We will also provide a download for the ARM Toolchain with codeblocks.

See http://forums.codeblocks.org/index.php/topic,6040.0.html.

Hope to release the plugin next week.

Bye,

Mario

starkeeper:
Good morning!

Well with eclipse I was using the same arm-elf-gdb executable.

I also experimented with the commando-interface, this is the output:

--- Code: ---GNU gdb 6.5.50.20060612-cvs
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "--host=i686-pc-mingw32 --target=arm-elf"...
(gdb) target remote localhost:3333
Remote debugging using localhost:3333
0x000d2664 in ?? ()
(gdb) monitor reset
(gdb) monitor sleep 500
(gdb) monitor poll
target state: halted
target halted in ARM state due to debug request, current mode: Undefined
cpsr: 0xf00000db pc: 0x000d26d0
(gdb) monitor soft_reset_halt
requesting target halt and executing a soft reset
(gdb) monitor arm7_9 sw_bkpts enable
software breakpoints enabled
(gdb) monitor mww 0xA0000050 0x01c2
(gdb) monitor mdw 0xA0000050
0xa0000050: 000001c2
(gdb) break main
Breakpoint 1 at 0x20000158: file main.c, line 6.
(gdb) list
1
2
3       int main(void)
4       {
5
6           int a = 0, b =5;
7           a = a + b;
8
9           while(1)
10          {
(gdb) run
Starting program: C:\ARMProjects\ARMTestII/main.elf
Don't know how to run.  Try "help target".
(gdb)

--- End code ---

So this is the output for the run command. Evertime I type "run" the OpenOCD closes with this error:

--- Code: ---Error:   gdb_server.c:101 gdb_get_char(): read: 10054
--- End code ---

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version