debug_core.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * Created by: Jason Wessel <jason.wessel@windriver.com>
  3. *
  4. * Copyright (c) 2009 Wind River Systems, Inc. All Rights Reserved.
  5. *
  6. * This file is licensed under the terms of the GNU General Public
  7. * License version 2. This program is licensed "as is" without any
  8. * warranty of any kind, whether express or implied.
  9. */
  10. #ifndef _DEBUG_CORE_H_
  11. #define _DEBUG_CORE_H_
  12. /*
  13. * These are the private implementation headers between the kernel
  14. * debugger core and the debugger front end code.
  15. */
  16. /* kernel debug core data structures */
  17. struct kgdb_state {
  18. int ex_vector;
  19. int signo;
  20. int err_code;
  21. int cpu;
  22. int pass_exception;
  23. unsigned long thr_query;
  24. unsigned long threadid;
  25. long kgdb_usethreadid;
  26. struct pt_regs *linux_regs;
  27. };
  28. /* Exception state values */
  29. #define DCPU_WANT_MASTER 0x1 /* Waiting to become a master kgdb cpu */
  30. #define DCPU_NEXT_MASTER 0x2 /* Transition from one master cpu to another */
  31. #define DCPU_IS_SLAVE 0x4 /* Slave cpu enter exception */
  32. #define DCPU_SSTEP 0x8 /* CPU is single stepping */
  33. struct debuggerinfo_struct {
  34. void *debuggerinfo;
  35. struct task_struct *task;
  36. int exception_state;
  37. };
  38. extern struct debuggerinfo_struct kgdb_info[];
  39. /* kernel debug core break point routines */
  40. extern int dbg_remove_all_break(void);
  41. extern int dbg_set_sw_break(unsigned long addr);
  42. extern int dbg_remove_sw_break(unsigned long addr);
  43. extern int dbg_activate_sw_breakpoints(void);
  44. /* gdbstub interface functions */
  45. extern int gdb_serial_stub(struct kgdb_state *ks);
  46. extern void gdbstub_msg_write(const char *s, int len);
  47. #endif /* _DEBUG_CORE_H_ */