Download Wasabi® Software Development Tools User`s Guide for Intel XScale
Transcript
Debugging with GDB Debug with the Built-in Instruction Set Simulator GDB can be used to debug executables with the built-in Instruction Set Simulator, which does not require access to any hardware. In the following sample debugging session, we use the target sim command to specify the Instruction Set Simulator as the target. C:\> xscale-elf-gdb hello GNU gdb 2003-08-25-cvs Copyright 2003 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=i386-pc-cygwin --target=xscale-elf"... (gdb) target sim Connected to the simulator. (gdb) load Loading section .init, size 0x1c vma 0x8000 Loading section .text, size 0x926c vma 0x801c Loading section .fini, size 0x18 vma 0x11288 Loading section .rodata, size 0x354 vma 0x112a0 Loading section .data, size 0x8c0 vma 0x11710 Loading section .eh_frame, size 0x4 vma 0x11fd0 Loading section .ctors, size 0x8 vma 0x11fd4 Loading section .dtors, size 0x8 vma 0x11fdc Loading section .jcr, size 0x4 vma 0x11fe4 Start address 0x8120 Transfer rate: 325216 bits in <1 sec. (gdb) break main Breakpoint 1 at 0x82a0: file hello.c, line 15. (gdb) run Starting program: C:\hello Breakpoint 1, main () at hello.c:15 15 a = 3; (gdb) print a $1 = 0 (gdb) step 16 b = 4; (gdb) print a $2 = 3 (gdb) list Wasabi Software Development Tools User’s Guide ■ 21