I’m currently running a
64-bit linux kernel and am trying to connect to a 32-bit guest domain through
xen, but I keep getting an issue where gdbserver seems to be sign extending a
32bit address into a 64bit one.
(gdb) bt
#0
0x00002b7ee48a6b03 in map_domain_va (xc_handle=6, cpu=0,
guest_va=0xffffffff80107000, perm=1) at xc_ptrace.c:384
#1
0x00002b7ee48a6f79 in xc_ptrace (xc_handle=6, request=PTRACE_PEEKTEXT,
domid_tid=0, eaddr=-2146406400, edata=0)
at
xc_ptrace.c:484
#2
0x0000000000405567 in linux_read_memory (memaddr=-2146406400,
myaddr=0x7fffffbc22e0 "", len=Variable "len" is not
available.
)
at
../../../gdb-6.2.1/gdb/gdbserver/linux-xen-low.c:406
#3
0x000000000040437a in read_inferior_memory (memaddr=-2146406400,
myaddr=0x7fffffbc22e0 "", len=1)
at
../../../gdb-6.2.1/gdb/gdbserver/target.c:64
#4
0x0000000000403a4f in main (argc=4, argv=0x7fffffbc2bb8) at
../../../gdb-6.2.1/gdb/gdbserver/server.c:520
(gdb) f 0
#0 0x00002b7ee48a6b03
in map_domain_va (xc_handle=6, cpu=0, guest_va=0xffffffff80107000, perm=1) at
xc_ptrace.c:384
384
page = page_array[va >> PAGE_SHIFT] << PAGE_SHIFT;
(gdb) list
379
unsigned long page;
380
381
if ( v != NULL )
382
munmap(v, PAGE_SIZE);
383
384
page = page_array[va >> PAGE_SHIFT] << PAGE_SHIFT;
385
386
v = xc_map_foreign_range( xc_handle, current_domid, PAGE_SIZE,
387
perm, page >> PAGE_SHIFT);
388
(gdb) p va
$1 = 18446744071563145216
(gdb) p/x va
$2 = 0xffffffff80107000
How are people debugging
32-bit domains from 64bit dom0?