aboutsummaryrefslogtreecommitdiffstats
path: root/xen/include/asm-x86/debugger.h
diff options
context:
space:
mode:
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2005-06-04 13:07:05 +0000
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2005-06-04 13:07:05 +0000
commit7254a301ec076dc8ae0c2fb521b2854cbca6df81 (patch)
treeb0ba3b9801934501b368f59c55e06d0a3b5d647d /xen/include/asm-x86/debugger.h
parent87751a10c9c10226fb9c65a4c287fbacfa66e9ea (diff)
downloadxen-7254a301ec076dc8ae0c2fb521b2854cbca6df81.tar.gz
xen-7254a301ec076dc8ae0c2fb521b2854cbca6df81.tar.bz2
xen-7254a301ec076dc8ae0c2fb521b2854cbca6df81.zip
bitkeeper revision 1.1665.1.5 (42a1a779yqLZDCutMj_vFNQlo3q3zw)
Rationalise debugger stuff in the tree. Within Xen itself, remove PDB references and fold into domu_debug. When domu_debug hits a breakpoint, it pauses all vcpus of the domain and raises VIRQ_DEBUGGER (not VIRQ_PDB). The debugger in domain0 can either poll pause status or bind to VIRQ_DEBUGGER. Before debugging a breakpointed domain the debugger should issue PAUSEDOMAIN itself, or it is not guaranteed to see paused state of the domain! Outside Xen there's a new dir tools/debugger, containing gdb, pdb and a new library libxendebug (used by pdb). I also think the ptrace functions in libxc also ought to be moved out: either to libxendebug or to a new library libxenptrace. Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'xen/include/asm-x86/debugger.h')
-rw-r--r--xen/include/asm-x86/debugger.h53
1 files changed, 4 insertions, 49 deletions
diff --git a/xen/include/asm-x86/debugger.h b/xen/include/asm-x86/debugger.h
index bb5fea1720..aa2050f849 100644
--- a/xen/include/asm-x86/debugger.h
+++ b/xen/include/asm-x86/debugger.h
@@ -55,69 +55,24 @@ static inline int debugger_trap_fatal(
#elif defined(DOMU_DEBUG)
-#include <xen/softirq.h>
+#include <xen/sched.h>
+#include <asm/regs.h>
static inline int debugger_trap_entry(
unsigned int vector, struct cpu_user_regs *regs)
{
struct vcpu *v = current;
- if ( !KERNEL_MODE(ed, regs) || (ed->domain->domain_id == 0) )
+ if ( !KERNEL_MODE(v, regs) || (v->domain->domain_id == 0) )
return 0;
switch ( vector )
{
case TRAP_int3:
case TRAP_debug:
- set_bit(_VCPUF_ctrl_pause, &ed->vcpu_flags);
- raise_softirq(SCHEDULE_SOFTIRQ);
- return 1;
- }
-
- return 0;
-}
-
-#define debugger_trap_fatal(_v, _r) (0)
-#define debugger_trap_immediate()
-
-#elif defined(PDB_DEBUG)
-
-#include <xen/event.h>
-#include <xen/softirq.h>
-#include <xen/sched.h>
-#include <asm/regs.h>
-
-static inline int debugger_trap_entry(unsigned int vector,
- struct cpu_user_regs *regs)
-{
- struct vcpu *vcpu = current;
-
- if ( !KERNEL_MODE(vcpu, regs) || (vcpu->domain->domain_id == 0) )
- return 0;
-
- switch ( vector )
- {
- case TRAP_debug:
- case TRAP_int3:
- {
- struct vcpu *ptr;
-
- /* suspend the guest domain */
- for_each_vcpu ( vcpu->domain, ptr )
- {
- test_and_set_bit(_VCPUF_ctrl_pause, &ptr->vcpu_flags);
- }
- sync_lazy_execstate_mask(vcpu->domain->cpumask); /* TLB flush */
- raise_softirq(SCHEDULE_SOFTIRQ);
-
- /* notify the debugger */
- send_guest_virq(dom0->vcpu[0], VIRQ_PDB);
-
+ domain_pause_for_debugger();
return 1;
}
- default:
- break;
- }
return 0;
}