Skip to content

Commit

Permalink
update README for amd64
Browse files Browse the repository at this point in the history
  • Loading branch information
uuyych committed Mar 19, 2013
1 parent 997f819 commit df2a870
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
22 changes: 22 additions & 0 deletions README.amd64
Expand Up @@ -27,3 +27,25 @@ run
OR
qemu-system-x86_64 -m 512 -hda obj/kernel.img -drive file=obj/sfs.img,media=disk,cache=writeback,index=2 -s -serial file:obj/serial.log -monitor stdio

------------------
debug
------------------
* qemu+gdb

qemu and gdb do not properly handle mode-switching between 32- and
64-bit code: once gdb connects in 32-bit mode, it will not switch to
64-bit mode. Thus, debugging 64-bit code requires attaching gdb after
qemu is already executing 64-bit code. Do not use -S, since that will
attach in 16-/32-bit mode.

//In a terminal..
$ uCore_run -d obj

//In a different terminal
$ cp gdbinit.amd64 .gdbinit
$ gdb
...
The target architecture is assumed to be i386:x86-64
0xffffffffc011b5fc in ?? ()
(gdb) continue

4 changes: 3 additions & 1 deletion ucore/gdbinit.amd64
@@ -1,5 +1,7 @@
target remote :1234
set architecture i386:x86-64:intel
target remote :1234
symbol-file obj/kernel/kernel-amd64.elf
define hook-stop
x/i $pc
end
br __panic

0 comments on commit df2a870

Please sign in to comment.