GDB (xrefs)

/tmp/gdb-8.1/gdb/amd64-obsd-tdep.c
Go to the documentation of this file.
1 /* Target-dependent code for OpenBSD/amd64.
2
3 Copyright (C) 2003-2018 Free Software Foundation, Inc.
4
5 This file is part of GDB.
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
19
20 #include "defs.h"
21 #include "frame.h"
22 #include "frame-unwind.h"
23 #include "gdbcore.h"
24 #include "symtab.h"
25 #include "objfiles.h"
26 #include "osabi.h"
27 #include "regcache.h"
28 #include "regset.h"
29 #include "target.h"
30 #include "trad-frame.h"
31
32 #include "obsd-tdep.h"
33 #include "amd64-tdep.h"
34 #include "i387-tdep.h"
35 #include "x86-xstate.h"
36 #include "solib-svr4.h"
37 #include "bsd-uthread.h"
38
39 /* Support for signal handlers. */
40
41 /* Default page size. */
42 static const int amd64obsd_page_size = 4096;
43
44 /* Return whether THIS_FRAME corresponds to an OpenBSD sigtramp
45 routine. */
46
47 static int
48 amd64obsd_sigtramp_p (struct frame_info *this_frame)
49 {
50 CORE_ADDR pc = get_frame_pc (this_frame);
51 CORE_ADDR start_pc = (pc & ~(amd64obsd_page_size - 1));
52 const gdb_byte osigreturn[] =
53 {
54 0x48, 0xc7, 0xc0,
55 0x67, 0x00, 0x00, 0x00, /* movq $SYS_sigreturn, %rax */
56 0xcd, 0x80 /* int $0x80 */
57 };
58 const gdb_byte sigreturn[] =
59 {
60 0x48, 0xc7, 0xc0,
61 0x67, 0x00, 0x00, 0x00, /* movq $SYS_sigreturn, %rax */
62 0x0f, 0x05 /* syscall */
63 };
64 size_t buflen = (sizeof sigreturn) + 1;
65 gdb_byte *buf;
66 const char *name;
67
68 /* If the function has a valid symbol name, it isn't a
69 trampoline. */
70 find_pc_partial_function (pc, &name, NULL, NULL);
71 if (name != NULL)
72 return 0;
73
74 /* If the function lives in a valid section (even without a starting
75 point) it isn't a trampoline. */
76 if (find_pc_section (pc) != NULL)
77 return 0;
78
79 /* If we can't read the instructions at START_PC, return zero. */
80 buf = (gdb_byte *) alloca ((sizeof sigreturn) + 1);
81 if (!safe_frame_unwind_memory (this_frame, start_pc + 6, buf, buflen))
82 return 0;
83
84 /* Check for sigreturn(2). Depending on how the assembler encoded
85 the `movq %rsp, %rdi' instruction, the code starts at offset 6 or
86 7. OpenBSD 5.0 and later use the `syscall' instruction. Older
87 versions use `int $0x80'. Check for both. */
88 if (memcmp (buf, sigreturn, sizeof sigreturn)
89 && memcmp (buf + 1, sigreturn, sizeof sigreturn)
90 && memcmp (buf, osigreturn, sizeof osigreturn)
91 && memcmp (buf + 1, osigreturn, sizeof osigreturn))
92 return 0;
93
94 return 1;
95 }
96
97 /* Assuming THIS_FRAME is for a BSD sigtramp routine, return the
98 address of the associated sigcontext structure. */
99
100 static CORE_ADDR
101 amd64obsd_sigcontext_addr (struct frame_info *this_frame)
102 {
103 CORE_ADDR pc = get_frame_pc (this_frame);
104 ULONGEST offset = (pc & (amd64obsd_page_size - 1));
105
106 /* The %rsp register points at `struct sigcontext' upon entry of a
107 signal trampoline. The relevant part of the trampoline is
108
109 call *%rax
110 movq %rsp, %rdi
111 pushq %rdi
112 movq $SYS_sigreturn,%rax
113 int $0x80
114
115 (see /usr/src/sys/arch/amd64/amd64/locore.S). The `pushq'
116 instruction clobbers %rsp, but its value is saved in `%rdi'. */
117
118 if (offset > 5)
119 return get_frame_register_unsigned (this_frame, AMD64_RDI_REGNUM);
120 else
121 return get_frame_register_unsigned (this_frame, AMD64_RSP_REGNUM);
122 }
123
124 /* OpenBSD 3.5 or later. */
125
126 /* Mapping between the general-purpose registers in `struct reg'
127 format and GDB's register cache layout. */
128
129 /* From <machine/reg.h>. */
130 int amd64obsd_r_reg_offset[] =
131 {
132 14 * 8, /* %rax */
133 13 * 8, /* %rbx */
134 3 * 8, /* %rcx */
135 2 * 8, /* %rdx */
136 1 * 8, /* %rsi */
137 0 * 8, /* %rdi */
138 12 * 8, /* %rbp */
139 15 * 8, /* %rsp */
140 4 * 8, /* %r8 .. */
141 5 * 8,
142 6 * 8,
143 7 * 8,
144 8 * 8,
145 9 * 8,
146 10 * 8,
147 11 * 8, /* ... %r15 */
148 16 * 8, /* %rip */
149 17 * 8, /* %eflags */
150 18 * 8, /* %cs */
151 19 * 8, /* %ss */
152 20 * 8, /* %ds */
153 21 * 8, /* %es */
154 22 * 8, /* %fs */
155 23 * 8 /* %gs */
156 };
157
158 /* From <machine/signal.h>. */
159 static int amd64obsd_sc_reg_offset[] =
160 {
161 14 * 8, /* %rax */
162 13 * 8, /* %rbx */
163 3 * 8, /* %rcx */
164 2 * 8, /* %rdx */
165 1 * 8, /* %rsi */
166 0 * 8, /* %rdi */
167 12 * 8, /* %rbp */
168 24 * 8, /* %rsp */
169 4 * 8, /* %r8 ... */
170 5 * 8,
171 6 * 8,
172 7 * 8,
173 8 * 8,
174 9 * 8,
175 10 * 8,
176 11 * 8, /* ... %r15 */
177 21 * 8, /* %rip */
178 23 * 8, /* %eflags */
179 22 * 8, /* %cs */
180 25 * 8, /* %ss */
181 18 * 8, /* %ds */
182 17 * 8, /* %es */
183 16 * 8, /* %fs */
184 15 * 8 /* %gs */
185 };
186
187 /* From /usr/src/lib/libpthread/arch/amd64/uthread_machdep.c. */
188 static int amd64obsd_uthread_reg_offset[] =
189 {
190 19 * 8, /* %rax */
191 16 * 8, /* %rbx */
192 18 * 8, /* %rcx */
193 17 * 8, /* %rdx */
194 14 * 8, /* %rsi */
195 13 * 8, /* %rdi */
196 15 * 8, /* %rbp */
197 -1, /* %rsp */
198 12 * 8, /* %r8 ... */
199 11 * 8,
200 10 * 8,
201 9 * 8,
202 8 * 8,
203 7 * 8,
204 6 * 8,
205 5 * 8, /* ... %r15 */
206 20 * 8, /* %rip */
207 4 * 8, /* %eflags */
208 21 * 8, /* %cs */
209 -1, /* %ss */
210 3 * 8, /* %ds */
211 2 * 8, /* %es */
212 1 * 8, /* %fs */
213 0 * 8 /* %gs */
214 };
215
216 /* Offset within the thread structure where we can find the saved
217 stack pointer (%esp). */
218 #define AMD64OBSD_UTHREAD_RSP_OFFSET 400
219
220 static void
221 amd64obsd_supply_uthread (struct regcache *regcache,
222 int regnum, CORE_ADDR addr)
223 {
224 struct gdbarch *gdbarch = regcache->arch ();
225 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
226 CORE_ADDR sp_addr = addr + AMD64OBSD_UTHREAD_RSP_OFFSET;
227 CORE_ADDR sp = 0;
228 gdb_byte buf[8];
229 int i;
230
231 gdb_assert (regnum >= -1);
232
233 if (regnum == -1 || regnum == AMD64_RSP_REGNUM)
234 {
235 int offset;
236
237 /* Fetch stack pointer from thread structure. */
238 sp = read_memory_unsigned_integer (sp_addr, 8, byte_order);
239
240 /* Adjust the stack pointer such that it looks as if we just
241 returned from _thread_machdep_switch. */
242 offset = amd64obsd_uthread_reg_offset[AMD64_RIP_REGNUM] + 8;
243 store_unsigned_integer (buf, 8, byte_order, sp + offset);
244 regcache_raw_supply (regcache, AMD64_RSP_REGNUM, buf);
245 }
246
247 for (i = 0; i < ARRAY_SIZE (amd64obsd_uthread_reg_offset); i++)
248 {
249 if (amd64obsd_uthread_reg_offset[i] != -1
250 && (regnum == -1 || regnum == i))
251 {
252 /* Fetch stack pointer from thread structure (if we didn't
253 do so already). */
254 if (sp == 0)
255 sp = read_memory_unsigned_integer (sp_addr, 8, byte_order);
256
257 /* Read the saved register from the stack frame. */
258 read_memory (sp + amd64obsd_uthread_reg_offset[i], buf, 8);
259 regcache_raw_supply (regcache, i, buf);
260 }
261 }
262 }
263
264 static void
265 amd64obsd_collect_uthread (const struct regcache *regcache,
266 int regnum, CORE_ADDR addr)
267 {
268 struct gdbarch *gdbarch = regcache->arch ();
269 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
270 CORE_ADDR sp_addr = addr + AMD64OBSD_UTHREAD_RSP_OFFSET;
271 CORE_ADDR sp = 0;
272 gdb_byte buf[8];
273 int i;
274
275 gdb_assert (regnum >= -1);
276
277 if (regnum == -1 || regnum == AMD64_RSP_REGNUM)
278 {
279 int offset;
280
281 /* Calculate the stack pointer (frame pointer) that will be
282 stored into the thread structure. */
283 offset = amd64obsd_uthread_reg_offset[AMD64_RIP_REGNUM] + 8;
284 regcache_raw_collect (regcache, AMD64_RSP_REGNUM, buf);
285 sp = extract_unsigned_integer (buf, 8, byte_order) - offset;
286
287 /* Store the stack pointer. */
288 write_memory_unsigned_integer (sp_addr, 8, byte_order, sp);
289
290 /* The stack pointer was (potentially) modified. Make sure we
291 build a proper stack frame. */
292 regnum = -1;
293 }
294
295 for (i = 0; i < ARRAY_SIZE (amd64obsd_uthread_reg_offset); i++)
296 {
297 if (amd64obsd_uthread_reg_offset[i] != -1
298 && (regnum == -1 || regnum == i))
299 {
300 /* Fetch stack pointer from thread structure (if we didn't
301 calculate it already). */
302 if (sp == 0)
303 sp = read_memory_unsigned_integer (sp_addr, 8, byte_order);
304
305 /* Write the register into the stack frame. */
306 regcache_raw_collect (regcache, i, buf);
307 write_memory (sp + amd64obsd_uthread_reg_offset[i], buf, 8);
308 }
309 }
310 }
311 /* Kernel debugging support. */
312
313 /* From <machine/frame.h>. Easy since `struct trapframe' matches
314 `struct sigcontext'. */
315 #define amd64obsd_tf_reg_offset amd64obsd_sc_reg_offset
316
317 static struct trad_frame_cache *
318 amd64obsd_trapframe_cache (struct frame_info *this_frame, void **this_cache)
319 {
320 struct gdbarch *gdbarch = get_frame_arch (this_frame);
321 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
322 struct trad_frame_cache *cache;
323 CORE_ADDR func, sp, addr;
324 ULONGEST cs;
325 const char *name;
326 int i;
327
328 if (*this_cache)
329 return (struct trad_frame_cache *) *this_cache;
330
331 cache = trad_frame_cache_zalloc (this_frame);
332 *this_cache = cache;
333
334 func = get_frame_func (this_frame);
335 sp = get_frame_register_unsigned (this_frame, AMD64_RSP_REGNUM);
336
337 find_pc_partial_function (func, &name, NULL, NULL);
338 if (name && startswith (name, "Xintr"))
339 addr = sp + 8; /* It's an interrupt frame. */
340 else
341 addr = sp;
342
343 for (i = 0; i < ARRAY_SIZE (amd64obsd_tf_reg_offset); i++)
344 if (amd64obsd_tf_reg_offset[i] != -1)
345 trad_frame_set_reg_addr (cache, i, addr + amd64obsd_tf_reg_offset[i]);
346
347 /* Read %cs from trap frame. */
348 addr += amd64obsd_tf_reg_offset[AMD64_CS_REGNUM];
349 cs = read_memory_unsigned_integer (addr, 8, byte_order);
350 if ((cs & I386_SEL_RPL) == I386_SEL_UPL)
351 {
352 /* Trap from user space; terminate backtrace. */
353 trad_frame_set_id (cache, outer_frame_id);
354 }
355 else
356 {
357 /* Construct the frame ID using the function start. */
358 trad_frame_set_id (cache, frame_id_build (sp + 16, func));
359 }
360
361 return cache;
362 }
363
364 static void
365 amd64obsd_trapframe_this_id (struct frame_info *this_frame,
366 void **this_cache, struct frame_id *this_id)
367 {
368 struct trad_frame_cache *cache =
369 amd64obsd_trapframe_cache (this_frame, this_cache);
370
371 trad_frame_get_id (cache, this_id);
372 }
373
374 static struct value *
375 amd64obsd_trapframe_prev_register (struct frame_info *this_frame,
376 void **this_cache, int regnum)
377 {
378 struct trad_frame_cache *cache =
379 amd64obsd_trapframe_cache (this_frame, this_cache);
380
381 return trad_frame_get_register (cache, this_frame, regnum);
382 }
383
384 static int
385 amd64obsd_trapframe_sniffer (const struct frame_unwind *self,
386 struct frame_info *this_frame,
387 void **this_prologue_cache)
388 {
389 ULONGEST cs;
390 const char *name;
391
392 /* Check Current Privilege Level and bail out if we're not executing
393 in kernel space. */
394 cs = get_frame_register_unsigned (this_frame, AMD64_CS_REGNUM);
395 if ((cs & I386_SEL_RPL) == I386_SEL_UPL)
396 return 0;
397
398 find_pc_partial_function (get_frame_pc (this_frame), &name, NULL, NULL);
399 return (name && ((strcmp (name, "calltrap") == 0)
400 || (strcmp (name, "osyscall1") == 0)
401 || (strcmp (name, "Xsyscall") == 0)
402 || (startswith (name, "Xintr"))));
403 }
404
405 static const struct frame_unwind amd64obsd_trapframe_unwind = {
406 /* FIXME: kettenis/20051219: This really is more like an interrupt
407 frame, but SIGTRAMP_FRAME would print <signal handler called>,
408 which really is not what we want here. */
409 NORMAL_FRAME,
410 default_frame_unwind_stop_reason,
411 amd64obsd_trapframe_this_id,
412 amd64obsd_trapframe_prev_register,
413 NULL,
414 amd64obsd_trapframe_sniffer
415 };
416
417
418 static void
419 amd64obsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
420 {
421 struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
422
423 amd64_init_abi (info, gdbarch,
424 amd64_target_description (X86_XSTATE_SSE_MASK));
425 obsd_init_abi (info, gdbarch);
426
427 /* Initialize general-purpose register set details. */
428 tdep->gregset_reg_offset = amd64obsd_r_reg_offset;
429 tdep->gregset_num_regs = ARRAY_SIZE (amd64obsd_r_reg_offset);
430 tdep->sizeof_gregset = 24 * 8;
431
432 tdep->jb_pc_offset = 7 * 8;
433
434 tdep->sigtramp_p = amd64obsd_sigtramp_p;
435 tdep->sigcontext_addr = amd64obsd_sigcontext_addr;
436 tdep->sc_reg_offset = amd64obsd_sc_reg_offset;
437 tdep->sc_num_regs = ARRAY_SIZE (amd64obsd_sc_reg_offset);
438
439 /* OpenBSD provides a user-level threads implementation. */
440 bsd_uthread_set_supply_uthread (gdbarch, amd64obsd_supply_uthread);
441 bsd_uthread_set_collect_uthread (gdbarch, amd64obsd_collect_uthread);
442
443 /* OpenBSD uses SVR4-style shared libraries. */
444 set_solib_svr4_fetch_link_map_offsets
445 (gdbarch, svr4_lp64_fetch_link_map_offsets);
446
447 /* Unwind kernel trap frames correctly. */
448 frame_unwind_prepend_unwinder (gdbarch, &amd64obsd_trapframe_unwind);
449 }
450
451 void
452 _initialize_amd64obsd_tdep (void)
453 {
454 /* The OpenBSD/amd64 native dependent code makes this assumption. */
455 gdb_assert (ARRAY_SIZE (amd64obsd_r_reg_offset) == AMD64_NUM_GREGS);
456
457 gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64,
458 GDB_OSABI_OPENBSD, amd64obsd_init_abi);
459 }
gdbarch
Definition: gdbarch.c:127
gdbarch_tdep::jb_pc_offset
int jb_pc_offset
Definition: i386-tdep.h:210
trad_frame_set_reg_addr
void trad_frame_set_reg_addr(struct trad_frame_cache *this_trad_cache, int regnum, CORE_ADDR addr)
Definition: trad-frame.c:126
I386_SEL_UPL
#define I386_SEL_UPL
Definition: i386-tdep.h:381
frame_id_build
struct frame_id frame_id_build(CORE_ADDR stack_addr, CORE_ADDR code_addr)
Definition: frame.c:624
obsd-tdep.h
amd64obsd_page_size
static const int amd64obsd_page_size
Definition: amd64-obsd-tdep.c:42
get_frame_pc
CORE_ADDR get_frame_pc(struct frame_info *frame)
Definition: frame.c:2376
X86_XSTATE_SSE_MASK
#define X86_XSTATE_SSE_MASK
Definition: x86-xstate.h:42
CORE_ADDR
bfd_vma CORE_ADDR
Definition: common-types.h:41
svr4_lp64_fetch_link_map_offsets
struct link_map_offsets * svr4_lp64_fetch_link_map_offsets(void)
Definition: solib-svr4.c:3214
gdbarch_tdep::sc_num_regs
int sc_num_regs
Definition: i386-tdep.h:227
amd64_init_abi
void amd64_init_abi(struct gdbarch_info info, struct gdbarch *gdbarch, const target_desc *default_tdesc)
Definition: amd64-tdep.c:3037
AMD64_RIP_REGNUM
Definition: amd64-tdep.h:50
write_memory_unsigned_integer
void write_memory_unsigned_integer(CORE_ADDR addr, int len, enum bfd_endian byte_order, ULONGEST value)
Definition: corefile.c:417
amd64obsd_trapframe_this_id
static void amd64obsd_trapframe_this_id(struct frame_info *this_frame, void **this_cache, struct frame_id *this_id)
Definition: amd64-obsd-tdep.c:365
func
void(* func)(char *)
Definition: remote-fileio.c:1104
trad_frame_set_id
void trad_frame_set_id(struct trad_frame_cache *this_trad_cache, struct frame_id this_id)
Definition: trad-frame.c:171
amd64obsd_tf_reg_offset
#define amd64obsd_tf_reg_offset
Definition: amd64-obsd-tdep.c:315
_initialize_amd64obsd_tdep
void _initialize_amd64obsd_tdep(void)
Definition: amd64-obsd-tdep.c:452
gdbarch_tdep::pc
struct m32c_reg * pc
Definition: m32c-tdep.c:116
gdbarch_tdep
Definition: aarch64-tdep.h:55
gdbarch_tdep::sigcontext_addr
CORE_ADDR(* sigcontext_addr)(struct frame_info *)
Definition: alpha-tdep.h:82
frame_info
Definition: frame.c:85
x86-xstate.h
bsd_uthread_set_collect_uthread
void bsd_uthread_set_collect_uthread(struct gdbarch *gdbarch, void(*collect_uthread)(const struct regcache *, int, CORE_ADDR))
Definition: bsd-uthread.c:81
defs.h
gdbarch_tdep
struct gdbarch_tdep * gdbarch_tdep(struct gdbarch *gdbarch)
Definition: gdbarch.c:1491
obsd_init_abi
void obsd_init_abi(struct gdbarch_info info, struct gdbarch *gdbarch)
Definition: obsd-tdep.c:319
frame_unwind_prepend_unwinder
void frame_unwind_prepend_unwinder(struct gdbarch *gdbarch, const struct frame_unwind *unwinder)
Definition: frame-unwind.c:64
objfiles.h
amd64obsd_trapframe_unwind
static const struct frame_unwind amd64obsd_trapframe_unwind
Definition: amd64-obsd-tdep.c:405
symtab.h
trad_frame_get_id
void trad_frame_get_id(struct trad_frame_cache *this_trad_cache, struct frame_id *this_id)
Definition: trad-frame.c:178
name
const char *const name
Definition: aarch64-tdep.c:76
NORMAL_FRAME
Definition: frame.h:244
amd64obsd_sigcontext_addr
static CORE_ADDR amd64obsd_sigcontext_addr(struct frame_info *this_frame)
Definition: amd64-obsd-tdep.c:101
trad-frame.h
solib-svr4.h
extract_unsigned_integer
static ULONGEST extract_unsigned_integer(const gdb_byte *addr, int len, enum bfd_endian byte_order)
Definition: defs.h:577
safe_frame_unwind_memory
int safe_frame_unwind_memory(struct frame_info *this_frame, CORE_ADDR addr, gdb_byte *buf, int len)
Definition: frame.c:2681
osabi.h
trad_frame_cache
Definition: trad-frame.c:27
regcache.h
frame.h
gdbarch_byte_order
enum bfd_endian gdbarch_byte_order(struct gdbarch *gdbarch)
Definition: gdbarch.c:1509
AMD64_NUM_GREGS
#define AMD64_NUM_GREGS
Definition: amd64-tdep.h:86
AMD64_RSP_REGNUM
Definition: amd64-tdep.h:41
set_solib_svr4_fetch_link_map_offsets
void set_solib_svr4_fetch_link_map_offsets(struct gdbarch *gdbarch, struct link_map_offsets *(*flmo)(void))
Definition: solib-svr4.c:3137
amd64obsd_r_reg_offset
int amd64obsd_r_reg_offset[]
Definition: amd64-obsd-tdep.c:130
find_pc_partial_function
int find_pc_partial_function(CORE_ADDR pc, const char **name, CORE_ADDR *address, CORE_ADDR *endaddr)
Definition: blockframe.c:320
frame-unwind.h
amd64obsd_trapframe_cache
static struct trad_frame_cache * amd64obsd_trapframe_cache(struct frame_info *this_frame, void **this_cache)
Definition: amd64-obsd-tdep.c:318
startswith
static int startswith(const char *string, const char *pattern)
Definition: common-utils.h:107
amd64obsd_collect_uthread
static void amd64obsd_collect_uthread(const struct regcache *regcache, int regnum, CORE_ADDR addr)
Definition: amd64-obsd-tdep.c:265
trad_frame_cache_zalloc
struct trad_frame_cache * trad_frame_cache_zalloc(struct frame_info *this_frame)
Definition: trad-frame.c:36
amd64-tdep.h
regnum
int regnum
Definition: aarch64-tdep.c:77
read_memory
void read_memory(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
Definition: corefile.c:258
find_pc_section
struct obj_section * find_pc_section(CORE_ADDR pc)
Definition: objfiles.c:1395
get_frame_register_unsigned
ULONGEST get_frame_register_unsigned(struct frame_info *frame, int regnum)
Definition: frame.c:1308
gdbarch_register_osabi
void gdbarch_register_osabi(enum bfd_architecture arch, unsigned long machine, enum gdb_osabi osabi, void(*init_osabi)(struct gdbarch_info, struct gdbarch *))
Definition: osabi.c:143
AMD64_RDI_REGNUM
Definition: amd64-tdep.h:39
trad_frame_cache::this_frame
struct frame_info * this_frame
Definition: trad-frame.c:29
AMD64OBSD_UTHREAD_RSP_OFFSET
#define AMD64OBSD_UTHREAD_RSP_OFFSET
Definition: amd64-obsd-tdep.c:218
gdb_assert
#define gdb_assert(expr)
Definition: gdb_assert.h:32
amd64obsd_uthread_reg_offset
static int amd64obsd_uthread_reg_offset[]
Definition: amd64-obsd-tdep.c:188
value
Definition: value.c:169
gdbarch_tdep::gregset_reg_offset
int * gregset_reg_offset
Definition: i386-tdep.h:61
amd64obsd_init_abi
static void amd64obsd_init_abi(struct gdbarch_info info, struct gdbarch *gdbarch)
Definition: amd64-obsd-tdep.c:419
amd64obsd_supply_uthread
static void amd64obsd_supply_uthread(struct regcache *regcache, int regnum, CORE_ADDR addr)
Definition: amd64-obsd-tdep.c:221
amd64obsd_trapframe_sniffer
static int amd64obsd_trapframe_sniffer(const struct frame_unwind *self, struct frame_info *this_frame, void **this_prologue_cache)
Definition: amd64-obsd-tdep.c:385
trad_frame_cache::this_id
struct frame_id this_id
Definition: trad-frame.c:32
gdb_byte
bfd_byte gdb_byte
Definition: common-types.h:38
I386_SEL_RPL
#define I386_SEL_RPL
Definition: i386-tdep.h:380
gdbarch_tdep::sigtramp_p
int(* sigtramp_p)(struct frame_info *)
Definition: i386-tdep.h:220
amd64obsd_sc_reg_offset
static int amd64obsd_sc_reg_offset[]
Definition: amd64-obsd-tdep.c:159
gdbcore.h
offset
int offset
Definition: agent.c:65
regcache::arch
gdbarch * arch() const
Definition: regcache.c:221
gdbarch_tdep::sizeof_gregset
size_t sizeof_gregset
Definition: i386-tdep.h:63
target.h
bsd-uthread.h
frame_unwind
Definition: frame-unwind.h:144
regcache_raw_supply
void regcache_raw_supply(struct regcache *regcache, int regnum, const void *buf)
Definition: regcache.c:1004
gdbarch_tdep::sc_reg_offset
int * sc_reg_offset
Definition: i386-tdep.h:226
ULONGEST
unsigned long long ULONGEST
Definition: common-types.h:53
default_frame_unwind_stop_reason
enum unwind_stop_reason default_frame_unwind_stop_reason(struct frame_info *this_frame, void **this_cache)
Definition: frame-unwind.c:184
outer_frame_id
const struct frame_id outer_frame_id
Definition: frame.c:577
regcache
Definition: regcache.h:232
gdbarch_info
Definition: gdbarch.h:1626
regcache_raw_collect
void regcache_raw_collect(const struct regcache *regcache, int regnum, void *buf)
Definition: regcache.c:1085
regset.h
read_memory_unsigned_integer
ULONGEST read_memory_unsigned_integer(CORE_ADDR memaddr, int len, enum bfd_endian byte_order)
Definition: corefile.c:326
amd64obsd_trapframe_prev_register
static struct value * amd64obsd_trapframe_prev_register(struct frame_info *this_frame, void **this_cache, int regnum)
Definition: amd64-obsd-tdep.c:375
write_memory
void write_memory(CORE_ADDR memaddr, const bfd_byte *myaddr, ssize_t len)
Definition: corefile.c:394
i387-tdep.h
GDB_OSABI_OPENBSD
Definition: defs.h:520
bsd_uthread_set_supply_uthread
void bsd_uthread_set_supply_uthread(struct gdbarch *gdbarch, void(*supply_uthread)(struct regcache *, int, CORE_ADDR))
Definition: bsd-uthread.c:67
gdbarch_tdep::gregset_num_regs
int gregset_num_regs
Definition: i386-tdep.h:62
amd64_target_description
const struct target_desc * amd64_target_description(uint64_t xcr0)
Definition: amd64-tdep.c:3246
trad_frame_get_register
struct value * trad_frame_get_register(struct trad_frame_cache *this_trad_cache, struct frame_info *this_frame, int regnum)
Definition: trad-frame.c:162
gdbarch::byte_order
enum bfd_endian byte_order
Definition: gdbarch.c:137
get_frame_func
CORE_ADDR get_frame_func(struct frame_info *this_frame)
Definition: frame.c:1001
frame_id
Definition: frame.h:111
get_frame_arch
struct gdbarch * get_frame_arch(struct frame_info *this_frame)
Definition: frame.c:2691
amd64obsd_sigtramp_p
static int amd64obsd_sigtramp_p(struct frame_info *this_frame)
Definition: amd64-obsd-tdep.c:48
AMD64_CS_REGNUM
Definition: amd64-tdep.h:52
store_unsigned_integer
static void store_unsigned_integer(gdb_byte *addr, int len, enum bfd_endian byte_order, ULONGEST val)
Definition: defs.h:604