ia64/xen-unstable

view xen/include/asm-ia64/debugger.h @ 17315:6827df3f7391

[IA64] Eliminate duble dump_stack

show_registers() already has show_stack(NULL, NULL),
So we get two same Calltraces. This patch eliminate it.

Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
author Alex Williamson <alex.williamson@hp.com>
date Fri Mar 28 15:27:13 2008 -0600 (2008-03-28)
parents 4ac315e33f88
children
line source
1 /******************************************************************************
2 * asm/debugger.h
3 *
4 * Generic hooks into arch-dependent Xen.
5 *
6 * Each debugger should define two functions here:
7 *
8 * 1. debugger_trap_entry():
9 * Called at start of any synchronous fault or trap, before any other work
10 * is done. The idea is that if your debugger deliberately caused the trap
11 * (e.g. to implement breakpoints or data watchpoints) then you can take
12 * appropriate action and return a non-zero value to cause early exit from
13 * the trap function.
14 *
15 * 2. debugger_trap_fatal():
16 * Called when Xen is about to give up and crash. Typically you will use this
17 * hook to drop into a debug session. It can also be used to hook off
18 * deliberately caused traps (which you then handle and return non-zero)
19 * but really these should be hooked off 'debugger_trap_entry'.
20 */
22 #ifndef __ASM_DEBUGGER_H__
23 #define __ASM_DEBUGGER_H__
25 // this number is an arbitary number which is not used for any other purpose
26 // __builtin_trap() 0x0
27 // ski 0x80001, 0x80002
28 // kdb 0x80100, 0x80101
29 // kprobe 0x80200, jprobe 0x80300
30 // kgdb 0x6665
31 // gdb 0x99998 (#define IA64_BREAKPOINT 0x00003333300LL)
32 // ltrace 0x80001 (NOTE: this conflicts ski)
34 // cdb should handle 0 and CDB_BREAK_NUM.
35 #define CDB_BREAK_NUM 0x80800
38 #ifndef __ASSEMBLY__
40 #include <xen/sched.h>
41 #include <xen/softirq.h>
42 #include <xen/gdbstub.h>
43 #include <public/arch-ia64/debug_op.h>
45 void show_registers(struct cpu_user_regs *regs);
46 void dump_stack(void);
48 static inline void
49 show_execution_state(struct cpu_user_regs *regs)
50 {
51 show_registers(regs);
52 }
54 // NOTE: on xen struct pt_regs = struct cpu_user_regs
55 // see include/asm-ia64/linux-xen/asm/ptrace.h
56 #ifdef CRASH_DEBUG
57 // crash_debug=y
59 extern int __trap_to_cdb(struct cpu_user_regs *r);
60 static inline int debugger_trap_fatal(
61 unsigned int vector, struct cpu_user_regs *regs)
62 {
63 (void)__trap_to_gdb(regs, vector);
64 return 0;
65 }
67 #define ____debugger_trap_immediate(b) __asm__ __volatile__ ("break.m "#b"\n")
68 #define __debugger_trap_immediate(b) ____debugger_trap_immediate(b)
69 #define debugger_trap_immediate() __debugger_trap_immediate(CDB_BREAK_NUM)
71 //XXX temporal work around
72 #ifndef CONFIG_SMP
73 #define smp_send_stop() /* nothing */
74 #endif
76 #else
77 static inline int debugger_trap_fatal(
78 unsigned int vector, struct cpu_user_regs *regs)
79 {
80 return 0;
81 }
83 #define debugger_trap_immediate() ((void)0)
84 #endif
86 static inline int debugger_event(unsigned long event)
87 {
88 struct vcpu *v = current;
89 struct domain *d = v->domain;
91 if (unlikely (d->debugger_attached && (d->arch.debug_flags & event))) {
92 d->arch.debug_event = event;
93 domain_pause_for_debugger();
94 return 1;
95 }
96 return 0;
97 }
99 static inline int debugger_kernel_event(
100 struct cpu_user_regs *regs, unsigned long event)
101 {
102 struct vcpu *v = current;
103 struct domain *d = v->domain;
105 if (unlikely(d->debugger_attached && (d->arch.debug_flags & event)
106 && guest_kernel_mode(regs))) {
107 d->arch.debug_event = event;
108 domain_pause_for_debugger();
109 return 1;
110 }
111 return 0;
112 }
114 #endif // __ASSEMBLLY__
116 #endif /* __ASM_DEBUGGER_H__ */