GDB (xrefs)
/tmp/gdb-7.10/gdb/i386obsd-tdep.c
Go to the documentation of this file.
1 /* Target-dependent code for OpenBSD/i386.
2 
3  Copyright (C) 1988-2015 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 "arch-utils.h"
22 #include "frame.h"
23 #include "frame-unwind.h"
24 #include "gdbcore.h"
25 #include "regcache.h"
26 #include "regset.h"
27 #include "symtab.h"
28 #include "objfiles.h"
29 #include "osabi.h"
30 #include "target.h"
31 #include "trad-frame.h"
32 
33 #include "obsd-tdep.h"
34 #include "i386-tdep.h"
35 #include "i387-tdep.h"
36 #include "solib-svr4.h"
37 #include "bsd-uthread.h"
38 
39 /* Support for signal handlers. */
40 
41 /* Since OpenBSD 3.2, the sigtramp routine is mapped at a random page
42  in virtual memory. The randomness makes it somewhat tricky to
43  detect it, but fortunately we can rely on the fact that the start
44  of the sigtramp routine is page-aligned. We recognize the
45  trampoline by looking for the code that invokes the sigreturn
46  system call. The offset where we can find that code varies from
47  release to release.
48 
49  By the way, the mapping mentioned above is read-only, so you cannot
50  place a breakpoint in the signal trampoline. */
51 
52 /* Default page size. */
53 static const int i386obsd_page_size = 4096;
54 
55 /* Offset for sigreturn(2). */
56 static const int i386obsd_sigreturn_offset[] = {
57  0x0a, /* OpenBSD 3.2 */
58  0x14, /* OpenBSD 3.6 */
59  0x3a, /* OpenBSD 3.8 */
60  -1
61 };
62 
63 /* Return whether THIS_FRAME corresponds to an OpenBSD sigtramp
64  routine. */
65 
66 static int
67 i386obsd_sigtramp_p (struct frame_info *this_frame)
68 {
69  CORE_ADDR pc = get_frame_pc (this_frame);
70  CORE_ADDR start_pc = (pc & ~(i386obsd_page_size - 1));
71  /* The call sequence invoking sigreturn(2). */
72  const gdb_byte sigreturn[] =
73  {
74  0xb8,
75  0x67, 0x00, 0x00, 0x00, /* movl $SYS_sigreturn, %eax */
76  0xcd, 0x80 /* int $0x80 */
77  };
78  size_t buflen = sizeof sigreturn;
79  const int *offset;
80  gdb_byte *buf;
81  const char *name;
82 
83  /* If the function has a valid symbol name, it isn't a
84  trampoline. */
85  find_pc_partial_function (pc, &name, NULL, NULL);
86  if (name != NULL)
87  return 0;
88 
89  /* If the function lives in a valid section (even without a starting
90  point) it isn't a trampoline. */
91  if (find_pc_section (pc) != NULL)
92  return 0;
93 
94  /* Allocate buffer. */
95  buf = alloca (buflen);
96 
97  /* Loop over all offsets. */
98  for (offset = i386obsd_sigreturn_offset; *offset != -1; offset++)
99  {
100  /* If we can't read the instructions, return zero. */
101  if (!safe_frame_unwind_memory (this_frame, start_pc + *offset,
102  buf, buflen))
103  return 0;
104 
105  /* Check for sigreturn(2). */
106  if (memcmp (buf, sigreturn, buflen) == 0)
107  return 1;
108  }
109 
110  return 0;
111 }
112 
113 /* Mapping between the general-purpose registers in `struct reg'
114  format and GDB's register cache layout. */
115 
116 /* From <machine/reg.h>. */
117 static int i386obsd_r_reg_offset[] =
118 {
119  0 * 4, /* %eax */
120  1 * 4, /* %ecx */
121  2 * 4, /* %edx */
122  3 * 4, /* %ebx */
123  4 * 4, /* %esp */
124  5 * 4, /* %ebp */
125  6 * 4, /* %esi */
126  7 * 4, /* %edi */
127  8 * 4, /* %eip */
128  9 * 4, /* %eflags */
129  10 * 4, /* %cs */
130  11 * 4, /* %ss */
131  12 * 4, /* %ds */
132  13 * 4, /* %es */
133  14 * 4, /* %fs */
134  15 * 4 /* %gs */
135 };
136 
137 static void
139  struct regcache *regcache, int regnum,
140  const void *regs, size_t len)
141 {
142  struct gdbarch *gdbarch = get_regcache_arch (regcache);
143  const struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
144  const gdb_byte *gregs = regs;
145 
147 
148  i386_supply_gregset (regset, regcache, regnum, regs, tdep->sizeof_gregset);
149  i387_supply_fsave (regcache, regnum, gregs + tdep->sizeof_gregset);
150 }
151 
152 static const struct regset i386obsd_aout_gregset =
153  {
154  NULL, i386obsd_aout_supply_regset, NULL
155  };
156 
157 static void
160  void *cb_data,
161  const struct regcache *regcache)
162 {
163  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
164 
165  /* OpenBSD a.out core dumps don't use seperate register sets for the
166  general-purpose and floating-point registers. */
167 
168  cb (".reg", tdep->sizeof_gregset + I387_SIZEOF_FSAVE,
169  &i386obsd_aout_gregset, NULL, cb_data);
170 }
171 
172 
173 /* Sigtramp routine location for OpenBSD 3.1 and earlier releases. */
176 
177 /* From <machine/signal.h>. */
179 {
180  10 * 4, /* %eax */
181  9 * 4, /* %ecx */
182  8 * 4, /* %edx */
183  7 * 4, /* %ebx */
184  14 * 4, /* %esp */
185  6 * 4, /* %ebp */
186  5 * 4, /* %esi */
187  4 * 4, /* %edi */
188  11 * 4, /* %eip */
189  13 * 4, /* %eflags */
190  12 * 4, /* %cs */
191  15 * 4, /* %ss */
192  3 * 4, /* %ds */
193  2 * 4, /* %es */
194  1 * 4, /* %fs */
195  0 * 4 /* %gs */
196 };
197 
198 /* From /usr/src/lib/libpthread/arch/i386/uthread_machdep.c. */
200 {
201  11 * 4, /* %eax */
202  10 * 4, /* %ecx */
203  9 * 4, /* %edx */
204  8 * 4, /* %ebx */
205  -1, /* %esp */
206  6 * 4, /* %ebp */
207  5 * 4, /* %esi */
208  4 * 4, /* %edi */
209  12 * 4, /* %eip */
210  -1, /* %eflags */
211  13 * 4, /* %cs */
212  -1, /* %ss */
213  3 * 4, /* %ds */
214  2 * 4, /* %es */
215  1 * 4, /* %fs */
216  0 * 4 /* %gs */
217 };
218 
219 /* Offset within the thread structure where we can find the saved
220  stack pointer (%esp). */
221 #define I386OBSD_UTHREAD_ESP_OFFSET 176
222 
223 static void
225  int regnum, CORE_ADDR addr)
226 {
227  struct gdbarch *gdbarch = get_regcache_arch (regcache);
228  enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
229  CORE_ADDR sp_addr = addr + I386OBSD_UTHREAD_ESP_OFFSET;
230  CORE_ADDR sp = 0;
231  gdb_byte buf[4];
232  int i;
233 
234  gdb_assert (regnum >= -1);
235 
236  if (regnum == -1 || regnum == I386_ESP_REGNUM)
237  {
238  int offset;
239 
240  /* Fetch stack pointer from thread structure. */
241  sp = read_memory_unsigned_integer (sp_addr, 4, byte_order);
242 
243  /* Adjust the stack pointer such that it looks as if we just
244  returned from _thread_machdep_switch. */
246  store_unsigned_integer (buf, 4, byte_order, sp + offset);
247  regcache_raw_supply (regcache, I386_ESP_REGNUM, buf);
248  }
249 
250  for (i = 0; i < ARRAY_SIZE (i386obsd_uthread_reg_offset); i++)
251  {
252  if (i386obsd_uthread_reg_offset[i] != -1
253  && (regnum == -1 || regnum == i))
254  {
255  /* Fetch stack pointer from thread structure (if we didn't
256  do so already). */
257  if (sp == 0)
258  sp = read_memory_unsigned_integer (sp_addr, 4, byte_order);
259 
260  /* Read the saved register from the stack frame. */
261  read_memory (sp + i386obsd_uthread_reg_offset[i], buf, 4);
262  regcache_raw_supply (regcache, i, buf);
263  }
264  }
265 }
266 
267 static void
269  int regnum, CORE_ADDR addr)
270 {
271  struct gdbarch *gdbarch = get_regcache_arch (regcache);
272  enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
273  CORE_ADDR sp_addr = addr + I386OBSD_UTHREAD_ESP_OFFSET;
274  CORE_ADDR sp = 0;
275  gdb_byte buf[4];
276  int i;
277 
278  gdb_assert (regnum >= -1);
279 
280  if (regnum == -1 || regnum == I386_ESP_REGNUM)
281  {
282  int offset;
283 
284  /* Calculate the stack pointer (frame pointer) that will be
285  stored into the thread structure. */
287  regcache_raw_collect (regcache, I386_ESP_REGNUM, buf);
288  sp = extract_unsigned_integer (buf, 4, byte_order) - offset;
289 
290  /* Store the stack pointer. */
291  write_memory_unsigned_integer (sp_addr, 4, byte_order, sp);
292 
293  /* The stack pointer was (potentially) modified. Make sure we
294  build a proper stack frame. */
295  regnum = -1;
296  }
297 
298  for (i = 0; i < ARRAY_SIZE (i386obsd_uthread_reg_offset); i++)
299  {
300  if (i386obsd_uthread_reg_offset[i] != -1
301  && (regnum == -1 || regnum == i))
302  {
303  /* Fetch stack pointer from thread structure (if we didn't
304  calculate it already). */
305  if (sp == 0)
306  sp = read_memory_unsigned_integer (sp_addr, 4, byte_order);
307 
308  /* Write the register into the stack frame. */
309  regcache_raw_collect (regcache, i, buf);
310  write_memory (sp + i386obsd_uthread_reg_offset[i], buf, 4);
311  }
312  }
313 }
314 
315 /* Kernel debugging support. */
316 
317 /* From <machine/frame.h>. Note that %esp and %ess are only saved in
318  a trap frame when entering the kernel from user space. */
320 {
321  10 * 4, /* %eax */
322  9 * 4, /* %ecx */
323  8 * 4, /* %edx */
324  7 * 4, /* %ebx */
325  -1, /* %esp */
326  6 * 4, /* %ebp */
327  5 * 4, /* %esi */
328  4 * 4, /* %edi */
329  13 * 4, /* %eip */
330  15 * 4, /* %eflags */
331  14 * 4, /* %cs */
332  -1, /* %ss */
333  3 * 4, /* %ds */
334  2 * 4, /* %es */
335  0 * 4, /* %fs */
336  1 * 4 /* %gs */
337 };
338 
339 static struct trad_frame_cache *
340 i386obsd_trapframe_cache (struct frame_info *this_frame, void **this_cache)
341 {
342  struct gdbarch *gdbarch = get_frame_arch (this_frame);
343  enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
344  struct trad_frame_cache *cache;
345  CORE_ADDR func, sp, addr;
346  ULONGEST cs;
347  const char *name;
348  int i;
349 
350  if (*this_cache)
351  return *this_cache;
352 
353  cache = trad_frame_cache_zalloc (this_frame);
354  *this_cache = cache;
355 
356  func = get_frame_func (this_frame);
357  sp = get_frame_register_unsigned (this_frame, I386_ESP_REGNUM);
358 
359  find_pc_partial_function (func, &name, NULL, NULL);
360  if (name && startswith (name, "Xintr"))
361  addr = sp + 8; /* It's an interrupt frame. */
362  else
363  addr = sp;
364 
365  for (i = 0; i < ARRAY_SIZE (i386obsd_tf_reg_offset); i++)
366  if (i386obsd_tf_reg_offset[i] != -1)
367  trad_frame_set_reg_addr (cache, i, addr + i386obsd_tf_reg_offset[i]);
368 
369  /* Read %cs from trap frame. */
371  cs = read_memory_unsigned_integer (addr, 4, byte_order);
372  if ((cs & I386_SEL_RPL) == I386_SEL_UPL)
373  {
374  /* Trap from user space; terminate backtrace. */
376  }
377  else
378  {
379  /* Construct the frame ID using the function start. */
380  trad_frame_set_id (cache, frame_id_build (sp + 8, func));
381  }
382 
383  return cache;
384 }
385 
386 static void
388  void **this_cache, struct frame_id *this_id)
389 {
390  struct trad_frame_cache *cache =
391  i386obsd_trapframe_cache (this_frame, this_cache);
392 
393  trad_frame_get_id (cache, this_id);
394 }
395 
396 static struct value *
398  void **this_cache, int regnum)
399 {
400  struct trad_frame_cache *cache =
401  i386obsd_trapframe_cache (this_frame, this_cache);
402 
403  return trad_frame_get_register (cache, this_frame, regnum);
404 }
405 
406 static int
408  struct frame_info *this_frame,
409  void **this_prologue_cache)
410 {
411  ULONGEST cs;
412  const char *name;
413 
414  /* Check Current Privilege Level and bail out if we're not executing
415  in kernel space. */
416  cs = get_frame_register_unsigned (this_frame, I386_CS_REGNUM);
417  if ((cs & I386_SEL_RPL) == I386_SEL_UPL)
418  return 0;
419 
420  find_pc_partial_function (get_frame_pc (this_frame), &name, NULL, NULL);
421  return (name && (strcmp (name, "calltrap") == 0
422  || strcmp (name, "syscall1") == 0
423  || startswith (name, "Xintr")
424  || startswith (name, "Xsoft")));
425 }
426 
427 static const struct frame_unwind i386obsd_trapframe_unwind = {
428  /* FIXME: kettenis/20051219: This really is more like an interrupt
429  frame, but SIGTRAMP_FRAME would print <signal handler called>,
430  which really is not what we want here. */
431  NORMAL_FRAME,
435  NULL,
437 };
438 
439 
440 static void
442 {
443  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
444 
445  /* Obviously OpenBSD is BSD-based. */
446  i386bsd_init_abi (info, gdbarch);
447  obsd_init_abi (info, gdbarch);
448 
449  /* OpenBSD has a different `struct reg'. */
451  tdep->gregset_num_regs = ARRAY_SIZE (i386obsd_r_reg_offset);
452  tdep->sizeof_gregset = 16 * 4;
453 
454  /* OpenBSD uses -freg-struct-return by default. */
456 
457  /* OpenBSD uses a different memory layout. */
461 
462  /* OpenBSD has a `struct sigcontext' that's different from the
463  original 4.3 BSD. */
465  tdep->sc_num_regs = ARRAY_SIZE (i386obsd_sc_reg_offset);
466 
467  /* OpenBSD provides a user-level threads implementation. */
470 
471  /* Unwind kernel trap frames correctly. */
472  frame_unwind_prepend_unwinder (gdbarch, &i386obsd_trapframe_unwind);
473 }
474 
475 /* OpenBSD a.out. */
476 
477 static void
479 {
480  i386obsd_init_abi (info, gdbarch);
481 
482  /* OpenBSD a.out has a single register set. */
485 }
486 
487 /* OpenBSD ELF. */
488 
489 static void
491 {
492  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
493 
494  /* It's still OpenBSD. */
495  i386obsd_init_abi (info, gdbarch);
496 
497  /* But ELF-based. */
498  i386_elf_init_abi (info, gdbarch);
499 
500  /* OpenBSD ELF uses SVR4-style shared libraries. */
503 }
504 
505 
506 /* Provide a prototype to silence -Wmissing-prototypes. */
507 void _initialize_i386obsd_tdep (void);
508 
509 void
511 {
512  /* FIXME: kettenis/20021020: Since OpenBSD/i386 binaries are
513  indistingushable from NetBSD/i386 a.out binaries, building a GDB
514  that should support both these targets will probably not work as
515  expected. */
516 #define GDB_OSABI_OPENBSD_AOUT GDB_OSABI_NETBSD_AOUT
517 
522 }
void i386_supply_gregset(const struct regset *regset, struct regcache *regcache, int regnum, const void *gregs, size_t len)
Definition: i386-tdep.c:3730
ULONGEST extract_unsigned_integer(const gdb_byte *, int, enum bfd_endian)
Definition: findvar.c:84
#define I386_NUM_GREGS
Definition: i386-tdep.h:320
void trad_frame_set_reg_addr(struct trad_frame_cache *this_trad_cache, int regnum, CORE_ADDR addr)
Definition: trad-frame.c:119
#define I386_SEL_UPL
Definition: i386-tdep.h:365
struct frame_id frame_id_build(CORE_ADDR stack_addr, CORE_ADDR code_addr)
Definition: frame.c:554
CORE_ADDR get_frame_pc(struct frame_info *frame)
Definition: frame.c:2217
void i386bsd_init_abi(struct gdbarch_info, struct gdbarch *)
Definition: i386bsd-tdep.c:75
bfd_vma CORE_ADDR
Definition: common-types.h:41
int sc_num_regs
Definition: i386-tdep.h:216
struct gdbarch * get_regcache_arch(const struct regcache *regcache)
Definition: regcache.c:297
void write_memory_unsigned_integer(CORE_ADDR addr, int len, enum bfd_endian byte_order, ULONGEST value)
Definition: corefile.c:412
void(* func)(char *)
CORE_ADDR sigtramp_start
Definition: i386-tdep.h:205
static void i386obsd_supply_uthread(struct regcache *regcache, int regnum, CORE_ADDR addr)
static struct trad_frame_cache * i386obsd_trapframe_cache(struct frame_info *this_frame, void **this_cache)
void trad_frame_set_id(struct trad_frame_cache *this_trad_cache, struct frame_id this_id)
Definition: trad-frame.c:164
CORE_ADDR sigtramp_end
Definition: i386-tdep.h:206
CORE_ADDR i386obsd_sigtramp_end_addr
struct m32c_reg * pc
Definition: m32c-tdep.c:111
#define GDB_OSABI_OPENBSD_AOUT
struct link_map_offsets * svr4_ilp32_fetch_link_map_offsets(void)
Definition: solib-svr4.c:3149
void i387_supply_fsave(struct regcache *regcache, int regnum, const void *fsave)
Definition: i387-tdep.c:447
void bsd_uthread_set_collect_uthread(struct gdbarch *gdbarch, void(*collect_uthread)(const struct regcache *, int, CORE_ADDR))
Definition: bsd-uthread.c:79
struct gdbarch_tdep * gdbarch_tdep(struct gdbarch *gdbarch)
Definition: gdbarch.c:1402
void obsd_init_abi(struct gdbarch_info info, struct gdbarch *gdbarch)
Definition: obsd-tdep.c:319
static const int i386obsd_sigreturn_offset[]
Definition: i386obsd-tdep.c:56
void frame_unwind_prepend_unwinder(struct gdbarch *gdbarch, const struct frame_unwind *unwinder)
Definition: frame-unwind.c:64
void store_unsigned_integer(gdb_byte *, int, enum bfd_endian, ULONGEST)
Definition: findvar.c:212
Definition: regset.h:34
void trad_frame_get_id(struct trad_frame_cache *this_trad_cache, struct frame_id *this_id)
Definition: trad-frame.c:171
const char *const name
Definition: aarch64-tdep.c:68
void _initialize_i386obsd_tdep(void)
enum struct_return struct_return
Definition: arm-tdep.h:197
static void i386obsd_aout_init_abi(struct gdbarch_info info, struct gdbarch *gdbarch)
int safe_frame_unwind_memory(struct frame_info *this_frame, CORE_ADDR addr, gdb_byte *buf, int len)
Definition: frame.c:2525
enum bfd_endian gdbarch_byte_order(struct gdbarch *gdbarch)
Definition: gdbarch.c:1420
void set_solib_svr4_fetch_link_map_offsets(struct gdbarch *gdbarch, struct link_map_offsets *(*flmo)(void))
Definition: solib-svr4.c:3108
int find_pc_partial_function(CORE_ADDR pc, const char **name, CORE_ADDR *address, CORE_ADDR *endaddr)
Definition: blockframe.c:321
#define gdb_assert(expr)
Definition: gdb_assert.h:33
static int i386obsd_trapframe_sniffer(const struct frame_unwind *self, struct frame_info *this_frame, void **this_prologue_cache)
static int startswith(const char *string, const char *pattern)
Definition: common-utils.h:75
struct trad_frame_cache * trad_frame_cache_zalloc(struct frame_info *this_frame)
Definition: trad-frame.c:36
static void i386obsd_collect_uthread(const struct regcache *regcache, int regnum, CORE_ADDR addr)
static int i386obsd_tf_reg_offset[]
int regnum
Definition: aarch64-tdep.c:69
void read_memory(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
Definition: corefile.c:244
void( iterate_over_regset_sections_cb)(const char *sect_name, int size, const struct regset *regset, const char *human_name, void *cb_data)
Definition: gdbarch.h:98
struct obj_section * find_pc_section(CORE_ADDR pc)
Definition: objfiles.c:1337
ULONGEST get_frame_register_unsigned(struct frame_info *frame, int regnum)
Definition: frame.c:1194
struct frame_info * this_frame
Definition: trad-frame.c:29
static const int i386obsd_page_size
Definition: i386obsd-tdep.c:53
static void i386obsd_aout_supply_regset(const struct regset *regset, struct regcache *regcache, int regnum, const void *regs, size_t len)
static void i386obsd_trapframe_this_id(struct frame_info *this_frame, void **this_cache, struct frame_id *this_id)
Definition: value.c:172
int * gregset_reg_offset
Definition: i386-tdep.h:59
struct frame_id this_id
Definition: trad-frame.c:32
static int i386obsd_r_reg_offset[]
static int i386obsd_sigtramp_p(struct frame_info *this_frame)
Definition: i386obsd-tdep.c:67
bfd_byte gdb_byte
Definition: common-types.h:38
#define I386_SEL_RPL
Definition: i386-tdep.h:364
int(* sigtramp_p)(struct frame_info *)
Definition: i386-tdep.h:209
static void i386obsd_elf_init_abi(struct gdbarch_info info, struct gdbarch *gdbarch)
void i386_elf_init_abi(struct gdbarch_info info, struct gdbarch *gdbarch)
Definition: i386-tdep.c:4332
int offset
Definition: agent.c:65
int i386obsd_sc_reg_offset[I386_NUM_GREGS]
size_t sizeof_gregset
Definition: i386-tdep.h:61
#define I387_SIZEOF_FSAVE
Definition: i387-tdep.h:111
struct m32c_reg regs[M32C_MAX_NUM_REGS]
Definition: m32c-tdep.c:105
void regcache_raw_supply(struct regcache *regcache, int regnum, const void *buf)
Definition: regcache.c:1041
int * sc_reg_offset
Definition: i386-tdep.h:215
unsigned long long ULONGEST
Definition: common-types.h:53
enum unwind_stop_reason default_frame_unwind_stop_reason(struct frame_info *this_frame, void **this_cache)
Definition: frame-unwind.c:180
const struct frame_id outer_frame_id
Definition: frame.c:507
#define I386OBSD_UTHREAD_ESP_OFFSET
void regcache_raw_collect(const struct regcache *regcache, int regnum, void *buf)
Definition: regcache.c:1071
static void i386obsd_aout_iterate_over_regset_sections(struct gdbarch *gdbarch, iterate_over_regset_sections_cb *cb, void *cb_data, const struct regcache *regcache)
ULONGEST read_memory_unsigned_integer(CORE_ADDR memaddr, int len, enum bfd_endian byte_order)
Definition: corefile.c:321
static struct value * i386obsd_trapframe_prev_register(struct frame_info *this_frame, void **this_cache, int regnum)
void set_gdbarch_iterate_over_regset_sections(struct gdbarch *gdbarch, gdbarch_iterate_over_regset_sections_ftype iterate_over_regset_sections)
Definition: gdbarch.c:3398
void write_memory(CORE_ADDR memaddr, const bfd_byte *myaddr, ssize_t len)
Definition: corefile.c:389
void bsd_uthread_set_supply_uthread(struct gdbarch *gdbarch, void(*supply_uthread)(struct regcache *, int, CORE_ADDR))
Definition: bsd-uthread.c:67
int gregset_num_regs
Definition: i386-tdep.h:60
struct value * trad_frame_get_register(struct trad_frame_cache *this_trad_cache, struct frame_info *this_frame, int regnum)
Definition: trad-frame.c:155
enum bfd_endian byte_order
Definition: gdbarch.c:128
CORE_ADDR get_frame_func(struct frame_info *this_frame)
Definition: frame.c:920
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:148
static int i386obsd_uthread_reg_offset[]
CORE_ADDR i386obsd_sigtramp_start_addr
struct gdbarch * get_frame_arch(struct frame_info *this_frame)
Definition: frame.c:2535
const ULONGEST const LONGEST len
Definition: target.h:309
static void i386obsd_init_abi(struct gdbarch_info info, struct gdbarch *gdbarch)