GDB (xrefs)
/tmp/gdb-7.10/gdb/windows-tdep.c
Go to the documentation of this file.
1 /* Copyright (C) 2008-2015 Free Software Foundation, Inc.
2 
3  This file is part of GDB.
4 
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.
9 
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.
14 
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/>. */
17 
18 #include "defs.h"
19 #include "windows-tdep.h"
20 #include "gdb_obstack.h"
21 #include "xml-support.h"
22 #include "gdbarch.h"
23 #include "target.h"
24 #include "value.h"
25 #include "inferior.h"
26 #include "command.h"
27 #include "gdbcmd.h"
28 #include "gdbthread.h"
29 #include "objfiles.h"
30 #include "symfile.h"
31 #include "coff-pe-read.h"
32 #include "gdb_bfd.h"
33 #include "complaints.h"
34 #include "solib.h"
35 #include "solib-target.h"
36 #include "gdbcore.h"
37 
39 
41  {
42  uint32_t current_seh; /* %fs:0x0000 */
43  uint32_t current_top_of_stack; /* %fs:0x0004 */
44  uint32_t current_bottom_of_stack; /* %fs:0x0008 */
45  uint32_t sub_system_tib; /* %fs:0x000c */
46  uint32_t fiber_data; /* %fs:0x0010 */
47  uint32_t arbitrary_data_slot; /* %fs:0x0014 */
48  uint32_t linear_address_tib; /* %fs:0x0018 */
49  uint32_t environment_pointer; /* %fs:0x001c */
50  uint32_t process_id; /* %fs:0x0020 */
51  uint32_t current_thread_id; /* %fs:0x0024 */
52  uint32_t active_rpc_handle; /* %fs:0x0028 */
53  uint32_t thread_local_storage; /* %fs:0x002c */
54  uint32_t process_environment_block; /* %fs:0x0030 */
55  uint32_t last_error_number; /* %fs:0x0034 */
56  }
58 
60  {
61  uint64_t current_seh; /* %gs:0x0000 */
62  uint64_t current_top_of_stack; /* %gs:0x0008 */
63  uint64_t current_bottom_of_stack; /* %gs:0x0010 */
64  uint64_t sub_system_tib; /* %gs:0x0018 */
65  uint64_t fiber_data; /* %gs:0x0020 */
66  uint64_t arbitrary_data_slot; /* %gs:0x0028 */
67  uint64_t linear_address_tib; /* %gs:0x0030 */
68  uint64_t environment_pointer; /* %gs:0x0038 */
69  uint64_t process_id; /* %gs:0x0040 */
70  uint64_t current_thread_id; /* %gs:0x0048 */
71  uint64_t active_rpc_handle; /* %gs:0x0050 */
72  uint64_t thread_local_storage; /* %gs:0x0058 */
73  uint64_t process_environment_block; /* %gs:0x0060 */
74  uint64_t last_error_number; /* %gs:0x0068 */
75  }
77 
78 
79 static const char* TIB_NAME[] =
80  {
81  " current_seh ", /* %fs:0x0000 */
82  " current_top_of_stack ", /* %fs:0x0004 */
83  " current_bottom_of_stack ", /* %fs:0x0008 */
84  " sub_system_tib ", /* %fs:0x000c */
85  " fiber_data ", /* %fs:0x0010 */
86  " arbitrary_data_slot ", /* %fs:0x0014 */
87  " linear_address_tib ", /* %fs:0x0018 */
88  " environment_pointer ", /* %fs:0x001c */
89  " process_id ", /* %fs:0x0020 */
90  " current_thread_id ", /* %fs:0x0024 */
91  " active_rpc_handle ", /* %fs:0x0028 */
92  " thread_local_storage ", /* %fs:0x002c */
93  " process_environment_block ", /* %fs:0x0030 */
94  " last_error_number " /* %fs:0x0034 */
95  };
96 
97 static const int MAX_TIB32 =
98  sizeof (thread_information_32) / sizeof (uint32_t);
99 static const int MAX_TIB64 =
100  sizeof (thread_information_64) / sizeof (uint64_t);
101 static const int FULL_TIB_SIZE = 0x1000;
102 
103 static int maint_display_all_tib = 0;
104 
105 /* Define Thread Local Base pointer type. */
106 
107 static struct type *
108 windows_get_tlb_type (struct gdbarch *gdbarch)
109 {
110  static struct gdbarch *last_gdbarch = NULL;
111  static struct type *last_tlb_type = NULL;
112  struct type *dword_ptr_type, *dword32_type, *void_ptr_type;
113  struct type *peb_ldr_type, *peb_ldr_ptr_type;
114  struct type *peb_type, *peb_ptr_type, *list_type, *list_ptr_type;
115  struct type *module_list_ptr_type;
116  struct type *tib_type, *seh_type, *tib_ptr_type, *seh_ptr_type;
117 
118  /* Do not rebuild type if same gdbarch as last time. */
119  if (last_tlb_type && last_gdbarch == gdbarch)
120  return last_tlb_type;
121 
122  dword_ptr_type = arch_integer_type (gdbarch, gdbarch_ptr_bit (gdbarch),
123  1, "DWORD_PTR");
124  dword32_type = arch_integer_type (gdbarch, 32,
125  1, "DWORD32");
126  void_ptr_type = lookup_pointer_type (builtin_type (gdbarch)->builtin_void);
127 
128  /* list entry */
129 
130  list_type = arch_composite_type (gdbarch, NULL, TYPE_CODE_STRUCT);
131  TYPE_NAME (list_type) = xstrdup ("list");
132 
133  list_ptr_type = arch_type (gdbarch, TYPE_CODE_PTR,
134  TYPE_LENGTH (void_ptr_type), NULL);
135 
136  module_list_ptr_type = void_ptr_type;
137 
138  append_composite_type_field (list_type, "forward_list",
139  module_list_ptr_type);
140  append_composite_type_field (list_type, "backward_list",
141  module_list_ptr_type);
142 
143  /* Structured Exception Handler */
144 
145  seh_type = arch_composite_type (gdbarch, NULL, TYPE_CODE_STRUCT);
146  TYPE_NAME (seh_type) = xstrdup ("seh");
147 
148  seh_ptr_type = arch_type (gdbarch, TYPE_CODE_PTR,
149  TYPE_LENGTH (void_ptr_type), NULL);
150  TYPE_TARGET_TYPE (seh_ptr_type) = seh_type;
151 
152  append_composite_type_field (seh_type, "next_seh", seh_ptr_type);
153  append_composite_type_field (seh_type, "handler",
154  builtin_type (gdbarch)->builtin_func_ptr);
155 
156  /* struct _PEB_LDR_DATA */
157  peb_ldr_type = arch_composite_type (gdbarch, NULL, TYPE_CODE_STRUCT);
158  TYPE_NAME (peb_ldr_type) = xstrdup ("peb_ldr_data");
159 
160  append_composite_type_field (peb_ldr_type, "length", dword32_type);
161  append_composite_type_field (peb_ldr_type, "initialized", dword32_type);
162  append_composite_type_field (peb_ldr_type, "ss_handle", void_ptr_type);
163  append_composite_type_field (peb_ldr_type, "in_load_order", list_type);
164  append_composite_type_field (peb_ldr_type, "in_memory_order", list_type);
165  append_composite_type_field (peb_ldr_type, "in_init_order", list_type);
166  append_composite_type_field (peb_ldr_type, "entry_in_progress",
167  void_ptr_type);
168  peb_ldr_ptr_type = arch_type (gdbarch, TYPE_CODE_PTR,
169  TYPE_LENGTH (void_ptr_type), NULL);
170  TYPE_TARGET_TYPE (peb_ldr_ptr_type) = peb_ldr_type;
171 
172 
173  /* struct process environment block */
174  peb_type = arch_composite_type (gdbarch, NULL, TYPE_CODE_STRUCT);
175  TYPE_NAME (peb_type) = xstrdup ("peb");
176 
177  /* First bytes contain several flags. */
178  append_composite_type_field (peb_type, "flags", dword_ptr_type);
179  append_composite_type_field (peb_type, "mutant", void_ptr_type);
180  append_composite_type_field (peb_type, "image_base_address", void_ptr_type);
181  append_composite_type_field (peb_type, "ldr", peb_ldr_ptr_type);
182  append_composite_type_field (peb_type, "process_parameters", void_ptr_type);
183  append_composite_type_field (peb_type, "sub_system_data", void_ptr_type);
184  append_composite_type_field (peb_type, "process_heap", void_ptr_type);
185  append_composite_type_field (peb_type, "fast_peb_lock", void_ptr_type);
186  peb_ptr_type = arch_type (gdbarch, TYPE_CODE_PTR,
187  TYPE_LENGTH (void_ptr_type), NULL);
188  TYPE_TARGET_TYPE (peb_ptr_type) = peb_type;
189 
190 
191  /* struct thread information block */
192  tib_type = arch_composite_type (gdbarch, NULL, TYPE_CODE_STRUCT);
193  TYPE_NAME (tib_type) = xstrdup ("tib");
194 
195  /* uint32_t current_seh; %fs:0x0000 */
196  append_composite_type_field (tib_type, "current_seh", seh_ptr_type);
197  /* uint32_t current_top_of_stack; %fs:0x0004 */
198  append_composite_type_field (tib_type, "current_top_of_stack",
199  void_ptr_type);
200  /* uint32_t current_bottom_of_stack; %fs:0x0008 */
201  append_composite_type_field (tib_type, "current_bottom_of_stack",
202  void_ptr_type);
203  /* uint32_t sub_system_tib; %fs:0x000c */
204  append_composite_type_field (tib_type, "sub_system_tib", void_ptr_type);
205 
206  /* uint32_t fiber_data; %fs:0x0010 */
207  append_composite_type_field (tib_type, "fiber_data", void_ptr_type);
208  /* uint32_t arbitrary_data_slot; %fs:0x0014 */
209  append_composite_type_field (tib_type, "arbitrary_data_slot", void_ptr_type);
210  /* uint32_t linear_address_tib; %fs:0x0018 */
211  append_composite_type_field (tib_type, "linear_address_tib", void_ptr_type);
212  /* uint32_t environment_pointer; %fs:0x001c */
213  append_composite_type_field (tib_type, "environment_pointer", void_ptr_type);
214  /* uint32_t process_id; %fs:0x0020 */
215  append_composite_type_field (tib_type, "process_id", dword_ptr_type);
216  /* uint32_t current_thread_id; %fs:0x0024 */
217  append_composite_type_field (tib_type, "thread_id", dword_ptr_type);
218  /* uint32_t active_rpc_handle; %fs:0x0028 */
219  append_composite_type_field (tib_type, "active_rpc_handle", dword_ptr_type);
220  /* uint32_t thread_local_storage; %fs:0x002c */
221  append_composite_type_field (tib_type, "thread_local_storage",
222  void_ptr_type);
223  /* uint32_t process_environment_block; %fs:0x0030 */
224  append_composite_type_field (tib_type, "process_environment_block",
225  peb_ptr_type);
226  /* uint32_t last_error_number; %fs:0x0034 */
227  append_composite_type_field (tib_type, "last_error_number", dword_ptr_type);
228 
229  tib_ptr_type = arch_type (gdbarch, TYPE_CODE_PTR,
230  TYPE_LENGTH (void_ptr_type), NULL);
231  TYPE_TARGET_TYPE (tib_ptr_type) = tib_type;
232 
233  last_tlb_type = tib_ptr_type;
234  last_gdbarch = gdbarch;
235 
236  return tib_ptr_type;
237 }
238 
239 /* The $_tlb convenience variable is a bit special. We don't know
240  for sure the type of the value until we actually have a chance to
241  fetch the data. The type can change depending on gdbarch, so it is
242  also dependent on which thread you have selected. */
243 
244 /* This function implements the lval_computed support for reading a
245  $_tlb value. */
246 
247 static void
248 tlb_value_read (struct value *val)
249 {
250  CORE_ADDR tlb;
251  struct type *type = check_typedef (value_type (val));
252 
254  error (_("Unable to read tlb"));
255  store_typed_address (value_contents_raw (val), type, tlb);
256 }
257 
258 /* This function implements the lval_computed support for writing a
259  $_tlb value. */
260 
261 static void
262 tlb_value_write (struct value *v, struct value *fromval)
263 {
264  error (_("Impossible to change the Thread Local Base"));
265 }
266 
267 static const struct lval_funcs tlb_value_funcs =
268  {
271  };
272 
273 
274 /* Return a new value with the correct type for the tlb object of
275  the current thread using architecture GDBARCH. Return a void value
276  if there's no object available. */
277 
278 static struct value *
279 tlb_make_value (struct gdbarch *gdbarch, struct internalvar *var, void *ignore)
280 {
282  {
283  struct type *type = windows_get_tlb_type (gdbarch);
284  return allocate_computed_value (type, &tlb_value_funcs, NULL);
285  }
286 
287  return allocate_value (builtin_type (gdbarch)->builtin_void);
288 }
289 
290 
291 /* Display thread information block of a given thread. */
292 
293 static int
295 {
296  gdb_byte *tib = NULL;
297  gdb_byte *index;
298  CORE_ADDR thread_local_base;
299  ULONGEST i, val, max, max_name, size, tib_size;
300  ULONGEST sizeof_ptr = gdbarch_ptr_bit (target_gdbarch ());
301  enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
302 
303  if (sizeof_ptr == 64)
304  {
305  size = sizeof (uint64_t);
306  tib_size = sizeof (thread_information_64);
307  max = MAX_TIB64;
308  }
309  else
310  {
311  size = sizeof (uint32_t);
312  tib_size = sizeof (thread_information_32);
313  max = MAX_TIB32;
314  }
315 
316  max_name = max;
317 
318  if (maint_display_all_tib)
319  {
320  tib_size = FULL_TIB_SIZE;
321  max = tib_size / size;
322  }
323 
324  tib = alloca (tib_size);
325 
326  if (target_get_tib_address (ptid, &thread_local_base) == 0)
327  {
328  printf_filtered (_("Unable to get thread local base for %s\n"),
329  target_pid_to_str (ptid));
330  return -1;
331  }
332 
334  NULL, tib, thread_local_base, tib_size) != tib_size)
335  {
336  printf_filtered (_("Unable to read thread information "
337  "block for %s at address %s\n"),
338  target_pid_to_str (ptid),
339  paddress (target_gdbarch (), thread_local_base));
340  return -1;
341  }
342 
343  printf_filtered (_("Thread Information Block %s at %s\n"),
344  target_pid_to_str (ptid),
345  paddress (target_gdbarch (), thread_local_base));
346 
347  index = (gdb_byte *) tib;
348 
349  /* All fields have the size of a pointer, this allows to iterate
350  using the same for loop for both layouts. */
351  for (i = 0; i < max; i++)
352  {
353  val = extract_unsigned_integer (index, size, byte_order);
354  if (i < max_name)
355  printf_filtered (_("%s is 0x%s\n"), TIB_NAME[i], phex (val, size));
356  else if (val != 0)
357  printf_filtered (_("TIB[0x%s] is 0x%s\n"), phex (i * size, 2),
358  phex (val, size));
359  index += size;
360  }
361  return 1;
362 }
363 
364 /* Display thread information block of a thread specified by ARGS.
365  If ARGS is empty, display thread information block of current_thread
366  if current_thread is non NULL.
367  Otherwise ARGS is parsed and converted to a integer that should
368  be the windows ThreadID (not the internal GDB thread ID). */
369 
370 static void
371 display_tib (char * args, int from_tty)
372 {
373  if (args)
374  {
375  struct thread_info *tp;
376  int gdb_id = value_as_long (parse_and_eval (args));
377 
378  tp = find_thread_id (gdb_id);
379 
380  if (!tp)
381  error (_("Thread ID %d not known."), gdb_id);
382 
383  if (!target_thread_alive (tp->ptid))
384  error (_("Thread ID %d has terminated."), gdb_id);
385 
386  display_one_tib (tp->ptid);
387  }
388  else if (!ptid_equal (inferior_ptid, null_ptid))
390 }
391 
392 void
393 windows_xfer_shared_library (const char* so_name, CORE_ADDR load_addr,
394  struct gdbarch *gdbarch, struct obstack *obstack)
395 {
396  char *p;
397  struct bfd * dll;
398  CORE_ADDR text_offset;
399 
400  obstack_grow_str (obstack, "<library name=\"");
401  p = xml_escape_text (so_name);
402  obstack_grow_str (obstack, p);
403  xfree (p);
404  obstack_grow_str (obstack, "\"><segment address=\"");
405  dll = gdb_bfd_open (so_name, gnutarget, -1);
406  /* The following calls are OK even if dll is NULL.
407  The default value 0x1000 is returned by pe_text_section_offset
408  in that case. */
409  text_offset = pe_text_section_offset (dll);
410  gdb_bfd_unref (dll);
411  obstack_grow_str (obstack, paddress (gdbarch, load_addr + text_offset));
412  obstack_grow_str (obstack, "\"/></library>");
413 }
414 
415 /* Implement the "iterate_over_objfiles_in_search_order" gdbarch
416  method. It searches all objfiles, starting with CURRENT_OBJFILE
417  first (if not NULL).
418 
419  On Windows, the system behaves a little differently when two
420  objfiles each define a global symbol using the same name, compared
421  to other platforms such as GNU/Linux for instance. On GNU/Linux,
422  all instances of the symbol effectively get merged into a single
423  one, but on Windows, they remain distinct.
424 
425  As a result, it usually makes sense to start global symbol searches
426  with the current objfile before expanding it to all other objfiles.
427  This helps for instance when a user debugs some code in a DLL that
428  refers to a global variable defined inside that DLL. When trying
429  to print the value of that global variable, it would be unhelpful
430  to print the value of another global variable defined with the same
431  name, but in a different DLL. */
432 
433 static void
435  (struct gdbarch *gdbarch,
437  void *cb_data, struct objfile *current_objfile)
438 {
439  int stop;
440  struct objfile *objfile;
441 
442  if (current_objfile)
443  {
444  stop = cb (current_objfile, cb_data);
445  if (stop)
446  return;
447  }
448 
449  ALL_OBJFILES (objfile)
450  {
451  if (objfile != current_objfile)
452  {
453  stop = cb (objfile, cb_data);
454  if (stop)
455  return;
456  }
457  }
458 }
459 
460 static void
461 show_maint_show_all_tib (struct ui_file *file, int from_tty,
462  struct cmd_list_element *c, const char *value)
463 {
464  fprintf_filtered (file, _("Show all non-zero elements of "
465  "Thread Information Block is %s.\n"), value);
466 }
467 
468 static void
469 info_w32_command (char *args, int from_tty)
470 {
471  help_list (info_w32_cmdlist, "info w32 ", class_info, gdb_stdout);
472 }
473 
474 static int w32_prefix_command_valid = 0;
475 void
477 {
478  if (!w32_prefix_command_valid)
479  {
481  _("Print information specific to Win32 debugging."),
482  &info_w32_cmdlist, "info w32 ", 0, &infolist);
483  w32_prefix_command_valid = 1;
484  }
485 }
486 
487 /* To be called from the various GDB_OSABI_CYGWIN handlers for the
488  various Windows architectures and machine types. */
489 
490 void
491 windows_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
492 {
493  /* Canonical paths on this target look like
494  `c:\Program Files\Foo App\mydll.dll', for example. */
496 
499 
501 }
502 
503 /* Provide a prototype to silence -Wmissing-prototypes. */
505 
506 /* Implementation of `tlb' variable. */
507 
508 static const struct internalvar_funcs tlb_funcs =
509 {
511  NULL,
512  NULL
513 };
514 
515 void
517 {
519  add_cmd ("thread-information-block", class_info, display_tib,
520  _("Display thread information block."),
521  &info_w32_cmdlist);
522  add_alias_cmd ("tib", "thread-information-block", class_info, 1,
523  &info_w32_cmdlist);
524 
526  &maint_display_all_tib, _("\
527 Set whether to display all non-zero fields of thread information block."), _("\
528 Show whether to display all non-zero fields of thread information block."), _("\
529 Use \"on\" to enable, \"off\" to disable.\n\
530 If enabled, all non-zero fields of thread information block are displayed,\n\
531 even if their meaning is unknown."),
532  NULL,
536 
537  /* Explicitly create without lookup, since that tries to create a
538  value with a void typed value, and when we get here, gdbarch
539  isn't initialized yet. At this point, we're quite sure there
540  isn't another convenience variable of the same name. */
541  create_internalvar_type_lazy ("_tlb", &tlb_funcs, NULL);
542 }
struct gdbarch * target_gdbarch(void)
Definition: gdbarch.c:5143
CORE_ADDR pe_text_section_offset(struct bfd *abfd)
Definition: coff-pe-read.c:641
int target_thread_alive(ptid_t ptid)
Definition: target.c:3277
ULONGEST extract_unsigned_integer(const gdb_byte *, int, enum bfd_endian)
Definition: findvar.c:84
struct cmd_list_element * add_prefix_cmd(const char *name, enum command_class theclass, cmd_cfunc_ftype *fun, const char *doc, struct cmd_list_element **prefixlist, const char *prefixname, int allow_unknown, struct cmd_list_element **list)
Definition: cli-decode.c:338
struct thread_info * find_thread_id(int num)
Definition: thread.c:380
int ptid_equal(ptid_t ptid1, ptid_t ptid2)
Definition: ptid.c:76
bfd_vma CORE_ADDR
Definition: common-types.h:41
void xfree(void *)
Definition: common-utils.c:97
LONGEST value_as_long(struct value *val)
Definition: value.c:2654
void set_solib_ops(struct gdbarch *gdbarch, const struct target_so_ops *new_ops)
Definition: solib.c:76
#define TYPE_NAME(thistype)
Definition: gdbtypes.h:1227
int gdbarch_ptr_bit(struct gdbarch *gdbarch)
Definition: gdbarch.c:1690
struct ui_file * gdb_stdout
Definition: main.c:71
static struct type * windows_get_tlb_type(struct gdbarch *gdbarch)
Definition: windows-tdep.c:108
struct type * arch_composite_type(struct gdbarch *gdbarch, char *name, enum type_code code)
Definition: gdbtypes.c:4682
char * target_pid_to_str(ptid_t ptid)
Definition: target.c:2233
#define _(String)
Definition: gdb_locale.h:40
struct bfd * gdb_bfd_open(const char *name, const char *target, int fd)
Definition: gdb_bfd.c:320
char * xml_escape_text(const char *text)
Definition: xml-utils.c:27
struct value * allocate_value(struct type *type)
Definition: value.c:962
struct cmd_list_element * maintenance_set_cmdlist
Definition: maint.c:646
void printf_filtered(const char *format,...)
Definition: utils.c:2388
const char * paddress(struct gdbarch *gdbarch, CORE_ADDR addr)
Definition: utils.c:2743
Definition: ptid.h:35
struct target_so_ops solib_target_so_ops
Definition: solib-target.c:487
struct cmd_list_element * infolist
Definition: cli-cmds.c:107
int( iterate_over_objfiles_in_search_order_cb_ftype)(struct objfile *objfile, void *cb_data)
Definition: gdbarch.h:89
#define ALL_OBJFILES(obj)
Definition: objfiles.h:579
struct type * check_typedef(struct type *type)
Definition: gdbtypes.c:2217
void set_gdbarch_iterate_over_objfiles_in_search_order(struct gdbarch *gdbarch, gdbarch_iterate_over_objfiles_in_search_order_ftype iterate_over_objfiles_in_search_order)
Definition: gdbarch.c:4556
static const int MAX_TIB64
Definition: windows-tdep.c:99
char * gnutarget
Definition: corefile.c:437
struct target_ops current_target
void gdb_bfd_unref(struct bfd *abfd)
Definition: gdb_bfd.c:475
#define target_get_tib_address(ptid, addr)
Definition: target.h:2145
void initialize_file_ftype(void)
Definition: defs.h:281
struct value * allocate_computed_value(struct type *type, const struct lval_funcs *funcs, void *closure)
Definition: value.c:987
void fprintf_filtered(struct ui_file *stream, const char *format,...)
Definition: utils.c:2351
static void tlb_value_read(struct value *val)
Definition: windows-tdep.c:248
static void tlb_value_write(struct value *v, struct value *fromval)
Definition: windows-tdep.c:262
struct thread_information_block_32 thread_information_32
static const char * TIB_NAME[]
Definition: windows-tdep.c:79
struct cmd_list_element * add_cmd(const char *name, enum command_class theclass, cmd_cfunc_ftype *fun, const char *doc, struct cmd_list_element **list)
Definition: cli-decode.c:192
enum bfd_endian gdbarch_byte_order(struct gdbarch *gdbarch)
Definition: gdbarch.c:1420
static void display_tib(char *args, int from_tty)
Definition: windows-tdep.c:371
Definition: gdbtypes.h:749
static int display_one_tib(ptid_t ptid)
Definition: windows-tdep.c:294
struct cmd_list_element * info_w32_cmdlist
Definition: windows-tdep.c:38
struct cmd_list_element * add_alias_cmd(const char *name, const char *oldname, enum command_class theclass, int abbrev_flag, struct cmd_list_element **list)
Definition: cli-decode.c:286
struct type * arch_integer_type(struct gdbarch *gdbarch, int bit, int unsigned_p, char *name)
Definition: gdbtypes.c:4552
Definition: value.c:172
static void windows_iterate_over_objfiles_in_search_order(struct gdbarch *gdbarch, iterate_over_objfiles_in_search_order_cb_ftype *cb, void *cb_data, struct objfile *current_objfile)
Definition: windows-tdep.c:435
bfd_byte gdb_byte
Definition: common-types.h:38
void append_composite_type_field(struct type *t, char *name, struct type *field)
Definition: gdbtypes.c:4757
void help_list(struct cmd_list_element *list, const char *cmdtype, enum command_class theclass, struct ui_file *stream)
Definition: cli-decode.c:1023
static void show_maint_show_all_tib(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
Definition: windows-tdep.c:461
ptid_t null_ptid
Definition: ptid.c:25
#define target_has_stack
Definition: target.h:1705
#define TYPE_TARGET_TYPE(thistype)
Definition: gdbtypes.h:1229
#define max(a, b)
Definition: defs.h:109
ptid_t ptid
Definition: gdbthread.h:169
static struct value * tlb_make_value(struct gdbarch *gdbarch, struct internalvar *var, void *ignore)
Definition: windows-tdep.c:279
void windows_init_abi(struct gdbarch_info info, struct gdbarch *gdbarch)
Definition: windows-tdep.c:491
ptid_t inferior_ptid
Definition: infcmd.c:124
struct thread_information_block_64 thread_information_64
#define obstack_grow_str(OBSTACK, STRING)
Definition: gdb_obstack.h:46
static void info_w32_command(char *args, int from_tty)
Definition: windows-tdep.c:469
initialize_file_ftype _initialize_windows_tdep
struct value * parse_and_eval(const char *exp)
Definition: eval.c:124
unsigned long long ULONGEST
Definition: common-types.h:53
static int ignore(struct target_ops *ops, struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
Definition: corelow.c:917
static const int MAX_TIB32
Definition: windows-tdep.c:97
struct type * value_type(const struct value *value)
Definition: value.c:1021
LONGEST target_read(struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *buf, ULONGEST offset, LONGEST len)
Definition: target.c:1590
gdb_byte * value_contents_raw(struct value *value)
Definition: value.c:1084
#define TYPE_LENGTH(thistype)
Definition: gdbtypes.h:1237
void store_typed_address(gdb_byte *buf, struct type *type, CORE_ADDR addr)
Definition: findvar.c:242
struct type * arch_type(struct gdbarch *gdbarch, enum type_code code, int length, char *name)
Definition: gdbtypes.c:4532
static const int FULL_TIB_SIZE
Definition: windows-tdep.c:101
void set_gdbarch_has_dos_based_file_system(struct gdbarch *gdbarch, int has_dos_based_file_system)
Definition: gdbarch.c:4474
struct cmd_list_element * maintenance_show_cmdlist
Definition: maint.c:647
struct internalvar * create_internalvar_type_lazy(const char *name, const struct internalvar_funcs *funcs, void *data)
Definition: value.c:2096
void error(const char *fmt,...)
Definition: errors.c:38
void init_w32_command_list(void)
Definition: windows-tdep.c:476
size_t size
Definition: go32-nat.c:242
struct type * lookup_pointer_type(struct type *type)
Definition: gdbtypes.c:368
void windows_xfer_shared_library(const char *so_name, CORE_ADDR load_addr, struct gdbarch *gdbarch, struct obstack *obstack)
Definition: windows-tdep.c:393
void add_setshow_boolean_cmd(const char *name, enum command_class theclass, int *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
Definition: cli-decode.c:541