linux-tdep.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /* Target-dependent code for GNU/Linux, architecture independent.
  2. Copyright (C) 2009-2022 Free Software Foundation, Inc.
  3. This file is part of GDB.
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 3 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  14. #ifndef LINUX_TDEP_H
  15. #define LINUX_TDEP_H
  16. #include "bfd.h"
  17. #include "displaced-stepping.h"
  18. struct inferior;
  19. struct regcache;
  20. /* Enum used to define the extra fields of the siginfo type used by an
  21. architecture. */
  22. enum linux_siginfo_extra_field_values
  23. {
  24. /* Add bound fields into the segmentation fault field. */
  25. LINUX_SIGINFO_FIELD_ADDR_BND = 1
  26. };
  27. /* Defines a type for the values defined in linux_siginfo_extra_field_values. */
  28. DEF_ENUM_FLAGS_TYPE (enum linux_siginfo_extra_field_values,
  29. linux_siginfo_extra_fields);
  30. /* This function is suitable for architectures that
  31. extend/override the standard siginfo in a specific way. */
  32. struct type *linux_get_siginfo_type_with_fields (struct gdbarch *gdbarch,
  33. linux_siginfo_extra_fields);
  34. /* Return true if ADDRESS is within the boundaries of a page mapped with
  35. memory tagging protection. */
  36. bool linux_address_in_memtag_page (CORE_ADDR address);
  37. typedef char *(*linux_collect_thread_registers_ftype) (const struct regcache *,
  38. ptid_t,
  39. bfd *, char *, int *,
  40. enum gdb_signal);
  41. extern enum gdb_signal linux_gdb_signal_from_target (struct gdbarch *gdbarch,
  42. int signal);
  43. extern int linux_gdb_signal_to_target (struct gdbarch *gdbarch,
  44. enum gdb_signal signal);
  45. /* Default GNU/Linux implementation of `displaced_step_location', as
  46. defined in gdbarch.h. Determines the entry point from AT_ENTRY in
  47. the target auxiliary vector. */
  48. extern CORE_ADDR linux_displaced_step_location (struct gdbarch *gdbarch);
  49. /* Implementation of gdbarch_displaced_step_prepare. */
  50. extern displaced_step_prepare_status linux_displaced_step_prepare
  51. (gdbarch *arch, thread_info *thread, CORE_ADDR &displaced_pc);
  52. /* Implementation of gdbarch_displaced_step_finish. */
  53. extern displaced_step_finish_status linux_displaced_step_finish
  54. (gdbarch *arch, thread_info *thread, gdb_signal sig);
  55. /* Implementation of gdbarch_displaced_step_copy_insn_closure_by_addr. */
  56. extern const displaced_step_copy_insn_closure *
  57. linux_displaced_step_copy_insn_closure_by_addr
  58. (inferior *inf, CORE_ADDR addr);
  59. /* Implementation of gdbarch_displaced_step_restore_all_in_ptid. */
  60. extern void linux_displaced_step_restore_all_in_ptid (inferior *parent_inf,
  61. ptid_t ptid);
  62. extern void linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch,
  63. int num_disp_step_buffers);
  64. extern int linux_is_uclinux (void);
  65. /* Fetch the AT_HWCAP entry from the auxv vector for the given TARGET. On
  66. error, 0 is returned. */
  67. extern CORE_ADDR linux_get_hwcap (struct target_ops *target);
  68. /* Fetch the AT_HWCAP2 entry from the auxv vector for the given TARGET. On
  69. error, 0 is returned. */
  70. extern CORE_ADDR linux_get_hwcap2 (struct target_ops *target);
  71. /* Fetch (and possibly build) an appropriate `struct link_map_offsets'
  72. for ILP32 and LP64 Linux systems. */
  73. extern struct link_map_offsets *linux_ilp32_fetch_link_map_offsets ();
  74. extern struct link_map_offsets *linux_lp64_fetch_link_map_offsets ();
  75. #endif /* linux-tdep.h */