File tree 1 file changed +24
-0
lines changed 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,30 @@ That's it! You can now debug the simulated AVR code using GDB. Here are some qui
32
32
- ` disas $pc, $pc+16 ` - Disassemble the next few instructions
33
33
- ` info registers ` - Dump all registers (r0-r31, SREG, SP, pc)
34
34
35
+ ## Debugging with Symbols
36
+
37
+ If you want source-level debugging (with symbols and everything), first
38
+ build an ELF file for your program locally (e.g. using the Arduino CLI).
39
+ Then, push it to the simulator using GDB's ` load ` command, and load the
40
+ symbols using the ` symbol-file ` command. Finally, set ` $pc ` to 0 and
41
+ start the program. Here's an example for such session:
42
+
43
+ ```
44
+ (gdb) target remote localhost:3555
45
+ Remote debugging using localhost:3555
46
+ 0x000001b6 in ?? ()
47
+ (gdb) load blink.ino.elf
48
+ Loading section .text, size 0x3a4 lma 0x0
49
+ Start address 0x0, load size 932
50
+ Transfer rate: 91 KB/sec, 932 bytes/write.
51
+ (gdb) symbol-file blink.ino.elf
52
+ Reading symbols from blink.ino.elf...done.
53
+ (gdb) set $pc=0
54
+ (gdb) stepi
55
+ 0x000000b8 in __init ()
56
+ (gdb)
57
+ ```
58
+
35
59
## License
36
60
37
61
Copyright (C) 2020 Uri Shaked. The code is released under the terms of the MIT license.
You can’t perform that action at this time.
0 commit comments