elfcore.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. #ifndef _LINUX_ELFCORE_H
  2. #define _LINUX_ELFCORE_H
  3. #include <linux/types.h>
  4. #include <linux/signal.h>
  5. #include <linux/time.h>
  6. #include <linux/ptrace.h>
  7. #include <linux/elf.h>
  8. #include <linux/fs.h>
  9. struct elf_siginfo
  10. {
  11. int si_signo; /* signal number */
  12. int si_code; /* extra code */
  13. int si_errno; /* errno */
  14. };
  15. typedef elf_greg_t greg_t;
  16. typedef elf_gregset_t gregset_t;
  17. typedef elf_fpregset_t fpregset_t;
  18. typedef elf_fpxregset_t fpxregset_t;
  19. #define NGREG ELF_NGREG
  20. /*
  21. * Definitions to generate Intel SVR4-like core files.
  22. * These mostly have the same names as the SVR4 types with "elf_"
  23. * tacked on the front to prevent clashes with linux definitions,
  24. * and the typedef forms have been avoided. This is mostly like
  25. * the SVR4 structure, but more Linuxy, with things that Linux does
  26. * not support and which gdb doesn't really use excluded.
  27. * Fields present but not used are marked with "XXX".
  28. */
  29. struct elf_prstatus
  30. {
  31. #if 0
  32. long pr_flags; /* XXX Process flags */
  33. short pr_why; /* XXX Reason for process halt */
  34. short pr_what; /* XXX More detailed reason */
  35. #endif
  36. struct elf_siginfo pr_info; /* Info associated with signal */
  37. short pr_cursig; /* Current signal */
  38. unsigned long pr_sigpend; /* Set of pending signals */
  39. unsigned long pr_sighold; /* Set of held signals */
  40. #if 0
  41. struct sigaltstack pr_altstack; /* Alternate stack info */
  42. struct sigaction pr_action; /* Signal action for current sig */
  43. #endif
  44. pid_t pr_pid;
  45. pid_t pr_ppid;
  46. pid_t pr_pgrp;
  47. pid_t pr_sid;
  48. struct timeval pr_utime; /* User time */
  49. struct timeval pr_stime; /* System time */
  50. struct timeval pr_cutime; /* Cumulative user time */
  51. struct timeval pr_cstime; /* Cumulative system time */
  52. #if 0
  53. long pr_instr; /* Current instruction */
  54. #endif
  55. elf_gregset_t pr_reg; /* GP registers */
  56. #ifdef CONFIG_BINFMT_ELF_FDPIC
  57. /* When using FDPIC, the loadmap addresses need to be communicated
  58. * to GDB in order for GDB to do the necessary relocations. The
  59. * fields (below) used to communicate this information are placed
  60. * immediately after ``pr_reg'', so that the loadmap addresses may
  61. * be viewed as part of the register set if so desired.
  62. */
  63. unsigned long pr_exec_fdpic_loadmap;
  64. unsigned long pr_interp_fdpic_loadmap;
  65. #endif
  66. int pr_fpvalid; /* True if math co-processor being used. */
  67. };
  68. #define ELF_PRARGSZ (80) /* Number of chars for args */
  69. struct elf_prpsinfo
  70. {
  71. char pr_state; /* numeric process state */
  72. char pr_sname; /* char for pr_state */
  73. char pr_zomb; /* zombie */
  74. char pr_nice; /* nice val */
  75. unsigned long pr_flag; /* flags */
  76. __kernel_uid_t pr_uid;
  77. __kernel_gid_t pr_gid;
  78. pid_t pr_pid, pr_ppid, pr_pgrp, pr_sid;
  79. /* Lots missing */
  80. char pr_fname[16]; /* filename of executable */
  81. char pr_psargs[ELF_PRARGSZ]; /* initial part of arg list */
  82. };
  83. typedef struct elf_prstatus prstatus_t;
  84. typedef struct elf_prpsinfo prpsinfo_t;
  85. #define PRARGSZ ELF_PRARGSZ
  86. #endif /* _LINUX_ELFCORE_H */