GDB (xrefs)
/tmp/gdb-7.10/gdb/bsd-uthread.c
Go to the documentation of this file.
1 /* BSD user-level threads support.
2 
3  Copyright (C) 2005-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 "gdbcore.h"
22 #include "gdbthread.h"
23 #include "inferior.h"
24 #include "objfiles.h"
25 #include "observer.h"
26 #include "regcache.h"
27 #include "solib.h"
28 #include "solist.h"
29 #include "symfile.h"
30 #include "target.h"
31 
32 #include "gdb_obstack.h"
33 
34 #include "bsd-uthread.h"
35 
36 /* HACK: Save the bsd_uthreads ops returned by bsd_uthread_target. */
38 
39 
40 /* Architecture-specific operations. */
41 
42 /* Per-architecture data key. */
44 
46 {
47  /* Supply registers for an inactive thread to a register cache. */
48  void (*supply_uthread)(struct regcache *, int, CORE_ADDR);
49 
50  /* Collect registers for an inactive thread from a register cache. */
51  void (*collect_uthread)(const struct regcache *, int, CORE_ADDR);
52 };
53 
54 static void *
55 bsd_uthread_init (struct obstack *obstack)
56 {
57  struct bsd_uthread_ops *ops;
58 
59  ops = OBSTACK_ZALLOC (obstack, struct bsd_uthread_ops);
60  return ops;
61 }
62 
63 /* Set the function that supplies registers from an inactive thread
64  for architecture GDBARCH to SUPPLY_UTHREAD. */
65 
66 void
67 bsd_uthread_set_supply_uthread (struct gdbarch *gdbarch,
68  void (*supply_uthread) (struct regcache *,
69  int, CORE_ADDR))
70 {
71  struct bsd_uthread_ops *ops = gdbarch_data (gdbarch, bsd_uthread_data);
73 }
74 
75 /* Set the function that collects registers for an inactive thread for
76  architecture GDBARCH to SUPPLY_UTHREAD. */
77 
78 void
79 bsd_uthread_set_collect_uthread (struct gdbarch *gdbarch,
80  void (*collect_uthread) (const struct regcache *,
81  int, CORE_ADDR))
82 {
83  struct bsd_uthread_ops *ops = gdbarch_data (gdbarch, bsd_uthread_data);
85 }
86 
87 /* Magic number to help recognize a valid thread structure. */
88 #define BSD_UTHREAD_PTHREAD_MAGIC 0xd09ba115
89 
90 /* Check whether the thread structure at ADDR is valid. */
91 
92 static void
94 {
95  enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
96  ULONGEST magic = read_memory_unsigned_integer (addr, 4, byte_order);
97 
98  if (magic != BSD_UTHREAD_PTHREAD_MAGIC)
99  error (_("Bad magic"));
100 }
101 
102 /* Thread states. */
103 #define BSD_UTHREAD_PS_RUNNING 0
104 #define BSD_UTHREAD_PS_DEAD 18
105 
106 /* Address of the pointer to the thread structure for the running
107  thread. */
109 
110 /* Address of the list of all threads. */
112 
113 /* Offsets of various "interesting" bits in the thread structure. */
114 static int bsd_uthread_thread_state_offset = -1;
115 static int bsd_uthread_thread_next_offset = -1;
117 
118 /* Name of shared threads library. */
119 static const char *bsd_uthread_solib_name;
120 
121 /* Non-zero if the thread startum implemented by this module is active. */
123 
124 static CORE_ADDR
126 {
127  struct bound_minimal_symbol sym;
128 
129  sym = lookup_minimal_symbol (name, NULL, objfile);
130  if (sym.minsym)
131  return BMSYMBOL_VALUE_ADDRESS (sym);
132 
133  return 0;
134 }
135 
136 static int
138 {
139  enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
140  CORE_ADDR addr;
141 
142  addr = bsd_uthread_lookup_address (name, objfile);
143  if (addr == 0)
144  return 0;
145 
146  return read_memory_unsigned_integer (addr, 4, byte_order);
147 }
148 
149 static CORE_ADDR
151 {
152  struct type *ptr_type = builtin_type (target_gdbarch ())->builtin_data_ptr;
153  return read_memory_typed_address (addr, ptr_type);
154 }
155 
156 /* If OBJFILE contains the symbols corresponding to one of the
157  supported user-level threads libraries, activate the thread stratum
158  implemented by this module. */
159 
160 static int
162 {
163  struct gdbarch *gdbarch = target_gdbarch ();
164  struct bsd_uthread_ops *ops = gdbarch_data (gdbarch, bsd_uthread_data);
165 
166  /* Skip if the thread stratum has already been activated. */
167  if (bsd_uthread_active)
168  return 0;
169 
170  /* There's no point in enabling this module if no
171  architecture-specific operations are provided. */
172  if (!ops->supply_uthread)
173  return 0;
174 
175  bsd_uthread_thread_run_addr =
176  bsd_uthread_lookup_address ("_thread_run", objfile);
177  if (bsd_uthread_thread_run_addr == 0)
178  return 0;
179 
180  bsd_uthread_thread_list_addr =
181  bsd_uthread_lookup_address ("_thread_list", objfile);
182  if (bsd_uthread_thread_list_addr == 0)
183  return 0;
184 
185  bsd_uthread_thread_state_offset =
186  bsd_uthread_lookup_offset ("_thread_state_offset", objfile);
187  if (bsd_uthread_thread_state_offset == 0)
188  return 0;
189 
190  bsd_uthread_thread_next_offset =
191  bsd_uthread_lookup_offset ("_thread_next_offset", objfile);
192  if (bsd_uthread_thread_next_offset == 0)
193  return 0;
194 
195  bsd_uthread_thread_ctx_offset =
196  bsd_uthread_lookup_offset ("_thread_ctx_offset", objfile);
197 
198  push_target (bsd_uthread_ops_hack);
199  bsd_uthread_active = 1;
200  return 1;
201 }
202 
203 /* Cleanup due to deactivation. */
204 
205 static void
207 {
208  bsd_uthread_active = 0;
209  bsd_uthread_thread_run_addr = 0;
210  bsd_uthread_thread_list_addr = 0;
211  bsd_uthread_thread_state_offset = 0;
212  bsd_uthread_thread_next_offset = 0;
213  bsd_uthread_thread_ctx_offset = 0;
214  bsd_uthread_solib_name = NULL;
215 }
216 
217 /* Deactivate the thread stratum implemented by this module. */
218 
219 static void
221 {
222  /* Skip if the thread stratum has already been deactivated. */
223  if (!bsd_uthread_active)
224  return;
225 
226  unpush_target (bsd_uthread_ops_hack);
227 }
228 
229 static void
230 bsd_uthread_inferior_created (struct target_ops *ops, int from_tty)
231 {
232  bsd_uthread_activate (NULL);
233 }
234 
235 /* Likely candidates for the threads library. */
236 static const char *bsd_uthread_solib_names[] =
237 {
238  "/usr/lib/libc_r.so", /* FreeBSD */
239  "/usr/lib/libpthread.so", /* OpenBSD */
240  NULL
241 };
242 
243 static void
245 {
246  const char **names = bsd_uthread_solib_names;
247 
248  for (names = bsd_uthread_solib_names; *names; names++)
249  {
250  if (startswith (so->so_original_name, *names))
251  {
252  solib_read_symbols (so, 0);
253 
254  if (bsd_uthread_activate (so->objfile))
255  {
256  bsd_uthread_solib_name = so->so_original_name;
257  return;
258  }
259  }
260  }
261 }
262 
263 static void
265 {
266  if (!bsd_uthread_solib_name)
267  return;
268 
269  if (strcmp (so->so_original_name, bsd_uthread_solib_name) == 0)
271 }
272 
273 static void
275 {
276  struct target_ops *beneath = find_target_beneath (ops);
277  beneath->to_mourn_inferior (beneath);
279 }
280 
281 static void
283  struct regcache *regcache, int regnum)
284 {
285  struct gdbarch *gdbarch = get_regcache_arch (regcache);
286  struct bsd_uthread_ops *uthread_ops = gdbarch_data (gdbarch, bsd_uthread_data);
288  struct target_ops *beneath = find_target_beneath (ops);
289  CORE_ADDR active_addr;
290 
291  /* Always fetch the appropriate registers from the layer beneath. */
292  beneath->to_fetch_registers (beneath, regcache, regnum);
293 
294  /* FIXME: That might have gotten us more than we asked for. Make
295  sure we overwrite all relevant registers with values from the
296  thread structure. This can go once we fix the underlying target. */
297  regnum = -1;
298 
299  active_addr = bsd_uthread_read_memory_address (bsd_uthread_thread_run_addr);
300  if (addr != 0 && addr != active_addr)
301  {
303  uthread_ops->supply_uthread (regcache, regnum,
304  addr + bsd_uthread_thread_ctx_offset);
305  }
306 }
307 
308 static void
310  struct regcache *regcache, int regnum)
311 {
312  struct gdbarch *gdbarch = get_regcache_arch (regcache);
313  struct bsd_uthread_ops *uthread_ops = gdbarch_data (gdbarch, bsd_uthread_data);
314  struct target_ops *beneath = find_target_beneath (ops);
316  CORE_ADDR active_addr;
317 
318  active_addr = bsd_uthread_read_memory_address (bsd_uthread_thread_run_addr);
319  if (addr != 0 && addr != active_addr)
320  {
322  uthread_ops->collect_uthread (regcache, regnum,
323  addr + bsd_uthread_thread_ctx_offset);
324  }
325  else
326  {
327  /* Updating the thread that is currently running; pass the
328  request to the layer beneath. */
329  beneath->to_store_registers (beneath, regcache, regnum);
330  }
331 }
332 
333 static ptid_t
335  ptid_t ptid, struct target_waitstatus *status, int options)
336 {
337  enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
338  CORE_ADDR addr;
339  struct target_ops *beneath = find_target_beneath (ops);
340 
341  /* Pass the request to the layer beneath. */
342  ptid = beneath->to_wait (beneath, ptid, status, options);
343 
344  /* If the process is no longer alive, there's no point in figuring
345  out the thread ID. It will fail anyway. */
346  if (status->kind == TARGET_WAITKIND_SIGNALLED
347  || status->kind == TARGET_WAITKIND_EXITED)
348  return ptid;
349 
350  /* Fetch the corresponding thread ID, and augment the returned
351  process ID with it. */
352  addr = bsd_uthread_read_memory_address (bsd_uthread_thread_run_addr);
353  if (addr != 0)
354  {
355  gdb_byte buf[4];
356 
357  /* FIXME: For executables linked statically with the threads
358  library, we end up here before the program has actually been
359  executed. In that case ADDR will be garbage since it has
360  been read from the wrong virtual memory image. */
361  if (target_read_memory (addr, buf, 4) == 0)
362  {
363  ULONGEST magic = extract_unsigned_integer (buf, 4, byte_order);
364  if (magic == BSD_UTHREAD_PTHREAD_MAGIC)
365  ptid = ptid_build (ptid_get_pid (ptid), 0, addr);
366  }
367  }
368 
369  /* If INFERIOR_PTID doesn't have a tid member yet, and we now have a
370  ptid with tid set, then ptid is still the initial thread of
371  the process. Notify GDB core about it. */
372  if (ptid_get_tid (inferior_ptid) == 0
373  && ptid_get_tid (ptid) != 0 && !in_thread_list (ptid))
375 
376  /* Don't let the core see a ptid without a corresponding thread. */
377  if (!in_thread_list (ptid) || is_exited (ptid))
378  add_thread (ptid);
379 
380  return ptid;
381 }
382 
383 static void
385  ptid_t ptid, int step, enum gdb_signal sig)
386 {
387  /* Pass the request to the layer beneath. */
388  struct target_ops *beneath = find_target_beneath (ops);
389  beneath->to_resume (beneath, ptid, step, sig);
390 }
391 
392 static int
394 {
395  enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
396  struct target_ops *beneath = find_target_beneath (ops);
398 
399  if (addr != 0)
400  {
402  ULONGEST state;
403 
405 
406  state = read_memory_unsigned_integer (addr + offset, 4, byte_order);
407  if (state == BSD_UTHREAD_PS_DEAD)
408  return 0;
409  }
410 
411  return beneath->to_thread_alive (beneath, ptid);
412 }
413 
414 static void
416 {
417  pid_t pid = ptid_get_pid (inferior_ptid);
419  CORE_ADDR addr;
420 
421  prune_threads ();
422 
423  addr = bsd_uthread_read_memory_address (bsd_uthread_thread_list_addr);
424  while (addr != 0)
425  {
426  ptid_t ptid = ptid_build (pid, 0, addr);
427 
428  if (!in_thread_list (ptid) || is_exited (ptid))
429  {
430  /* If INFERIOR_PTID doesn't have a tid member yet, then ptid
431  is still the initial thread of the process. Notify GDB
432  core about it. */
433  if (ptid_get_tid (inferior_ptid) == 0)
435  else
436  add_thread (ptid);
437  }
438 
439  addr = bsd_uthread_read_memory_address (addr + offset);
440  }
441 }
442 
443 /* Possible states a thread can be in. */
444 static char *bsd_uthread_state[] =
445 {
446  "RUNNING",
447  "SIGTHREAD",
448  "MUTEX_WAIT",
449  "COND_WAIT",
450  "FDLR_WAIT",
451  "FDLW_WAIT",
452  "FDR_WAIT",
453  "FDW_WAIT",
454  "FILE_WAIT",
455  "POLL_WAIT",
456  "SELECT_WAIT",
457  "SLEEP_WAIT",
458  "WAIT_WAIT",
459  "SIGSUSPEND",
460  "SIGWAIT",
461  "SPINBLOCK",
462  "JOIN",
463  "SUSPENDED",
464  "DEAD",
465  "DEADLOCK"
466 };
467 
468 /* Return a string describing th state of the thread specified by
469  INFO. */
470 
471 static char *
473  struct thread_info *info)
474 {
475  enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
476  CORE_ADDR addr = ptid_get_tid (info->ptid);
477 
478  if (addr != 0)
479  {
481  ULONGEST state;
482 
483  state = read_memory_unsigned_integer (addr + offset, 4, byte_order);
484  if (state < ARRAY_SIZE (bsd_uthread_state))
485  return bsd_uthread_state[state];
486  }
487 
488  return NULL;
489 }
490 
491 static char *
493 {
494  if (ptid_get_tid (ptid) != 0)
495  {
496  static char buf[64];
497 
498  xsnprintf (buf, sizeof buf, "process %d, thread 0x%lx",
499  ptid_get_pid (ptid), ptid_get_tid (ptid));
500  return buf;
501  }
502 
503  return normal_pid_to_str (ptid);
504 }
505 
506 static struct target_ops *
508 {
509  struct target_ops *t = XCNEW (struct target_ops);
510 
511  t->to_shortname = "bsd-uthreads";
512  t->to_longname = "BSD user-level threads";
513  t->to_doc = "BSD user-level threads";
525  t->to_magic = OPS_MAGIC;
526  bsd_uthread_ops_hack = t;
527 
528  return t;
529 }
530 
531 /* Provide a prototype to silence -Wmissing-prototypes. */
533 
534 void
536 {
538 
540 
544 }
struct gdbarch * target_gdbarch(void)
Definition: gdbarch.c:5143
ULONGEST extract_unsigned_integer(const gdb_byte *, int, enum bfd_endian)
Definition: findvar.c:84
static ptid_t bsd_uthread_wait(struct target_ops *ops, ptid_t ptid, struct target_waitstatus *status, int options)
Definition: bsd-uthread.c:334
struct thread_info * add_thread(ptid_t ptid)
Definition: thread.c:305
static int bsd_uthread_thread_next_offset
Definition: bsd-uthread.c:115
const char * to_longname
Definition: target.h:433
bfd_vma CORE_ADDR
Definition: common-types.h:41
static CORE_ADDR bsd_uthread_read_memory_address(CORE_ADDR addr)
Definition: bsd-uthread.c:150
struct gdbarch * get_regcache_arch(const struct regcache *regcache)
Definition: regcache.c:297
#define BMSYMBOL_VALUE_ADDRESS(symbol)
Definition: symtab.h:393
char *(* to_pid_to_str)(struct target_ops *, ptid_t) TARGET_DEFAULT_FUNC(default_pid_to_str)
Definition: target.h:631
void push_target(struct target_ops *t)
Definition: target.c:664
void * gdbarch_data(struct gdbarch *gdbarch, struct gdbarch_data *data)
Definition: gdbarch.c:4845
char *(* to_extra_thread_info)(struct target_ops *, struct thread_info *) TARGET_DEFAULT_RETURN(NULL)
Definition: target.h:633
const struct builtin_type * builtin_type(struct gdbarch *gdbarch)
Definition: gdbtypes.c:4766
int unpush_target(struct target_ops *t)
Definition: target.c:711
void(* to_close)(struct target_ops *)
Definition: target.h:448
Definition: solist.h:30
static const char * bsd_uthread_solib_name
Definition: bsd-uthread.c:119
static int bsd_uthread_thread_ctx_offset
Definition: bsd-uthread.c:116
struct gdbarch_data * gdbarch_data_register_pre_init(gdbarch_data_pre_init_ftype *pre_init)
Definition: gdbarch.c:4806
void bsd_uthread_set_collect_uthread(struct gdbarch *gdbarch, void(*collect_uthread)(const struct regcache *, int, CORE_ADDR))
Definition: bsd-uthread.c:79
ptid_t(* to_wait)(struct target_ops *, ptid_t, struct target_waitstatus *, int TARGET_DEBUG_PRINTER(target_debug_print_options)) TARGET_DEFAULT_NORETURN(noprocess())
Definition: target.h:468
static struct target_ops * bsd_uthread_target(void)
Definition: bsd-uthread.c:507
static void bsd_uthread_update_thread_list(struct target_ops *ops)
Definition: bsd-uthread.c:415
#define _(String)
Definition: gdb_locale.h:40
static CORE_ADDR bsd_uthread_lookup_address(const char *name, struct objfile *objfile)
Definition: bsd-uthread.c:125
static const char * bsd_uthread_solib_names[]
Definition: bsd-uthread.c:236
void(* collect_uthread)(const struct regcache *, int, CORE_ADDR)
Definition: bsd-uthread.c:51
Definition: ptid.h:35
ptid_t ptid_build(int pid, long lwp, long tid)
Definition: ptid.c:31
struct observer * observer_attach_inferior_created(observer_inferior_created_ftype *f)
int in_thread_list(ptid_t ptid)
Definition: thread.c:482
static char * bsd_uthread_pid_to_str(struct target_ops *ops, ptid_t ptid)
Definition: bsd-uthread.c:492
const char *const name
Definition: aarch64-tdep.c:68
#define OPS_MAGIC
Definition: target.h:1233
static int bsd_uthread_active
Definition: bsd-uthread.c:122
void initialize_file_ftype(void)
Definition: defs.h:281
static char * bsd_uthread_extra_thread_info(struct target_ops *self, struct thread_info *info)
Definition: bsd-uthread.c:472
static struct target_ops * bsd_uthread_ops_hack
Definition: bsd-uthread.c:37
void complete_target_initialization(struct target_ops *t)
Definition: target.c:317
static void bsd_uthread_inferior_created(struct target_ops *ops, int from_tty)
Definition: bsd-uthread.c:230
static void bsd_uthread_fetch_registers(struct target_ops *ops, struct regcache *regcache, int regnum)
Definition: bsd-uthread.c:282
static CORE_ADDR bsd_uthread_thread_list_addr
Definition: bsd-uthread.c:111
mach_port_t mach_port_t name mach_port_t mach_port_t name error_t int status
Definition: gnu-nat.c:1816
void(* to_resume)(struct target_ops *, ptid_t, int TARGET_DEBUG_PRINTER(target_debug_print_step), enum gdb_signal) TARGET_DEFAULT_NORETURN(noprocess())
Definition: target.h:464
struct observer * observer_attach_solib_unloaded(observer_solib_unloaded_ftype *f)
char so_original_name[SO_NAME_MAX_PATH_SIZE]
Definition: solist.h:49
int solib_read_symbols(struct so_list *so, int flags)
Definition: solib.c:669
enum bfd_endian gdbarch_byte_order(struct gdbarch *gdbarch)
Definition: gdbarch.c:1420
static void * bsd_uthread_init(struct obstack *obstack)
Definition: bsd-uthread.c:55
Definition: gdbtypes.h:749
initialize_file_ftype _initialize_bsd_uthread
void thread_change_ptid(ptid_t old_ptid, ptid_t new_ptid)
Definition: thread.c:754
const char * to_doc
Definition: target.h:434
static int startswith(const char *string, const char *pattern)
Definition: common-utils.h:75
#define BSD_UTHREAD_PS_DEAD
Definition: bsd-uthread.c:104
static int bsd_uthread_lookup_offset(const char *name, struct objfile *objfile)
Definition: bsd-uthread.c:137
struct target_ops * find_target_beneath(struct target_ops *t)
Definition: target.c:3148
int regnum
Definition: aarch64-tdep.c:69
static void bsd_uthread_deactivate(void)
Definition: bsd-uthread.c:220
static int bsd_uthread_thread_state_offset
Definition: bsd-uthread.c:114
char * normal_pid_to_str(ptid_t ptid)
Definition: target.c:3207
int ptid_get_pid(ptid_t ptid)
Definition: ptid.c:52
static struct gdbarch_data * bsd_uthread_data
Definition: bsd-uthread.c:43
const char const char int
Definition: command.h:229
bfd_byte gdb_byte
Definition: common-types.h:38
static int bsd_uthread_thread_alive(struct target_ops *ops, ptid_t ptid)
Definition: bsd-uthread.c:393
void(* to_fetch_registers)(struct target_ops *, struct regcache *, int) TARGET_DEFAULT_IGNORE()
Definition: target.h:472
long ptid_get_tid(ptid_t ptid)
Definition: ptid.c:68
void(* to_mourn_inferior)(struct target_ops *) TARGET_DEFAULT_FUNC(default_mourn_inferior)
Definition: target.h:607
static void bsd_uthread_solib_loaded(struct so_list *so)
Definition: bsd-uthread.c:244
void prune_threads(void)
Definition: thread.c:626
ptid_t ptid
Definition: gdbthread.h:169
int xsnprintf(char *str, size_t size, const char *format,...)
Definition: common-utils.c:134
enum target_waitkind kind
Definition: waitstatus.h:100
int target_read_memory(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
Definition: target.c:1393
static void bsd_uthread_solib_unloaded(struct so_list *so)
Definition: bsd-uthread.c:264
ptid_t inferior_ptid
Definition: infcmd.c:124
struct type * builtin_data_ptr
Definition: gdbtypes.h:1533
enum strata to_stratum
Definition: target.h:650
int offset
Definition: agent.c:65
static void bsd_uthread_check_magic(CORE_ADDR addr)
Definition: bsd-uthread.c:93
static void bsd_uthread_mourn_inferior(struct target_ops *ops)
Definition: bsd-uthread.c:274
#define BSD_UTHREAD_PTHREAD_MAGIC
Definition: bsd-uthread.c:88
int is_exited(ptid_t ptid)
Definition: thread.c:828
const char * to_shortname
Definition: target.h:432
unsigned long long ULONGEST
Definition: common-types.h:53
int to_magic
Definition: target.h:1224
#define OBSTACK_ZALLOC(OBSTACK, TYPE)
Definition: gdb_obstack.h:27
int(* to_thread_alive)(struct target_ops *, ptid_t ptid) TARGET_DEFAULT_RETURN(0)
Definition: target.h:627
ULONGEST read_memory_unsigned_integer(CORE_ADDR memaddr, int len, enum bfd_endian byte_order)
Definition: corefile.c:321
CORE_ADDR read_memory_typed_address(CORE_ADDR addr, struct type *type)
Definition: corefile.c:378
static void bsd_uthread_store_registers(struct target_ops *ops, struct regcache *regcache, int regnum)
Definition: bsd-uthread.c:309
void(* to_update_thread_list)(struct target_ops *) TARGET_DEFAULT_IGNORE()
Definition: target.h:629
struct objfile * objfile
Definition: solist.h:69
void(* to_store_registers)(struct target_ops *, struct regcache *, int) TARGET_DEFAULT_NORETURN(noprocess())
Definition: target.h:474
struct bound_minimal_symbol lookup_minimal_symbol(const char *name, const char *sfile, struct objfile *objf)
Definition: minsyms.c:163
void bsd_uthread_set_supply_uthread(struct gdbarch *gdbarch, void(*supply_uthread)(struct regcache *, int, CORE_ADDR))
Definition: bsd-uthread.c:67
static CORE_ADDR bsd_uthread_thread_run_addr
Definition: bsd-uthread.c:108
void error(const char *fmt,...)
Definition: errors.c:38
mach_port_t mach_port_t name mach_port_t mach_port_t name error_t int int rusage_t pid_t pid
Definition: gnu-nat.c:1818
struct target_ops * beneath
Definition: target.h:431
static void bsd_uthread_close(struct target_ops *self)
Definition: bsd-uthread.c:206
void(* supply_uthread)(struct regcache *, int, CORE_ADDR)
Definition: bsd-uthread.c:48
struct observer * observer_attach_solib_loaded(observer_solib_loaded_ftype *f)
static void bsd_uthread_resume(struct target_ops *ops, ptid_t ptid, int step, enum gdb_signal sig)
Definition: bsd-uthread.c:384
static int bsd_uthread_activate(struct objfile *objfile)
Definition: bsd-uthread.c:161