《操作系统》的实验代码。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
2.1 KiB

  1. #ifndef __KERN_DEBUG_STAB_H__
  2. #define __KERN_DEBUG_STAB_H__
  3. #include <defs.h>
  4. /* *
  5. * STABS debugging info
  6. *
  7. * The kernel debugger can understand some debugging information in
  8. * the STABS format. For more information on this format, see
  9. * http://sources.redhat.com/gdb/onlinedocs/stabs_toc.html
  10. *
  11. * The constants below define some symbol types used by various debuggers
  12. * and compilers. Kernel uses the N_SO, N_SOL, N_FUN, and N_SLINE types.
  13. * */
  14. #define N_GSYM 0x20 // global symbol
  15. #define N_FNAME 0x22 // F77 function name
  16. #define N_FUN 0x24 // procedure name
  17. #define N_STSYM 0x26 // data segment variable
  18. #define N_LCSYM 0x28 // bss segment variable
  19. #define N_MAIN 0x2a // main function name
  20. #define N_PC 0x30 // global Pascal symbol
  21. #define N_RSYM 0x40 // register variable
  22. #define N_SLINE 0x44 // text segment line number
  23. #define N_DSLINE 0x46 // data segment line number
  24. #define N_BSLINE 0x48 // bss segment line number
  25. #define N_SSYM 0x60 // structure/union element
  26. #define N_SO 0x64 // main source file name
  27. #define N_LSYM 0x80 // stack variable
  28. #define N_BINCL 0x82 // include file beginning
  29. #define N_SOL 0x84 // included source file name
  30. #define N_PSYM 0xa0 // parameter variable
  31. #define N_EINCL 0xa2 // include file end
  32. #define N_ENTRY 0xa4 // alternate entry point
  33. #define N_LBRAC 0xc0 // left bracket
  34. #define N_EXCL 0xc2 // deleted include file
  35. #define N_RBRAC 0xe0 // right bracket
  36. #define N_BCOMM 0xe2 // begin common
  37. #define N_ECOMM 0xe4 // end common
  38. #define N_ECOML 0xe8 // end common (local name)
  39. #define N_LENG 0xfe // length of preceding entry
  40. /* Entries in the STABS table are formatted as follows. */
  41. struct stab {
  42. uint32_t n_strx; // index into string table of name
  43. uint8_t n_type; // type of symbol
  44. uint8_t n_other; // misc info (usually empty)
  45. uint16_t n_desc; // description field
  46. uintptr_t n_value; // value of symbol
  47. };
  48. #endif /* !__KERN_DEBUG_STAB_H__ */