My program builds and runs ok, but refuses to debug. I can debug other programs ok, and I’ve used the same settings for this one. I’m completely baffled, so any suggestions gratefully received!
here is gdb output:
target remote localhost:3333
monitor soft_reset_halt
monitor arm7_9 force_hw_bkpts enable
symbol-file main.out
66-gdb-set confirm off
66^done
(gdb)
67-gdb-set width 0
67^done
(gdb)
68-gdb-set height 0
68^done
(gdb)
69-interpreter-exec console echo
69^done
(gdb)
70-gdb-show prompt
70^done,value="(gdb) "
(gdb)
71 target remote localhost:3333
&“target remote localhost:3333\n”
~“main () at main.c:93\n”
main () at main.c:93
~“93\t\t}\n”
93 }
71^done
(gdb)
72 monitor soft_reset_halt
&“monitor soft_reset_halt\n”
@“requesting target halt and executing a soft reset\n”
requesting target halt and executing a soft reset
72^done
(gdb)
73 monitor arm7_9 force_hw_bkpts enable
&“monitor arm7_9 force_hw_bkpts enable\n”
@“force hardware breakpoints enabled\n”
force hardware breakpoints enabled
73^done
(gdb)
74 symbol-file main.out
&“symbol-file main.out\n”
&“main.out: No such file or directory.\n”
74^done
(gdb)
75 thbreak main
main.out: No such file or directory.
&“thbreak main\n”
thbreak main
~“Hardware assisted breakpoint 1 at 0x2cc: file main.c, line 80.\n”
Hardware assisted breakpoint 1 at 0x2cc: file main.c, line 80.
75^done
(gdb)
76 continue
&“continue\n”
continue
&“Remote communication error: Connection reset by peer.\n”
Remote communication error: Connection reset by peer.
I don’t understand why gdb can’t find main.out - it’s in the project directory.
here is openocd output:
Info: openocd.c:82 main(): Open On-Chip Debugger (2006-08-31 15:00 CEST)
Debug: jtag.c:1209 jtag_init():
Debug: ft2232.c:941 ft2232_init(): ‘ft2232’ interface using FTD2XX with ‘olimex-jtag’ layout
Debug: ft2232.c:1010 ft2232_init(): current latency timer: 2
Debug: ft2232.c:1253 olimex_jtag_init(): 80 08 1b
Debug: ft2232.c:1296 olimex_jtag_init(): 82 09 0f
Debug: ft2232.c:224 ft2232_speed(): 86 01 00
Debug: jtag.c:247 jtag_call_event_callbacks(): jtag event: 1
Debug: jtag.c:1095 jtag_reset_callback():
Debug: jtag.c:247 jtag_call_event_callbacks(): jtag event: 1
Debug: jtag.c:1095 jtag_reset_callback():
Debug: openocd.c:98 main(): jtag init complete
Debug: arm7_9_common.c:655 arm7_9_assert_reset(): target->state: unknown
Debug: jtag.c:247 jtag_call_event_callbacks(): jtag event: 0
Debug: jtag.c:1095 jtag_reset_callback():
Debug: jtag.c:247 jtag_call_event_callbacks(): jtag event: 1
Debug: jtag.c:1095 jtag_reset_callback():
Warning: arm7_9_common.c:679 arm7_9_assert_reset(): srst resets test logic, too
Debug: jtag.c:247 jtag_call_event_callbacks(): jtag event: 0
Debug: jtag.c:1095 jtag_reset_callback():
Debug: jtag.c:247 jtag_call_event_callbacks(): jtag event: 1
Debug: jtag.c:1095 jtag_reset_callback():
Debug: ft2232.c:718 olimex_jtag_reset(): trst: 1, srst: 1, high_output: 0x02, high_direction: 0x0f
Debug: ft2232.c:718 olimex_jtag_reset(): trst: 1, srst: 1, high_output: 0x02, high_direction: 0x0f
Debug: arm7_9_common.c:718 arm7_9_deassert_reset(): target->state: reset
Debug: jtag.c:247 jtag_call_event_callbacks(): jtag event: 2
Debug: jtag.c:1095 jtag_reset_callback():
Debug: ft2232.c:718 olimex_jtag_reset(): trst: 0, srst: 0, high_output: 0x09, high_direction: 0x0f
Debug: openocd.c:102 main(): target init complete
Debug: openocd.c:106 main(): flash init complete
Debug: gdb_server.c:1115 gdb_init(): gdb service for target arm7tdmi at port 3333
Debug: embeddedice.c:156 embeddedice_read_reg_w_check(): 1
Debug: jtag.c:247 jtag_call_event_callbacks(): jtag event: 3
Debug: jtag.c:1095 jtag_reset_callback():
Debug: arm7_9_common.c:781 arm7_9_halt(): target->state: running
Debug: embeddedice.c:252 embeddedice_write_reg(): 9: 0xffffffff
Debug: embeddedice.c:252 embeddedice_write_reg(): 11: 0xffffffff
Debug: embeddedice.c:252 embeddedice_write_reg(): 12: 0x00000100
Debug: embeddedice.c:252 embeddedice_write_reg(): 13: 0x000000f7
Debug: embeddedice.c:156 embeddedice_read_reg_w_check(): 1
Debug: arm7_9_common.c:619 arm7_9_poll(): DBGACK set, dbg_state->value: 0x9
Debug: embeddedice.c:252 embeddedice_write_reg(): 0: 0x00000005
Debug: embeddedice.c:252 embeddedice_write_reg(): 12: 0x00000000
Debug: arm7_9_common.c:919 arm7_9_debug_entry(): target entered debug from ARM state
Debug: arm7_9_common.c:938 arm7_9_debug_entry(): target entered debug state in System mode
Debug: arm7_9_common.c:974 arm7_9_debug_entry(): r0: 0x0000001b
Debug: arm7_9_common.c:974 arm7_9_debug_entry(): r1: 0x0000001b
Debug: arm7_9_common.c:974 arm7_9_debug_entry(): r2: 0x40000200
Debug: arm7_9_common.c:974 arm7_9_debug_entry(): r3: 0x04000510
Debug: arm7_9_common.c:974 arm7_9_debug_entry(): r4: 0x00000000
Debug: arm7_9_common.c:974 arm7_9_debug_entry(): r5: 0xe01fc040
Debug: arm7_9_common.c:974 arm7_9_debug_entry(): r6: 0x000000b1
Debug: arm7_9_common.c:974 arm7_9_debug_entry(): r7: 0xffffffff
Debug: arm7_9_common.c:974 arm7_9_debug_entry(): r8: 0xffffffff
Debug: arm7_9_common.c:974 arm7_9_debug_entry(): r9: 0xffffffff
Debug: arm7_9_common.c:974 arm7_9_debug_entry(): r10: 0xffffffff
Debug: arm7_9_common.c:974 arm7_9_debug_entry(): r11: 0x40007ec4
Debug: arm7_9_common.c:974 arm7_9_debug_entry(): r12: 0x40007eb8
Debug: arm7_9_common.c:974 arm7_9_debug_entry(): r13: 0x40007eb8
Debug: arm7_9_common.c:974 arm7_9_debug_entry(): r14: 0x0000034c
Debug: arm7_9_common.c:974 arm7_9_debug_entry(): r15: 0x0000034c
Debug: arm7_9_common.c:980 arm7_9_debug_entry(): entered debug state at PC 0x34c
Debug: target.c:442 target_call_event_callbacks(): target event 0
Debug: arm7_9_common.c:781 arm7_9_halt(): target->state: halted
Warning: arm7_9_common.c:785 arm7_9_halt(): target was already halted
Debug: gdb_server.c:124 gdb_get_char(): received ‘+$Hc-1#09’
Info: server.c:67 add_connection(): accepted ‘gdb’ connection from 0
Debug: gdb_server.c:239 gdb_get_packet(): character: ‘$’
Debug: gdb_server.c:1011 gdb_input(): recevied packet: ‘Hc-1’
Debug: gdb_server.c:177 gdb_put_packet(): sending packet ‘$#00’
Debug: gdb_server.c:124 gdb_get_char(): received ‘+’
Debug: gdb_server.c:124 gdb_get_char(): received ‘$qC#b4’
Debug: gdb_server.c:239 gdb_get_packet(): character: ‘$’
Debug: gdb_server.c:1011 gdb_input(): recevied packet: ‘qC’
Debug: gdb_server.c:177 gdb_put_packet(): sending packet ‘$#00’
Debug: gdb_server.c:124 gdb_get_char(): received ‘+$qOffsets#4b’
Debug: gdb_server.c:239 gdb_get_packet(): character: ‘$’
Debug: gdb_server.c:1011 gdb_input(): recevied packet: ‘qOffsets’
Debug: gdb_server.c:177 gdb_put_packet(): sending packet ‘$#00’
Debug: gdb_server.c:124 gdb_get_char(): received ‘+’
Debug: gdb_server.c:124 gdb_get_char(): received ‘$?#3f’
Debug: gdb_server.c:239 gdb_get_packet(): character: ‘$’
Debug: gdb_server.c:1011 gdb_input(): recevied packet: ‘?’
Debug: gdb_server.c:177 gdb_put_packet(): sending packet ‘$S02#b5’
Debug: gdb_server.c:124 gdb_get_char(): received ‘+’
Debug: gdb_server.c:124 gdb_get_char(): received ‘$Hg0#df’
Debug: gdb_server.c:239 gdb_get_packet(): character: ‘$’
Debug: gdb_server.c:1011 gdb_input(): recevied packet: ‘Hg0’
Debug: gdb_server.c:177 gdb_put_packet(): sending packet ‘$#00’
Debug: gdb_server.c:124 gdb_get_char(): received ‘+’
Debug: gdb_server.c:124 gdb_get_char(): received ‘$pf#d6’
Debug: gdb_server.c:239 gdb_get_packet(): character: ‘$’
Debug: gdb_server.c:1011 gdb_input(): recevied packet: ‘pf’
Debug: gdb_server.c:589 gdb_get_register_packet():
Debug: gdb_server.c:177 gdb_put_packet(): sending packet ‘$4c030000#ba’
Debug: gdb_server.c:124 gdb_get_char(): received ‘+’
Debug: gdb_server.c:124 gdb_get_char(): received ‘$m34c,4#97’
Debug: gdb_server.c:239 gdb_get_packet(): character: ‘$’
Debug: gdb_server.c:1011 gdb_input(): recevied packet: ‘m34c,4’
Debug: gdb_server.c:691 gdb_read_memory_packet(): addr: 0x0000034c, len: 0x00000004
Debug: arm7_9_common.c:1634 arm7_9_read_memory(): address: 0x0000034c, size: 0x00000004, count: 0x00000001
Debug: embeddedice.c:156 embeddedice_read_reg_w_check(): 1
Debug: gdb_server.c:177 gdb_put_packet(): sending packet ‘$feffffea#29’
Debug: gdb_server.c:124 gdb_get_char(): received ‘+’
Debug: gdb_server.c:124 gdb_get_char(): received ‘$qSymbol::#5b’
Debug: gdb_server.c:239 gdb_get_packet(): character: ‘$’
Debug: gdb_server.c:1011 gdb_input(): recevied packet: ‘qSymbol::’
Debug: gdb_server.c:177 gdb_put_packet(): sending packet ‘$#00’
Debug: gdb_server.c:124 gdb_get_char(): received ‘+’
Debug: gdb_server.c:124 gdb_get_char(): received ‘$qRcmd,736f66745f72657365745f68616c74#23’
Debug: gdb_server.c:239 gdb_get_packet(): character: ‘$’
Debug: gdb_server.c:1011 gdb_input(): recevied packet: ‘qRcmd,736f66745f72657365745f68616c74’
Debug: gdb_server.c:177 gdb_put_packet(): sending packet ‘$O72657175657374696e67207461726765742068616c7420616e6420657865637574696e67206120736f66742072657365740a#04’
Debug: gdb_server.c:124 gdb_get_char(): received ‘+’
Debug: target.c:442 target_call_event_callbacks(): target event 0
Debug: gdb_server.c:177 gdb_put_packet(): sending packet ‘$OK#9a’
Debug: gdb_server.c:124 gdb_get_char(): received ‘+’
Debug: gdb_server.c:124 gdb_get_char(): received ‘$qRcmd,61726d375f3920666f7263655f68775f626b70747320656e61626c65#2e’
Debug: gdb_server.c:239 gdb_get_packet(): character: ‘$’
Debug: gdb_server.c:1011 gdb_input(): recevied packet: ‘qRcmd,61726d375f3920666f7263655f68775f626b70747320656e61626c65’
Debug: gdb_server.c:177 gdb_put_packet(): sending packet ‘$O666f72636520686172647761726520627265616b706f696e747320656e61626c65640a#fc’
Debug: gdb_server.c:124 gdb_get_char(): received ‘+’
Debug: gdb_server.c:177 gdb_put_packet(): sending packet ‘$OK#9a’
Debug: gdb_server.c:124 gdb_get_char(): received ‘+’
Debug: gdb_server.c:124 gdb_get_char(): received ‘$Z1,2cc,4#0f’
Debug: gdb_server.c:239 gdb_get_packet(): character: ‘$’
Debug: gdb_server.c:1011 gdb_input(): recevied packet: ‘Z1,2cc,4’
Debug: gdb_server.c:887 gdb_breakpoint_watchpoint_packet():
Debug: breakpoints.c:87 breakpoint_add(): added hardware breakpoint at 0x000002cc of length 0x00000004
Debug: gdb_server.c:177 gdb_put_packet(): sending packet ‘$OK#9a’
Debug: gdb_server.c:124 gdb_get_char(): received ‘+$vCont?#49’
Debug: gdb_server.c:239 gdb_get_packet(): character: ‘$’
Debug: gdb_server.c:1011 gdb_input(): recevied packet: ‘vCont?’
Debug: gdb_server.c:1066 gdb_input(): ignoring 0x76 packet
Debug: gdb_server.c:177 gdb_put_packet(): sending packet ‘$#00’
Debug: gdb_server.c:124 gdb_get_char(): received ‘+’
Debug: gdb_server.c:124 gdb_get_char(): received ‘$Hc0#db’
Debug: gdb_server.c:239 gdb_get_packet(): character: ‘$’
Debug: gdb_server.c:1011 gdb_input(): recevied packet: ‘Hc0’
Debug: gdb_server.c:177 gdb_put_packet(): sending packet ‘$#00’
Debug: gdb_server.c:124 gdb_get_char(): received ‘+$c#63’
Debug: gdb_server.c:239 gdb_get_packet(): character: ‘$’
Debug: gdb_server.c:1011 gdb_input(): recevied packet: ‘c’
Debug: gdb_server.c:852 gdb_step_continue_packet():
Debug: gdb_server.c:867 gdb_step_continue_packet(): continue
Debug: arm7_9_common.c:1294 arm7_9_resume():
Debug: embeddedice.c:252 embeddedice_write_reg(): 8: 0x000002cc
Debug: embeddedice.c:252 embeddedice_write_reg(): 9: 0x00000003
Debug: embeddedice.c:252 embeddedice_write_reg(): 11: 0xffffffff
Debug: embeddedice.c:252 embeddedice_write_reg(): 13: 0x000000f7
Debug: embeddedice.c:252 embeddedice_write_reg(): 12: 0x00000100
Debug: arm7_9_common.c:1095 arm7_9_restore_context():
Debug: arm7_9_common.c:1111 arm7_9_restore_context(): examining User mode
Debug: arm7_9_common.c:1125 arm7_9_restore_context(): examining dirty reg: r0
Debug: arm7_9_common.c:1125 arm7_9_restore_context(): examining dirty reg: r1
Debug: arm7_9_common.c:1125 arm7_9_restore_context(): examining dirty reg: r2
Debug: arm7_9_common.c:1125 arm7_9_restore_context(): examining dirty reg: r3
Debug: arm7_9_common.c:1125 arm7_9_restore_context(): examining dirty reg: r4
Debug: arm7_9_common.c:1125 arm7_9_restore_context(): examining dirty reg: r5
Debug: arm7_9_common.c:1125 arm7_9_restore_context(): examining dirty reg: r6
Debug: arm7_9_common.c:1125 arm7_9_restore_context(): examining dirty reg: r7
Debug: arm7_9_common.c:1125 arm7_9_restore_context(): examining dirty reg: r8
Debug: arm7_9_common.c:1125 arm7_9_restore_context(): examining dirty reg: r9
Debug: arm7_9_common.c:1125 arm7_9_restore_context(): examining dirty reg: r10
Debug: arm7_9_common.c:1125 arm7_9_restore_context(): examining dirty reg: r11
Debug: arm7_9_common.c:1125 arm7_9_restore_context(): examining dirty reg: r12
Debug: arm7_9_common.c:1125 arm7_9_restore_context(): examining dirty reg: pc
Debug: arm7_9_common.c:1125 arm7_9_restore_context(): examining dirty reg: cpsr
Debug: arm7_9_common.c:1173 arm7_9_restore_context(): writing register 0 of mode User with value 0xffffffff
Debug: arm7_9_common.c:1173 arm7_9_restore_context(): writing register 1 of mode User with value 0xffffffff
Debug: arm7_9_common.c:1173 arm7_9_restore_context(): writing register 2 of mode User with value 0xffffffff
Debug: arm7_9_common.c:1173 arm7_9_restore_context(): writing register 3 of mode User with value 0xffffffff
Debug: arm7_9_common.c:1173 arm7_9_restore_context(): writing register 4 of mode User with value 0xffffffff
Debug: arm7_9_common.c:1173 arm7_9_restore_context(): writing register 5 of mode User with value 0xffffffff
Debug: arm7_9_common.c:1173 arm7_9_restore_context(): writing register 6 of mode User with value 0xffffffff
Debug: arm7_9_common.c:1173 arm7_9_restore_context(): writing register 7 of mode User with value 0xffffffff
Debug: arm7_9_common.c:1173 arm7_9_restore_context(): writing register 8 of mode User with value 0xffffffff
Debug: arm7_9_common.c:1173 arm7_9_restore_context(): writing register 9 of mode User with value 0xffffffff
Debug: arm7_9_common.c:1173 arm7_9_restore_context(): writing register 10 of mode User with value 0xffffffff
Debug: arm7_9_common.c:1173 arm7_9_restore_context(): writing register 11 of mode User with value 0xffffffff
Debug: arm7_9_common.c:1173 arm7_9_restore_context(): writing register 12 of mode User with value 0xffffffff
Debug: arm7_9_common.c:1111 arm7_9_restore_context(): examining FIQ mode
Debug: arm7_9_common.c:1125 arm7_9_restore_context(): examining dirty reg: pc
Debug: arm7_9_common.c:1111 arm7_9_restore_context(): examining IRQ mode
Debug: arm7_9_common.c:1125 arm7_9_restore_context(): examining dirty reg: pc
Debug: arm7_9_common.c:1111 arm7_9_restore_context(): examining Supervisor mode
Debug: arm7_9_common.c:1125 arm7_9_restore_context(): examining dirty reg: r13_svc
Debug: arm7_9_common.c:1125 arm7_9_restore_context(): examining dirty reg: lr_svc
Debug: arm7_9_common.c:1125 arm7_9_restore_context(): examining dirty reg: pc
Debug: arm7_9_common.c:1173 arm7_9_restore_context(): writing register 13 of mode Supervisor with value 0xffffffff
Debug: arm7_9_common.c:1173 arm7_9_restore_context(): writing register 14 of mode Supervisor with value 0xffffffff
Debug: arm7_9_common.c:1111 arm7_9_restore_context(): examining Abort mode
Debug: arm7_9_common.c:1125 arm7_9_restore_context(): examining dirty reg: pc
Debug: arm7_9_common.c:1111 arm7_9_restore_context(): examining Undefined mode
Debug: arm7_9_common.c:1125 arm7_9_restore_context(): examining dirty reg: pc
Debug: arm7_9_common.c:1205 arm7_9_restore_context(): writing cpsr with value 0x600000d3
Debug: arm7tdmi.c:475 arm7tdmi_write_xpsr(): xpsr: 600000d3, spsr: 0
Debug: arm7_9_common.c:1212 arm7_9_restore_context(): writing PC with value 0x00000000
Debug: embeddedice.c:252 embeddedice_write_reg(): 0: 0x00000000
Debug: target.c:442 target_call_event_callbacks(): target event 1
Debug: arm7_9_common.c:1397 arm7_9_resume(): target resumed
Debug: embeddedice.c:156 embeddedice_read_reg_w_check(): 1
Debug: embeddedice.c:156 embeddedice_read_reg_w_check(): 1
Debug: embeddedice.c:156 embeddedice_read_reg_w_check(): 1
Debug: embeddedice.c:156 embeddedice_read_reg_w_check(): 1
and so on… at this point I have to kill openOCD