diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2015-08-24 15:12:10 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2015-08-24 15:16:28 -0400 |
commit | 766f41781dcfe0a5b54d5cd368573655439df74a (patch) | |
tree | 7f010ff2b4e8268b53e670f354c8628c2e5318f4 | |
parent | 2fc20dc42cf4a3131fb65c12b2825cd5daa91e7e (diff) | |
download | seabios-766f41781dcfe0a5b54d5cd368573655439df74a.zip seabios-766f41781dcfe0a5b54d5cd368573655439df74a.tar.gz seabios-766f41781dcfe0a5b54d5cd368573655439df74a.tar.bz2 |
docs: Don't use an add-symbol-file offset when describing gdb debugging
Recent versions of gdb will only add an offset to the '.text' section
of object files via the add-symbol-file command. The SeaBIOS build
doesn't place code directly in a '.text' section, so update the
documentation to obtain the same result via an 'objcopy' call instead.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r-- | docs/Debugging.md | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/docs/Debugging.md b/docs/Debugging.md index 4aaf472..7ab5d02 100644 --- a/docs/Debugging.md +++ b/docs/Debugging.md @@ -86,22 +86,23 @@ bios 16bit code) or out/rom.o (to debug bios 32bit code). For example: `gdb out/rom16.o` -Once in gdb, use the command "target remote localhost:1234" to have +Once in gdb, use the command `target remote localhost:1234` to have gdb connect to QEMU. See the QEMU documentation for more information on using gdb and QEMU in this mode. -When debugging 16bit code, also run the following commands in gdb: +When debugging 16bit code it is necessary to load the 16bit symbols +twice in order for gdb to properly handle break points. To do this, +run the following command `objcopy --adjust-vma 0xf0000 out/rom16.o +rom16offset.o` and then run the following in gdb: ``` set architecture i8086 -add-symbol-file out/rom16.o 0xf0000 +add-symbol-file rom16offset.o 0 ``` -The second command loads the 16bit symbols a second time at an offset -of 0xf0000, which helps gdb set and catch breakpoints correctly. - -To debug a VGA BIOS image, run "gdb out/vgarom.o" add use the gdb -command "add-symbol-file out/vgarom.o 0xc0000" to load the 16bit VGA +To debug a VGA BIOS image, run `gdb out/vgarom.o`, create a +vgaromoffset.o file with offset 0xc0000, add use the gdb +command `add-symbol-file out/vgaromoffset.o 0` to load the 16bit VGA BIOS symbols twice. If debugging the 32bit SeaBIOS initialization code with gdb, note that |