cmd_bedbug.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. /*
  2. * BedBug Functions
  3. */
  4. #ifndef _CMD_BEDBUG_H
  5. #define _CMD_BEDBUG_H
  6. #if (CONFIG_COMMANDS & CFG_CMD_BEDBUG)
  7. #define CMD_TBL_DIS MK_CMD_TBL_ENTRY( \
  8. "ds", 2, 3, 1, do_bedbug_dis, \
  9. "ds - disassemble memory\n", \
  10. "ds <address> [# instructions]\n" \
  11. ),
  12. #define CMD_TBL_ASM MK_CMD_TBL_ENTRY( \
  13. "as", 2, 2, 0, do_bedbug_asm, \
  14. "as - assemble memory\n", \
  15. "as <address>\n" \
  16. ),
  17. #define CMD_TBL_BREAK MK_CMD_TBL_ENTRY( \
  18. "break", 2, 3, 0, do_bedbug_break, \
  19. "break - set or clear a breakpoint\n", \
  20. " - Set or clear a breakpoint\n" \
  21. "break <address> - Break at an address\n" \
  22. "break off <bp#> - Disable breakpoint.\n" \
  23. "break show - List breakpoints.\n" \
  24. ),
  25. #define CMD_TBL_CONTINUE MK_CMD_TBL_ENTRY( \
  26. "continue", 4, 1, 0, do_bedbug_continue, \
  27. "continue- continue from a breakpoint\n", \
  28. " - continue from a breakpoint.\n" \
  29. ),
  30. #define CMD_TBL_STEP MK_CMD_TBL_ENTRY( \
  31. "step", 4, 1, 1, do_bedbug_step, \
  32. "step - single step execution.\n", \
  33. " - single step execution.\n" \
  34. ),
  35. #define CMD_TBL_NEXT MK_CMD_TBL_ENTRY( \
  36. "next", 4, 1, 1, do_bedbug_next, \
  37. "next - single step execution, stepping over subroutines.\n",\
  38. " - single step execution, stepping over subroutines.\n" \
  39. ),
  40. #define CMD_TBL_STACK MK_CMD_TBL_ENTRY( \
  41. "where", 5, 1, 1, do_bedbug_stack, \
  42. "where - Print the running stack.\n", \
  43. " - Print the running stack.\n" \
  44. ),
  45. #define CMD_TBL_RDUMP MK_CMD_TBL_ENTRY( \
  46. "rdump", 5, 1, 1, do_bedbug_rdump, \
  47. "rdump - Show registers.\n", \
  48. " - Show registers.\n" \
  49. ),
  50. extern int do_bedbug_dis (cmd_tbl_t *, int, int, char *[]);
  51. extern int do_bedbug_asm (cmd_tbl_t *, int, int, char *[]);
  52. extern int do_bedbug_break (cmd_tbl_t *, int, int, char *[]);
  53. extern int do_bedbug_continue (cmd_tbl_t *, int, int, char *[]);
  54. extern int do_bedbug_step (cmd_tbl_t *, int, int, char *[]);
  55. extern int do_bedbug_next (cmd_tbl_t *, int, int, char *[]);
  56. extern int do_bedbug_stack (cmd_tbl_t *, int, int, char *[]);
  57. extern int do_bedbug_rdump (cmd_tbl_t *, int, int, char *[]);
  58. /* Supporting routines */
  59. extern int bedbug_puts (const char *);
  60. extern void bedbug_init (void);
  61. extern void do_bedbug_breakpoint (struct pt_regs *);
  62. extern void bedbug_main_loop (unsigned long, struct pt_regs *);
  63. typedef struct {
  64. int hw_debug_enabled;
  65. int stopped;
  66. int current_bp;
  67. struct pt_regs *regs;
  68. void (*do_break) (cmd_tbl_t *, int, int, char *[]);
  69. void (*break_isr) (struct pt_regs *);
  70. int (*find_empty) (void);
  71. int (*set) (int, unsigned long);
  72. int (*clear) (int);
  73. } CPU_DEBUG_CTX;
  74. #else /* ! CFG_CMD_BEDBUG */
  75. #define CMD_TBL_DIS
  76. #define CMD_TBL_ASM
  77. #define CMD_TBL_BREAK
  78. #define CMD_TBL_CONTINUE
  79. #define CMD_TBL_STEP
  80. #define CMD_TBL_NEXT
  81. #define CMD_TBL_STACK
  82. #define CMD_TBL_RDUMP
  83. #endif /* CFG_CMD_BEDBUG */
  84. #endif /* _CMD_BEDBUG_H */
  85. /*
  86. * Copyright (c) 2001 William L. Pitts
  87. * All rights reserved.
  88. *
  89. * Redistribution and use in source and binary forms are freely
  90. * permitted provided that the above copyright notice and this
  91. * paragraph and the following disclaimer are duplicated in all
  92. * such forms.
  93. *
  94. * This software is provided "AS IS" and without any express or
  95. * implied warranties, including, without limitation, the implied
  96. * warranties of merchantability and fitness for a particular
  97. * purpose.
  98. */