x86-linux-nat.h 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /* Native-dependent code for GNU/Linux x86 (i386 and x86-64).
  2. Copyright (C) 1999-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 X86_LINUX_NAT_H
  15. #define X86_LINUX_NAT_H 1
  16. #include "gdb_proc_service.h" /* For ps_err_e. */
  17. #include "linux-nat.h"
  18. #include "x86-nat.h"
  19. #include "nat/x86-linux.h"
  20. struct x86_linux_nat_target : public x86_nat_target<linux_nat_target>
  21. {
  22. virtual ~x86_linux_nat_target () override = 0;
  23. /* Add the description reader. */
  24. const struct target_desc *read_description () override;
  25. struct btrace_target_info *enable_btrace (thread_info *tp,
  26. const struct btrace_config *conf) override;
  27. void disable_btrace (struct btrace_target_info *tinfo) override;
  28. void teardown_btrace (struct btrace_target_info *tinfo) override;
  29. enum btrace_error read_btrace (struct btrace_data *data,
  30. struct btrace_target_info *btinfo,
  31. enum btrace_read_type type) override;
  32. const struct btrace_config *btrace_conf (const struct btrace_target_info *) override;
  33. /* These two are rewired to low_ versions. linux-nat.c queries
  34. stopped-by-watchpoint info as soon as an lwp stops (via the low_
  35. methods) and caches the result, to be returned via the normal
  36. non-low methods. */
  37. bool stopped_by_watchpoint () override
  38. { return linux_nat_target::stopped_by_watchpoint (); }
  39. bool stopped_data_address (CORE_ADDR *addr_p) override
  40. { return linux_nat_target::stopped_data_address (addr_p); }
  41. bool low_stopped_by_watchpoint () override
  42. { return x86_nat_target::stopped_by_watchpoint (); }
  43. bool low_stopped_data_address (CORE_ADDR *addr_p) override
  44. { return x86_nat_target::stopped_data_address (addr_p); }
  45. void low_new_fork (struct lwp_info *parent, pid_t child_pid) override;
  46. void low_forget_process (pid_t pid) override
  47. { x86_forget_process (pid); }
  48. void low_prepare_to_resume (struct lwp_info *lwp) override
  49. { x86_linux_prepare_to_resume (lwp); }
  50. void low_new_thread (struct lwp_info *lwp) override
  51. { x86_linux_new_thread (lwp); }
  52. void low_delete_thread (struct arch_lwp_info *lwp) override
  53. { x86_linux_delete_thread (lwp); }
  54. protected:
  55. /* Override the GNU/Linux inferior startup hook. */
  56. void post_startup_inferior (ptid_t) override;
  57. };
  58. /* Helper for ps_get_thread_area. Sets BASE_ADDR to a pointer to
  59. the thread local storage (or its descriptor) and returns PS_OK
  60. on success. Returns PS_ERR on failure. */
  61. extern ps_err_e x86_linux_get_thread_area (pid_t pid, void *addr,
  62. unsigned int *base_addr);
  63. #endif