Ok, now I got a working script for the arm-elf-gdb commando interface:
starting gdb like this: arm-elf-gdb main.elf
set complaints 1
set output-radix 16
set input-radix 16
target remote localhost:3333
monitor reset
monitor sleep 500
monitor halt
set remote memory-write-packet-size 1024
set remote memory-write-packet-size fixed
set remote memory-read-packet-size 1024
set remote memory-read-packet-size fixed
set remote hardware-watchpoint-limit 2
set remote hardware-breakpoint-limit 2
load
break main
monitor arm7_9 sw_bkpts enable
monitor mww 0xA0000050 0x01c2
monitor mdw 0xA0000050
Continue
This results in total debuging paradise!
Pasting this script in codeblocks gives me this output:
Command-line: C:\Programme\yagarto\bin\arm-elf-gdb.exe -nx -fullname -quiet -args main.elf
Working dir : C:\ARMProjects\ARMTestII\
> set prompt >>>>>>cb_gdb:
(gdb) >>>>>>cb_gdb:
> show version
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".
>>>>>>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 debugevents on
No symbol "debugevents" in current context.
>>>>>>cb_gdb:
> set new-console on
No symbol "new" in current context.
>>>>>>cb_gdb:
> set disassembly-flavor att
No symbol "disassembly" in current context.
>>>>>>cb_gdb:
> set complaints 1
set output-radix 16
set input-radix 16
file main.elf
target remote localhost:3333
monitor reset
monitor sleep 500
monitor halt
set remote memory-write-packet-size 1024
set remote memory-write-packet-size fixed
set remote memory-read-packet-size 1024
set remote memory-read-packet-size fixed
set remote hardware-watchpoint-limit 2
set remote hardware-breakpoint-limit 2
load
break main
monitor arm7_9 sw_bkpts enable
monitor mww 0xA0000050 0x01c2
monitor mdw 0xA0000050
Continue
>>>>>>cb_gdb:>>>>>>cb_gdb:>>>>>>cb_gdb:>>>>>>cb_gdb:>>>>>>cb_gdb:
> directory C:/ARMProjects/ARMTestII/
0x200002e8 in __bss_start ()
>>>>>>cb_gdb:
>>>>>>cb_gdb:
requesting target halt...
>>>>>>cb_gdb:>>>>>>cb_gdb:>>>>>>cb_gdb:>>>>>>cb_gdb:>>>>>>cb_gdb:>>>>>>cb_gdb:>>>>>>cb_gdb:>>>>>>cb_gdb:Loading section .text, size 0x194 lma 0x20000000
Remote communication error: Bad file descriptor.
>>>>>>cb_gdb:Breakpoint 1 at 0x20000158: file main.c, line 6.
putpkt: write failed: No error.
>>>>>>cb_gdb:>>>>>>cb_gdb:>>>>>>cb_gdb:>>>>>>cb_gdb:>>>>>>cb_gdb:>>>>>>cb_gdb:
putpkt: write failed: No error.
putpkt: write failed: No error.
putpkt: write failed: No error.
And this is not working because the load command failes with:
Loading section .text, size 0x194 lma 0x20000000
Remote communication error: Bad file descriptor.