diff -r 7422afed66ee tools/debugger/gdb/gdb-6.8.diff --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tools/debugger/gdb/gdb-6.8.diff Fri Sep 11 22:49:27 2009 -0700 @@ -0,0 +1,297 @@ +diff -ur a/gdb-6.8/gdb/gdbserver/configure.ac b/gdb-6.8/gdb/gdbserver/configure.ac +--- a/gdb-6.8/gdb/gdbserver/configure.ac 2008-01-31 16:08:25.000000000 -0800 ++++ b/gdb-6.8/gdb/gdbserver/configure.ac 2008-10-03 02:16:38.000000000 -0700 +@@ -215,7 +215,7 @@ + fi + + GDBSERVER_DEPFILES="$srv_regobj $srv_tgtobj $srv_hostio_err_objs $srv_thread_depfiles" +-GDBSERVER_LIBS="$srv_libs" ++GDBSERVER_LIBS="$srv_libs -L../../../../../libxc/ -lxenctrl" + + AC_SUBST(GDBSERVER_DEPFILES) + AC_SUBST(GDBSERVER_LIBS) +diff -ur a/gdb-6.8/gdb/gdbserver/linux-low.c b/gdb-6.8/gdb/gdbserver/linux-low.c +--- a/gdb-6.8/gdb/gdbserver/linux-low.c 2008-10-06 08:29:51.000000000 -0700 ++++ b/gdb-6.8/gdb/gdbserver/linux-low.c 2008-10-06 08:29:58.000000000 -0700 +@@ -131,9 +131,124 @@ + + #define pid_of(proc) ((proc)->head.id) + ++#ifdef XEN ++#include ++ ++#undef HAVE_LINUX_USRREGS ++#ifndef USE_THREAD_DB ++#define USE_THREAD_DB 1 ++#endif ++ ++#define linux_test_for_tracefork() ++ ++static unsigned long ++thread_stop_callback(unsigned long vcpuid) ++{ ++ ++ printf("-----------------hit stop on %ld-----------------------------\n", vcpuid); ++ /* ++ * single threaded - nothing to do ++ */ ++ if (all_threads.head == all_threads.tail) ++ return 0; ++ ++ current_inferior = (struct thread_info *) ++ find_inferior_id (&all_threads, vcpuid + 1); ++ get_thread_process(current_inferior)->lwpid = vcpuid + 1; ++ return 0; ++} ++ ++static unsigned long ++thread_create_callback(unsigned long vcpuid) ++{ ++ struct thread_info *inferior; ++ struct process_info *process = NULL; ++ long tid = vcpuid + 1; ++ ++ /* If we are attaching to our first thread, things are a little ++ * different. ++ */ ++ if (all_threads.head == all_threads.tail) { ++ inferior = (struct thread_info *) all_threads.head; ++ process = get_thread_process (inferior); ++ process->thread_known = 1; ++ ++ if (tid == thread_to_gdb_id(inferior)) ++ goto found; ++ } ++ if (debug_threads) ++ fprintf (stderr, "looking up thread %ld\n", ++ tid); ++ inferior = (struct thread_info *) find_inferior_id (&all_threads, ++ tid); ++ /* if vcpu alread registered - do nothing */ ++ if (inferior != NULL) ++ return 0; ++ ++ if (debug_threads) ++ fprintf (stderr, "Attaching to thread %ld\n", ++ tid); ++ ++ add_thread(tid, process, tid); ++ inferior = (struct thread_info *) find_inferior_id (&all_threads, ++ tid); ++ if (inferior == NULL) ++ { ++ warning ("Could not attach to thread %ld\n", ++ tid); ++ return 0; ++ } ++ ++ ++found: ++ if (debug_threads) ++ fprintf (stderr, "notifying of new thread %ld\n", ++ tid); ++ new_thread_notify (tid); ++ return 0; ++} ++ ++static unsigned long ++thread_death_callback(unsigned long vcpuid) ++{ ++ if (debug_threads) ++ fprintf (stderr, "Buuurp...! CPU down event.\n"); ++ ++ return 0; ++} ++ ++static unsigned long ++thread_id_translate(unsigned long tid) ++{ ++ ++ return tid - 1; ++} ++ ++static int ++xc_thread_db_init(int unused) ++{ ++ debug_threads = 1; ++ xc_register_event_handler(thread_create_callback, TD_CREATE); ++ xc_register_event_handler(thread_death_callback, TD_DEATH); ++ xc_register_event_handler(thread_stop_callback, TD_CATCHSIG); ++ xc_register_threadid_translate(thread_id_translate); ++ return 1; ++} ++ ++#define my_waitpid xc_waitdomain ++#define waitpid xc_waitdomain ++#define thread_db_init xc_thread_db_init ++#define ptrace xc_ptrace ++ ++#define inferior_pid ((unsigned long)thread_to_gdb_id(current_inferior)) ++ ++#else ++ + /* FIXME: Delete eventually. */ + #define inferior_pid (pid_of (get_thread_process (current_inferior))) + ++#endif ++ + static void + handle_extended_wait (struct process_info *event_child, int wstat) + { +@@ -246,8 +361,12 @@ + memset (process, 0, sizeof (*process)); + + process->head.id = pid; ++#ifdef XEN ++ process->lwpid = 1; ++#else + process->lwpid = pid; + ++#endif + add_inferior_to_list (&all_processes, &process->head); + + return process; +@@ -321,7 +440,11 @@ + ptrace (PTRACE_SETOPTIONS, pid, 0, PTRACE_O_TRACECLONE); + + new_process = (struct process_info *) add_process (pid); ++#ifdef XEN ++ add_thread (1, new_process, 1); ++#else + add_thread (pid, new_process, pid); ++#endif + new_thread_notify (thread_id_to_gdb_id (new_process->lwpid)); + + /* The next time we wait for this LWP we'll see a SIGSTOP as PTRACE_ATTACH +@@ -464,9 +587,15 @@ + static int + linux_thread_alive (unsigned long lwpid) + { +- if (find_inferior_id (&all_threads, lwpid) != NULL) ++ struct thread_info *ti; ++ ++ if ((ti = (struct thread_info *)find_inferior_id (&all_threads, lwpid)) != NULL) { ++#ifdef XEN ++ current_inferior = ti; ++ get_thread_process(current_inferior)->lwpid = lwpid; ++#endif + return 1; +- else ++ } else + return 0; + } + +@@ -561,8 +690,13 @@ + int ret; + int to_wait_for = -1; + ++#ifdef XEN ++ if (*childp != NULL) ++ to_wait_for = (*childp)->head.id; ++#else + if (*childp != NULL) + to_wait_for = (*childp)->lwpid; ++#endif + + retry: + while (1) +@@ -1194,7 +1328,12 @@ + + thread = (struct thread_info *) entry; + process = get_thread_process (thread); +- ++#ifdef XEN ++ if (entry->id == thread_to_gdb_id(current_inferior)) ++ resume_ptr[0].thread = entry->id; ++ else ++ return; ++#endif + ndx = 0; + while (resume_ptr[ndx].thread != -1 && resume_ptr[ndx].thread != entry->id) + ndx++; +@@ -1218,7 +1357,11 @@ + thread = (struct thread_info *) entry; + process = get_thread_process (thread); + +- if (process->resume->leave_stopped) ++ if ((process->resume == NULL) || (process->resume->leave_stopped) || ++#ifdef XEN ++ (process->resume->thread != entry->id) ++#endif ++ ) + return; + + if (process->resume->thread == -1) +@@ -1747,6 +1890,7 @@ + + /* Helper functions for linux_test_for_tracefork, called via clone (). */ + ++#ifndef XEN + static int + linux_tracefork_grandchild (void *arg) + { +@@ -1876,6 +2020,7 @@ + free (stack); + } + ++#endif /* XEN */ + + static void + linux_look_up_symbols (void) +diff -ur a/gdb-6.8/gdb/gdbserver/Makefile.in b/gdb-6.8/gdb/gdbserver/Makefile.in +--- a/gdb-6.8/gdb/gdbserver/Makefile.in 2008-02-11 14:00:31.000000000 -0800 ++++ b/gdb-6.8/gdb/gdbserver/Makefile.in 2008-10-03 02:16:38.000000000 -0700 +@@ -100,7 +100,7 @@ + + # INTERNAL_CFLAGS is the aggregate of all other *CFLAGS macros. + INTERNAL_CFLAGS = $(WARN_CFLAGS) ${CFLAGS} ${GLOBAL_CFLAGS} \ +- ${PROFILE_CFLAGS} ${INCLUDE_CFLAGS} ${BFD_CFLAGS} ++ ${PROFILE_CFLAGS} ${INCLUDE_CFLAGS} ${BFD_CFLAGS} -DXEN + + # LDFLAGS is specifically reserved for setting from the command line + # when running make. +@@ -158,7 +158,7 @@ + .c.o: + ${CC} -c ${INTERNAL_CFLAGS} $< + +-all: gdbserver$(EXEEXT) gdbreplay$(EXEEXT) ++all: gdbserver-xen$(EXEEXT) gdbreplay$(EXEEXT) + + # Traditionally "install" depends on "all". But it may be useful + # not to; for example, if the user has made some trivial change to a +@@ -188,10 +188,10 @@ + install-html: + clean-info: + +-gdbserver$(EXEEXT): $(OBS) ${ADD_DEPS} ${CDEPS} +- rm -f gdbserver$(EXEEXT) +- ${CC-LD} $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) -o gdbserver$(EXEEXT) $(OBS) \ +- $(GDBSERVER_LIBS) $(XM_CLIBS) ++gdbserver-xen$(EXEEXT): $(OBS) ${ADD_DEPS} ${CDEPS} ++ rm -f gdbserver-xen$(EXEEXT) ++ ${CC-LD} $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) -o gdbserver-xen$(EXEEXT) $(OBS) \ ++ $(GDBSERVER_LIBS) $(XM_CLIBS) -lxenctrl + + gdbreplay$(EXEEXT): gdbreplay.o + rm -f gdbreplay$(EXEEXT) +@@ -216,7 +216,7 @@ + clean: + rm -f *.o ${ADD_FILES} *~ + rm -f version.c +- rm -f gdbserver$(EXEEXT) gdbreplay$(EXEEXT) core make.log ++ rm -f gdbserver-xen$(EXEEXT) gdbreplay$(EXEEXT) core make.log + rm -f reg-arm.c reg-i386.c reg-ia64.c reg-m32r.c reg-m68k.c + rm -f reg-ppc.c reg-sh.c reg-spu.c reg-x86-64.c reg-i386-linux.c + rm -f reg-cris.c reg-crisv32.c reg-x86-64-linux.c reg-xtensa.c +Only in b/gdb-6.8/gdb: observer.h +Only in b/gdb-6.8/gdb: observer.inc +Only in b/gdb-6.8/gdb: stamp-int +diff -ur a/gdb-6.8/libdecnumber/gstdint.h b/gdb-6.8/libdecnumber/gstdint.h +--- a/gdb-6.8/libdecnumber/gstdint.h 2008-03-27 11:25:08.000000000 -0700 ++++ b/gdb-6.8/libdecnumber/gstdint.h 2008-10-03 02:17:05.000000000 -0700 +@@ -1,4 +1,4 @@ +-/* generated for gcc (GCC) 3.4.6 20060404 (Red Hat 3.4.6-9) */ ++/* generated for gcc (GCC) 4.1.2 20071124 (Red Hat 4.1.2-42) */ + + #ifndef GCC_GENERATED_STDINT_H + #define GCC_GENERATED_STDINT_H 1 diff -r 7422afed66ee tools/debugger/gdb/gdbbuild --- a/tools/debugger/gdb/gdbbuild Mon Sep 07 08:53:07 2009 +0100 +++ b/tools/debugger/gdb/gdbbuild Fri Sep 11 22:49:27 2009 -0700 @@ -2,7 +2,7 @@ set -e -GDB_VERSION=6.2.1 +GDB_VERSION=6.8 [ "$GDB_MIRROR" ] || GDB_MIRROR="ftp://ftp.gnu.org/gnu/gdb/" @@ -10,10 +10,8 @@ [ -a gdb-$GDB_VERSION.tar.bz2 ] || wget -c "$GDB_MIRROR/gdb-$GDB_VERSION.tar.bz2" tar xjf gdb-$GDB_VERSION.tar.bz2 -cd gdb-$GDB_VERSION-xen-sparse -bash ./mkbuildtree ../gdb-$GDB_VERSION +patch -p1 < gdb-${GDB_VERSION}.diff -cd .. mkdir gdb-$GDB_VERSION-linux-i386-xen cd gdb-$GDB_VERSION-linux-i386-xen ../gdb-$GDB_VERSION/configure diff -r 7422afed66ee tools/libxc/xc_ptrace.c --- a/tools/libxc/xc_ptrace.c Mon Sep 07 08:53:07 2009 +0100 +++ b/tools/libxc/xc_ptrace.c Fri Sep 11 22:49:27 2009 -0700 @@ -1,6 +1,16 @@ +/****************************************************************************** + * xc_ptrace.c + * + * API for emulating ptrace and waitpid + * + * Copyright (c) 2004,2008 Kip Macy + * Public Domain + */ + #include #include #include +#define USE_LOCAL_XC_PTRACE #include "xc_private.h" #include "xg_private.h" @@ -36,10 +46,17 @@ }; #endif +long xc_ptrace(enum __ptrace_request request, pid_t domid_tid, + unsigned long eaddr, unsigned long edata); +static void online_vcpus_changed(uint64_t cpumap); + static int current_domid = -1; static int current_isfile; static int current_is_hvm; - +static int xc_handle; +static int last_signal; +static int running; + static uint64_t online_cpumap; static uint64_t regs_valid; static vcpu_guest_context_any_t ctxt[MAX_VIRT_CPUS]; @@ -47,7 +64,7 @@ #define FOREACH_CPU(cpumap, i) for ( cpumap = online_cpumap; (i = xc_ffs64(cpumap)); cpumap &= ~(1 << (index - 1)) ) static int -fetch_regs(int xc_handle, int cpu, int *online) +fetch_regs(int cpu, int *online) { xc_vcpuinfo_t info; int retval = 0; @@ -61,7 +78,6 @@ if ( retval ) goto done; regs_valid |= (1 << cpu); - } if ( online == NULL ) goto done; @@ -76,22 +92,44 @@ static struct thr_ev_handlers { thr_ev_handler_t td_create; thr_ev_handler_t td_death; + thr_ev_handler_t td_catchsig; + thr_ev_handler_t td_translate; } handlers; void xc_register_event_handler(thr_ev_handler_t h, td_event_e e) { + thr_ev_handler_t curh; + uint64_t cpumap = online_cpumap; + switch (e) { case TD_CREATE: + curh = handlers.td_create; handlers.td_create = h; + /* + * Register any running vcpus + */ + if (curh == NULL) { + online_cpumap = 0; + online_vcpus_changed(cpumap); + } break; case TD_DEATH: handlers.td_death = h; break; + case TD_CATCHSIG: + handlers.td_catchsig = h; + break; default: abort(); /* XXX */ } +} + +void +xc_register_threadid_translate(thr_ev_handler_t h) +{ + handlers.td_translate = h; } static inline int @@ -108,14 +146,14 @@ */ static int -get_online_cpumap(int xc_handle, struct xen_domctl_getdomaininfo *d, +get_online_cpumap(struct xen_domctl_getdomaininfo *d, uint64_t *cpumap) { int i, online; *cpumap = 0; for (i = 0; i <= d->max_vcpu_id; i++) { - fetch_regs(xc_handle, i, &online); + fetch_regs(i, &online); if (online) *cpumap |= (1 << i); } @@ -152,7 +190,6 @@ static void * map_domain_va( - int xc_handle, int cpu, void *guest_va, int perm) @@ -187,8 +224,7 @@ static int __xc_waitdomain( - int xc_handle, - int domain, + int idomain, int *status, int options) { @@ -196,9 +232,17 @@ int retval; struct timespec ts; uint64_t cpumap; + int domain; + domain = idomain;; + *status = 0; ts.tv_sec = 0; ts.tv_nsec = 10*1000*1000; + if (idomain == -1) + domain = current_domid; + + if (xc_handle == 0) + xc_handle = xc_interface_open(); domctl.cmd = XEN_DOMCTL_getdomaininfo; domctl.domain = domain; @@ -208,11 +252,10 @@ if ( retval || (domctl.domain != domain) ) { IPRINTF("getdomaininfo failed\n"); - goto done; + return -1; } - *status = domctl.u.getdomaininfo.flags; - - if ( options & WNOHANG ) + regs_valid = 0; + if ( options & WNOHANG ) goto done; if (control_c_pressed_flag) { @@ -221,39 +264,79 @@ goto done; } - if ( !(domctl.u.getdomaininfo.flags & XEN_DOMINF_paused) ) + if ( !(domctl.u.getdomaininfo.flags & (XEN_DOMINF_paused|XEN_DOMINF_dying)) ) { nanosleep(&ts,NULL); goto retry; - } + } done: - if (get_online_cpumap(xc_handle, &domctl.u.getdomaininfo, &cpumap)) + if (get_online_cpumap(&domctl.u.getdomaininfo, &cpumap)) IPRINTF("get_online_cpumap failed\n"); if (online_cpumap != cpumap) online_vcpus_changed(cpumap); - return retval; + if ( domctl.u.getdomaininfo.flags & (XEN_DOMINF_paused|XEN_DOMINF_dying)) { + *status = W_STOPCODE(last_signal); + + if ( running && handlers.td_catchsig ) { + int cpu, index; + long eip; + uint8_t *data; + + running = 0; + + printf("checking for stop reason\n"); + FOREACH_CPU(online_cpumap, index) { + cpu = index - 1; + + if (fetch_regs(cpu, NULL)) + continue; + if (ctxt[cpu].c.user_regs.eflags & PSL_T) { + handlers.td_catchsig(cpu); + ctxt[cpu].c.user_regs.eflags &= ~PSL_T; + xc_vcpu_setcontext(xc_handle, current_domid, cpu, &ctxt[cpu]); + + break; + } + eip = ctxt[cpu].c.user_regs.eip; + data = map_domain_va(cpu, (uint8_t *)(eip - 1), PROT_READ|PROT_WRITE); + if (*data == 0xcc) { + handlers.td_catchsig(cpu); + break; + } + } + } + return domain; + } + return 0; } - long xc_ptrace( - int xc_handle, enum __ptrace_request request, - uint32_t domid_tid, - long eaddr, - long edata) + pid_t domid_tid, + unsigned long eaddr, + unsigned long edata) { DECLARE_DOMCTL; - struct gdb_regs pt; long retval = 0; unsigned long *guest_va; - uint64_t cpumap; + uint64_t cpumap = 0; int cpu, index; - void *addr = (char *)eaddr; - void *data = (char *)edata; + unsigned long *addr, *data; - cpu = (request != PTRACE_ATTACH) ? domid_tid : 0; + addr = (unsigned long *)eaddr; + data = (unsigned long *)edata; + + if (request != PTRACE_ATTACH && (handlers.td_translate != NULL)) + cpu = handlers.td_translate(domid_tid); + else + cpu = 0; + + if (request <= PTRACE_SYSCALL ) + IPRINTF("xc_ptrace(%s, %d, %lx, %lx)\n", ptrace_names[request], domid_tid, eaddr, edata); + if (xc_handle == 0) + xc_handle = xc_interface_open(); switch ( request ) { @@ -264,7 +347,7 @@ current_domid, cpu, addr, ctxt); else guest_va = (unsigned long *)map_domain_va( - xc_handle, cpu, addr, PROT_READ); + cpu, addr, PROT_READ); if ( guest_va == NULL ) goto out_error; retval = *guest_va; @@ -280,7 +363,7 @@ current_domid, cpu, addr, ctxt); else guest_va = (unsigned long *)map_domain_va( - xc_handle, cpu, addr, PROT_READ|PROT_WRITE); + cpu, addr, PROT_READ|PROT_WRITE); if ( guest_va == NULL ) goto out_error; *guest_va = edata; @@ -289,20 +372,19 @@ break; case PTRACE_GETREGS: - if (!current_isfile && fetch_regs(xc_handle, cpu, NULL)) + if (!current_isfile && fetch_regs(cpu, NULL)) goto out_error; - SET_PT_REGS(pt, ctxt[cpu].c.user_regs); - memcpy(data, &pt, sizeof(struct gdb_regs)); + SET_PT_REGS(((struct gdb_regs *)data), ctxt[cpu].c.user_regs); break; case PTRACE_GETFPREGS: - if (!current_isfile && fetch_regs(xc_handle, cpu, NULL)) + if (!current_isfile && fetch_regs(cpu, NULL)) goto out_error; memcpy(data, &ctxt[cpu].c.fpu_ctxt, sizeof (elf_fpregset_t)); break; case PTRACE_GETFPXREGS: - if (!current_isfile && fetch_regs(xc_handle, cpu, NULL)) + if (!current_isfile && fetch_regs(cpu, NULL)) goto out_error; memcpy(data, &ctxt[cpu].c.fpu_ctxt, sizeof(ctxt[cpu].c.fpu_ctxt)); break; @@ -312,7 +394,7 @@ goto out_unsupported; /* XXX not yet supported */ SET_XC_REGS(((struct gdb_regs *)data), ctxt[cpu].c.user_regs); if ((retval = xc_vcpu_setcontext(xc_handle, current_domid, cpu, - &ctxt[cpu]))) + &ctxt[cpu]))) goto out_error_domctl; break; @@ -337,7 +419,6 @@ goto out_error_domctl; } /* FALLTHROUGH */ - case PTRACE_CONT: case PTRACE_DETACH: if (current_isfile) @@ -352,7 +433,7 @@ XEN_DOMCTL_DEBUG_OP_SINGLE_STEP_OFF, cpu) ) { - if (fetch_regs(xc_handle, cpu, NULL)) + if (fetch_regs(cpu, NULL)) goto out_error; /* Clear trace flag */ if ( ctxt[cpu].c.user_regs.eflags & PSL_T ) @@ -369,16 +450,20 @@ { if ((retval = xc_domain_setdebugging(xc_handle, current_domid, 0))) goto out_error_domctl; - } - regs_valid = 0; + } else + last_signal = SIGTRAP; + + printf("set running to 1\n"); + running = 1; if ((retval = xc_domain_unpause(xc_handle, current_domid > 0 ? current_domid : -current_domid))) goto out_error_domctl; break; case PTRACE_ATTACH: + last_signal = SIGSTOP; current_domid = domid_tid; - current_isfile = (int)edata; + current_isfile = (int)data; if (current_isfile) break; domctl.cmd = XEN_DOMCTL_getdomaininfo; @@ -386,24 +471,35 @@ retval = do_domctl(xc_handle, &domctl); if ( retval || (domctl.domain != current_domid) ) goto out_error_domctl; + if ( domctl.u.getdomaininfo.flags & XEN_DOMINF_paused ) IPRINTF("domain currently paused\n"); - else if ((retval = xc_domain_pause(xc_handle, current_domid))) - goto out_error_domctl; + else { + running = 1; + if ((retval = xc_domain_pause(xc_handle, current_domid))) + goto out_error_domctl; + } current_is_hvm = !!(domctl.u.getdomaininfo.flags&XEN_DOMINF_hvm_guest); if ((retval = xc_domain_setdebugging(xc_handle, current_domid, 1))) goto out_error_domctl; - if (get_online_cpumap(xc_handle, &domctl.u.getdomaininfo, &cpumap)) + if (get_online_cpumap(&domctl.u.getdomaininfo, &cpumap)) IPRINTF("get_online_cpumap failed\n"); if (online_cpumap != cpumap) online_vcpus_changed(cpumap); break; - + case PTRACE_SETFPREGS: + case PTRACE_SETFPXREGS: + IPRINTF("unsupported xc_ptrace request %s - silently ignoring\n", ptrace_names[request]); + retval = 0; + break; case PTRACE_TRACEME: IPRINTF("PTRACE_TRACEME is an invalid request under Xen\n"); goto out_error; - + case PTRACE_SETOPTIONS: + case PTRACE_GETEVENTMSG: + case PTRACE_GETSIGINFO: + case PTRACE_SETSIGINFO: default: goto out_unsupported; /* XXX not yet supported */ } @@ -418,7 +514,10 @@ out_unsupported: #ifdef DEBUG - IPRINTF("unsupported xc_ptrace request %s\n", ptrace_names[request]); + if (request <= PTRACE_SYSCALL ) { + IPRINTF("unsupported xc_ptrace request %s\n", ptrace_names[request]); + abort(); + } #endif errno = ENOSYS; return -1; @@ -427,14 +526,13 @@ int xc_waitdomain( - int xc_handle, int domain, int *status, int options) { if (current_isfile) return xc_waitdomain_core(xc_handle, domain, status, options, ctxt); - return __xc_waitdomain(xc_handle, domain, status, options); + return __xc_waitdomain(domain, status, options); } /* diff -r 7422afed66ee tools/libxc/xc_ptrace.h --- a/tools/libxc/xc_ptrace.h Mon Sep 07 08:53:07 2009 +0100 +++ b/tools/libxc/xc_ptrace.h Fri Sep 11 22:49:27 2009 -0700 @@ -118,22 +118,22 @@ #define SET_PT_REGS(pt, xc) \ { \ - pt.ebx = xc.ebx; \ - pt.ecx = xc.ecx; \ - pt.edx = xc.edx; \ - pt.esi = xc.esi; \ - pt.edi = xc.edi; \ - pt.ebp = xc.ebp; \ - pt.eax = xc.eax; \ - pt.eip = xc.eip; \ - pt.xcs = xc.cs; \ - pt.eflags = xc.eflags; \ - pt.esp = xc.esp; \ - pt.xss = xc.ss; \ - pt.xes = xc.es; \ - pt.xds = xc.ds; \ - pt.xfs = xc.fs; \ - pt.xgs = xc.gs; \ + pt->ebx = xc.ebx; \ + pt->ecx = xc.ecx; \ + pt->edx = xc.edx; \ + pt->esi = xc.esi; \ + pt->edi = xc.edi; \ + pt->ebp = xc.ebp; \ + pt->eax = xc.eax; \ + pt->eip = xc.eip; \ + pt->xcs = xc.cs; \ + pt->eflags = xc.eflags; \ + pt->esp = xc.esp; \ + pt->xss = xc.ss; \ + pt->xes = xc.es; \ + pt->xds = xc.ds; \ + pt->xfs = xc.fs; \ + pt->xgs = xc.gs; \ } #define SET_XC_REGS(pt, xc) \ diff -r 7422afed66ee tools/libxc/xenctrl.h --- a/tools/libxc/xenctrl.h Mon Sep 07 08:53:07 2009 +0100 +++ b/tools/libxc/xenctrl.h Fri Sep 11 22:49:27 2009 -0700 @@ -126,22 +126,22 @@ #include #include -typedef void (*thr_ev_handler_t)(long); +typedef unsigned long (*thr_ev_handler_t)(unsigned long); void xc_register_event_handler( thr_ev_handler_t h, td_event_e e); -long xc_ptrace( - int xc_handle, +void xc_register_threadid_translate(thr_ev_handler_t h); + +#ifndef USE_LOCAL_XC_PTRACE +long int xc_ptrace( enum __ptrace_request request, - uint32_t domid, - long addr, - long data); + ...); +#endif int xc_waitdomain( - int xc_handle, - int domain, + pid_t domain, int *status, int options);