| 1 |
|
| 2 | |
| 3 | * Created by: Jason Wessel <[email protected]>
|
| 4 | *
|
| 5 | * Copyright (c) 2009 Wind River Systems, Inc. All Rights Reserved.
|
| 6 |
|
| 7 |
|
| 8 | #ifndef _DEBUG_CORE_H_
|
| 9 | #define _DEBUG_CORE_H_
|
| 10 | |
| 11 | * These are the private implementation headers between the kernel
|
| 12 | * debugger core and the debugger front end code.
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 | struct kgdb_state {
|
| 17 | int ex_vector;
|
| 18 | int signo;
|
| 19 | int err_code;
|
| 20 | int cpu;
|
| 21 | int pass_exception;
|
| 22 | unsigned long thr_query;
|
| 23 | unsigned long threadid;
|
| 24 | long kgdb_usethreadid;
|
| 25 | struct pt_regs *linux_regs;
|
| 26 | atomic_t *send_ready;
|
| 27 | };
|
| 28 |
|
| 29 |
|
| 30 | #define DCPU_WANT_MASTER 0x1
|
| 31 | #define DCPU_NEXT_MASTER 0x2
|
| 32 | #define DCPU_IS_SLAVE 0x4
|
| 33 | #define DCPU_WANT_BT 0x8
|
| 34 |
|
| 35 | struct debuggerinfo_struct {
|
| 36 | void *debuggerinfo;
|
| 37 | struct task_struct *task;
|
| 38 | int exception_state;
|
| 39 | int ret_state;
|
| 40 | int irq_depth;
|
| 41 | int enter_kgdb;
|
| 42 | bool rounding_up;
|
| 43 | };
|
| 44 |
|
| 45 | extern struct debuggerinfo_struct kgdb_info[];
|
| 46 |
|
| 47 |
|
| 48 | extern int dbg_remove_all_break(void);
|
| 49 | extern int dbg_set_sw_break(unsigned long addr);
|
| 50 | extern int dbg_remove_sw_break(unsigned long addr);
|
| 51 | extern int dbg_activate_sw_breakpoints(void);
|
| 52 | extern int dbg_deactivate_sw_breakpoints(void);
|
| 53 |
|
| 54 |
|
| 55 | extern int dbg_io_get_char(void);
|
| 56 |
|
| 57 |
|
| 58 | #define DBG_PASS_EVENT -12345
|
| 59 |
|
| 60 | #define DBG_SWITCH_CPU_EVENT -123456
|
| 61 | extern int dbg_switch_cpu;
|
| 62 |
|
| 63 |
|
| 64 | extern int gdb_serial_stub(struct kgdb_state *ks);
|
| 65 | extern void gdbstub_msg_write(const char *s, int len);
|
| 66 |
|
| 67 |
|
| 68 | extern int gdbstub_state(struct kgdb_state *ks, char *cmd);
|
| 69 | extern int dbg_kdb_mode;
|
| 70 |
|
| 71 | #ifdef CONFIG_KGDB_KDB
|
| 72 | extern int kdb_stub(struct kgdb_state *ks);
|
| 73 | extern int kdb_parse(const char *cmdstr);
|
| 74 | extern int kdb_common_init_state(struct kgdb_state *ks);
|
| 75 | extern int kdb_common_deinit_state(void);
|
| 76 | extern void kdb_dump_stack_on_cpu(int cpu);
|
| 77 | #else
|
| 78 | static inline int kdb_stub(struct kgdb_state *ks)
|
| 79 | {
|
| 80 | return DBG_PASS_EVENT;
|
| 81 | }
|
| 82 | #endif
|
| 83 |
|
| 84 | #endif
|