1 /* Copyright (C) 2008-2024 Free Software Foundation, Inc.
3 This file is part of GDB.
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. */
18 #ifndef GDB_WINDOWS_TDEP_H
19 #define GDB_WINDOWS_TDEP_H
21 #include "frame-unwind.h"
25 extern struct cmd_list_element
*info_w32_cmdlist
;
27 extern void init_w32_command_list (void);
29 extern void windows_xfer_shared_library (const char* so_name
,
31 CORE_ADDR
*text_offset_cached
,
32 struct gdbarch
*gdbarch
,
35 extern ULONGEST
windows_core_xfer_shared_libraries (struct gdbarch
*gdbarch
,
40 extern std::string
windows_core_pid_to_str (struct gdbarch
*gdbarch
,
43 /* To be called from the various GDB_OSABI_WINDOWS handlers for the
44 various Windows architectures and machine types. */
46 extern void windows_init_abi (struct gdbarch_info info
,
47 struct gdbarch
*gdbarch
);
49 /* To be called from the various GDB_OSABI_CYGWIN handlers for the
50 various Windows architectures and machine types. */
52 extern void cygwin_init_abi (struct gdbarch_info info
,
53 struct gdbarch
*gdbarch
);
55 /* Return true if the Portable Executable behind ABFD uses the Cygwin dll
58 extern bool is_linked_with_cygwin_dll (bfd
*abfd
);
60 /* Cygwin sigwapper unwinder. Unwinds signal frames over
63 class cygwin_sigwrapper_frame_unwind
: public frame_unwind
66 explicit cygwin_sigwrapper_frame_unwind
67 (gdb::array_view
<const gdb::array_view
<const gdb_byte
>> patterns_list
);
69 /* Architecture-specific list of instruction patterns to match.
70 It's a list of patterns instead of single pattern because some
71 architectures want to match more than one function
72 (sigbe/sigdelayed & friends). Each potential instruction
73 sequence is assumed to be followed by 4 bytes for tls::stackptr.
74 If any pattern in the list matches, then the frame is assumed to
75 be a sigwrapper frame. */
76 gdb::array_view
<const gdb::array_view
<const gdb_byte
>> patterns_list
;
78 /* Calculate the frame ID of a cygwin wrapper. */
79 void this_id (const frame_info_ptr
&this_frame
, void **this_prologue_cache
,
80 struct frame_id
*id
) const override
;
82 /* Sniff the frame to tell if this unwinder should be used. */
83 int sniff (const frame_info_ptr
&this_frame
,
84 void **this_prologue_cache
) const override
;
86 /* Calculate the value of a given register in the previous frame. */
87 struct value
*prev_register (const frame_info_ptr
&this_frame
,
89 int regnum
) const override
;
92 #endif /* GDB_WINDOWS_TDEP_H */