GDB (xrefs)
/tmp/gdb-7.10/gdb/jv-valprint.c
Go to the documentation of this file.
1 /* Support for printing Java values for GDB, the GNU debugger.
2 
3  Copyright (C) 1997-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 "symtab.h"
22 #include "gdbtypes.h"
23 #include "gdbcore.h"
24 #include "expression.h"
25 #include "value.h"
26 #include "demangle.h"
27 #include "valprint.h"
28 #include "language.h"
29 #include "jv-lang.h"
30 #include "c-lang.h"
31 #include "annotate.h"
32 /* Local functions */
33 
34 void
35 java_value_print (struct value *val, struct ui_file *stream,
36  const struct value_print_options *options)
37 {
38  struct gdbarch *gdbarch = get_type_arch (value_type (val));
39  enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
40  struct type *type;
41  CORE_ADDR address;
42  int i;
43  const char *name;
44  struct value_print_options opts;
45 
46  type = value_type (val);
47  address = value_address (val);
48 
49  if (is_object_type (type))
50  {
51  CORE_ADDR obj_addr;
52  struct value *tem = val;
53 
54  /* Get the run-time type, and cast the object into that. */
55  while (TYPE_CODE (value_type (tem)) == TYPE_CODE_PTR)
56  tem = value_ind (tem);
57 
58  obj_addr = value_address (tem);
59 
60  if (obj_addr != 0)
61  {
62  type = type_from_class (gdbarch, java_class_from_object (val));
63  type = lookup_pointer_type (type);
64 
65  val = value_at (type, address);
66  type = value_type (val);
67  }
68  }
69 
70  if (TYPE_CODE (type) == TYPE_CODE_PTR && !value_logical_not (val))
71  type_print (TYPE_TARGET_TYPE (type), "", stream, -1);
72 
73  name = TYPE_TAG_NAME (type);
74  if (TYPE_CODE (type) == TYPE_CODE_STRUCT && name != NULL
75  && (i = strlen (name), name[i - 1] == ']'))
76  {
77  gdb_byte buf4[4];
78  long length;
79  unsigned int things_printed = 0;
80  int reps;
81  struct type *el_type
82  = java_primitive_type_from_name (gdbarch, name, i - 2);
83 
84  i = 0;
85  read_memory (address + get_java_object_header_size (gdbarch), buf4, 4);
86 
87  length = (long) extract_signed_integer (buf4, 4, byte_order);
88  fprintf_filtered (stream, "{length: %ld", length);
89 
90  if (el_type == NULL)
91  {
92  CORE_ADDR element;
93  CORE_ADDR next_element = -1; /* Dummy initial value. */
94 
95  /* Skip object header and length. */
96  address += get_java_object_header_size (gdbarch) + 4;
97 
98  while (i < length && things_printed < options->print_max)
99  {
100  gdb_byte *buf;
101 
102  buf = alloca (gdbarch_ptr_bit (gdbarch) / HOST_CHAR_BIT);
103  fputs_filtered (", ", stream);
104  wrap_here (n_spaces (2));
105 
106  if (i > 0)
107  element = next_element;
108  else
109  {
110  read_memory (address, buf, sizeof (buf));
111  address += gdbarch_ptr_bit (gdbarch) / HOST_CHAR_BIT;
112  /* FIXME: cagney/2003-05-24: Bogus or what. It
113  pulls a host sized pointer out of the target and
114  then extracts that as an address (while assuming
115  that the address is unsigned)! */
116  element = extract_unsigned_integer (buf, sizeof (buf),
117  byte_order);
118  }
119 
120  for (reps = 1; i + reps < length; reps++)
121  {
122  read_memory (address, buf, sizeof (buf));
123  address += gdbarch_ptr_bit (gdbarch) / HOST_CHAR_BIT;
124  /* FIXME: cagney/2003-05-24: Bogus or what. It
125  pulls a host sized pointer out of the target and
126  then extracts that as an address (while assuming
127  that the address is unsigned)! */
128  next_element = extract_unsigned_integer (buf, sizeof (buf),
129  byte_order);
130  if (next_element != element)
131  break;
132  }
133 
134  if (reps == 1)
135  fprintf_filtered (stream, "%d: ", i);
136  else
137  fprintf_filtered (stream, "%d..%d: ", i, i + reps - 1);
138 
139  if (element == 0)
140  fprintf_filtered (stream, "null");
141  else
142  fprintf_filtered (stream, "@%s", paddress (gdbarch, element));
143 
144  things_printed++;
145  i += reps;
146  }
147  }
148  else
149  {
150  struct value *v = allocate_value (el_type);
151  struct value *next_v = allocate_value (el_type);
152 
153  set_value_address (v, (address
154  + get_java_object_header_size (gdbarch) + 4));
155  set_value_address (next_v, value_raw_address (v));
156 
157  while (i < length && things_printed < options->print_max)
158  {
159  fputs_filtered (", ", stream);
160  wrap_here (n_spaces (2));
161 
162  if (i > 0)
163  {
164  struct value *tmp;
165 
166  tmp = next_v;
167  next_v = v;
168  v = tmp;
169  }
170  else
171  {
172  set_value_lazy (v, 1);
173  set_value_offset (v, 0);
174  }
175 
176  set_value_offset (next_v, value_offset (v));
177 
178  for (reps = 1; i + reps < length; reps++)
179  {
180  set_value_lazy (next_v, 1);
181  set_value_offset (next_v, value_offset (next_v)
182  + TYPE_LENGTH (el_type));
183  value_fetch_lazy (next_v);
185  next_v,
186  value_embedded_offset (next_v),
187  TYPE_LENGTH (el_type)))
188  break;
189  }
190 
191  if (reps == 1)
192  fprintf_filtered (stream, "%d: ", i);
193  else
194  fprintf_filtered (stream, "%d..%d: ", i, i + reps - 1);
195 
196  opts = *options;
197  opts.deref_ref = 1;
198  common_val_print (v, stream, 1, &opts, current_language);
199 
200  things_printed++;
201  i += reps;
202  }
203  }
204 
205  if (i < length)
206  fprintf_filtered (stream, "...");
207 
208  fprintf_filtered (stream, "}");
209 
210  return;
211  }
212 
213  /* If it's type String, print it. */
214 
215  if (TYPE_CODE (type) == TYPE_CODE_PTR
216  && TYPE_TARGET_TYPE (type)
217  && TYPE_TAG_NAME (TYPE_TARGET_TYPE (type))
218  && strcmp (TYPE_TAG_NAME (TYPE_TARGET_TYPE (type)),
219  "java.lang.String") == 0
220  && (options->format == 0 || options->format == 's')
221  && address != 0
222  && value_as_address (val) != 0)
223  {
224  struct type *char_type;
225  struct value *data_val;
226  CORE_ADDR data;
227  struct value *boffset_val;
228  unsigned long boffset;
229  struct value *count_val;
230  unsigned long count;
231  struct value *mark;
232 
233  fputs_filtered (" ", stream);
234 
235  mark = value_mark (); /* Remember start of new values. */
236 
237  data_val = value_struct_elt (&val, NULL, "data", NULL, NULL);
238  data = value_as_address (data_val);
239 
240  boffset_val = value_struct_elt (&val, NULL, "boffset", NULL, NULL);
241  boffset = value_as_address (boffset_val);
242 
243  count_val = value_struct_elt (&val, NULL, "count", NULL, NULL);
244  count = value_as_address (count_val);
245 
246  value_free_to_mark (mark); /* Release unnecessary values. */
247 
248  char_type = builtin_java_type (gdbarch)->builtin_char;
249  val_print_string (char_type, NULL, data + boffset, count, stream,
250  options);
251 
252  return;
253  }
254 
255  opts = *options;
256  opts.deref_ref = 1;
257  common_val_print (val, stream, 0, &opts, current_language);
258 }
259 
260 /* TYPE, VALADDR, ADDRESS, STREAM, RECURSE, and OPTIONS have the
261  same meanings as in cp_print_value and c_val_print.
262 
263  DONT_PRINT is an array of baseclass types that we
264  should not print, or zero if called from top level. */
265 
266 static void
267 java_print_value_fields (struct type *type, const gdb_byte *valaddr,
268  int offset,
269  CORE_ADDR address, struct ui_file *stream,
270  int recurse,
271  const struct value *val,
272  const struct value_print_options *options)
273 {
274  int i, len, n_baseclasses;
275 
276  CHECK_TYPEDEF (type);
277 
278  fprintf_filtered (stream, "{");
279  len = TYPE_NFIELDS (type);
280  n_baseclasses = TYPE_N_BASECLASSES (type);
281 
282  if (n_baseclasses > 0)
283  {
284  int i, n_baseclasses = TYPE_N_BASECLASSES (type);
285 
286  for (i = 0; i < n_baseclasses; i++)
287  {
288  int boffset;
289  struct type *baseclass = check_typedef (TYPE_BASECLASS (type, i));
290  const char *basename = TYPE_NAME (baseclass);
291  const gdb_byte *base_valaddr;
292 
293  if (BASETYPE_VIA_VIRTUAL (type, i))
294  continue;
295 
296  if (basename != NULL && strcmp (basename, "java.lang.Object") == 0)
297  continue;
298 
299  boffset = 0;
300 
301  if (options->prettyformat)
302  {
303  fprintf_filtered (stream, "\n");
304  print_spaces_filtered (2 * (recurse + 1), stream);
305  }
306  fputs_filtered ("<", stream);
307  /* Not sure what the best notation is in the case where there is no
308  baseclass name. */
309  fputs_filtered (basename ? basename : "", stream);
310  fputs_filtered ("> = ", stream);
311 
312  base_valaddr = valaddr;
313 
314  java_print_value_fields (baseclass, base_valaddr,
315  offset + boffset, address,
316  stream, recurse + 1, val, options);
317  fputs_filtered (", ", stream);
318  }
319  }
320 
321  if (!len && n_baseclasses == 1)
322  fprintf_filtered (stream, "<No data fields>");
323  else
324  {
325  int fields_seen = 0;
326 
327  for (i = n_baseclasses; i < len; i++)
328  {
329  /* If requested, skip printing of static fields. */
330  if (field_is_static (&TYPE_FIELD (type, i)))
331  {
332  const char *name = TYPE_FIELD_NAME (type, i);
333 
334  if (!options->static_field_print)
335  continue;
336  if (name != NULL && strcmp (name, "class") == 0)
337  continue;
338  }
339  if (fields_seen)
340  fprintf_filtered (stream, ", ");
341  else if (n_baseclasses > 0)
342  {
343  if (options->prettyformat)
344  {
345  fprintf_filtered (stream, "\n");
346  print_spaces_filtered (2 + 2 * recurse, stream);
347  fputs_filtered ("members of ", stream);
348  fputs_filtered (type_name_no_tag (type), stream);
349  fputs_filtered (": ", stream);
350  }
351  }
352  fields_seen = 1;
353 
354  if (options->prettyformat)
355  {
356  fprintf_filtered (stream, "\n");
357  print_spaces_filtered (2 + 2 * recurse, stream);
358  }
359  else
360  {
361  wrap_here (n_spaces (2 + 2 * recurse));
362  }
363 
365 
366  if (field_is_static (&TYPE_FIELD (type, i)))
367  fputs_filtered ("static ", stream);
368  fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i),
370  DMGL_PARAMS | DMGL_ANSI);
372  fputs_filtered (": ", stream);
374 
375  if (!field_is_static (&TYPE_FIELD (type, i))
376  && TYPE_FIELD_PACKED (type, i))
377  {
378  struct value *v;
379 
380  /* Bitfields require special handling, especially due to byte
381  order problems. */
382  if (TYPE_FIELD_IGNORE (type, i))
383  {
384  fputs_filtered ("<optimized out or zero length>", stream);
385  }
386  else if (value_bits_synthetic_pointer (val,
387  TYPE_FIELD_BITPOS (type,
388  i),
389  TYPE_FIELD_BITSIZE (type,
390  i)))
391  {
392  fputs_filtered (_("<synthetic pointer>"), stream);
393  }
394  else
395  {
396  struct value_print_options opts;
397 
398  v = value_field_bitfield (type, i, valaddr, offset, val);
399 
400  opts = *options;
401  opts.deref_ref = 0;
402  common_val_print (v, stream, recurse + 1,
403  &opts, current_language);
404  }
405  }
406  else
407  {
408  if (TYPE_FIELD_IGNORE (type, i))
409  {
410  fputs_filtered ("<optimized out or zero length>", stream);
411  }
412  else if (field_is_static (&TYPE_FIELD (type, i)))
413  {
414  struct value_print_options opts;
415  struct value *v = value_static_field (type, i);
416  struct type *t = check_typedef (value_type (v));
417 
418  if (TYPE_CODE (t) == TYPE_CODE_STRUCT)
419  v = value_addr (v);
420  opts = *options;
421  opts.deref_ref = 0;
422  common_val_print (v, stream, recurse + 1,
423  &opts, current_language);
424  }
425  else if (TYPE_FIELD_TYPE (type, i) == NULL)
426  fputs_filtered ("<unknown type>", stream);
427  else
428  {
429  struct value_print_options opts = *options;
430 
431  opts.deref_ref = 0;
432  val_print (TYPE_FIELD_TYPE (type, i),
433  valaddr,
434  offset + TYPE_FIELD_BITPOS (type, i) / 8,
435  address, stream, recurse + 1, val, &opts,
437  }
438  }
440  }
441 
442  if (options->prettyformat)
443  {
444  fprintf_filtered (stream, "\n");
445  print_spaces_filtered (2 * recurse, stream);
446  }
447  }
448  fprintf_filtered (stream, "}");
449 }
450 
451 /* See val_print for a description of the various parameters of this
452  function; they are identical. */
453 
454 void
455 java_val_print (struct type *type, const gdb_byte *valaddr,
456  int embedded_offset, CORE_ADDR address,
457  struct ui_file *stream, int recurse,
458  const struct value *val,
459  const struct value_print_options *options)
460 {
461  struct gdbarch *gdbarch = get_type_arch (type);
462  struct type *target_type;
463  CORE_ADDR addr;
464 
465  CHECK_TYPEDEF (type);
466  switch (TYPE_CODE (type))
467  {
468  case TYPE_CODE_PTR:
469  if (options->format && options->format != 's')
470  {
471  val_print_scalar_formatted (type, valaddr, embedded_offset,
472  val, options, 0, stream);
473  break;
474  }
475  addr = unpack_pointer (type, valaddr + embedded_offset);
476  if (addr == 0)
477  {
478  fputs_filtered ("null", stream);
479  return;
480  }
481  target_type = check_typedef (TYPE_TARGET_TYPE (type));
482 
483  if (TYPE_CODE (target_type) == TYPE_CODE_FUNC)
484  {
485  /* Try to print what function it points to. */
486  print_address_demangle (options, gdbarch, addr, stream, demangle);
487  return;
488  }
489 
490  if (options->addressprint && options->format != 's')
491  {
492  fputs_filtered ("@", stream);
493  print_longest (stream, 'x', 0, (ULONGEST) addr);
494  }
495 
496  return;
497 
498  case TYPE_CODE_CHAR:
499  case TYPE_CODE_INT:
500  /* Can't just call c_val_print because that prints bytes as C
501  chars. */
502  if (options->format || options->output_format)
503  {
504  struct value_print_options opts = *options;
505 
506  opts.format = (options->format ? options->format
507  : options->output_format);
508  val_print_scalar_formatted (type, valaddr, embedded_offset,
509  val, &opts, 0, stream);
510  }
511  else if (TYPE_CODE (type) == TYPE_CODE_CHAR
512  || (TYPE_CODE (type) == TYPE_CODE_INT
513  && TYPE_LENGTH (type) == 2
514  && strcmp (TYPE_NAME (type), "char") == 0))
515  LA_PRINT_CHAR ((int) unpack_long (type, valaddr + embedded_offset),
516  type, stream);
517  else
518  val_print_type_code_int (type, valaddr + embedded_offset, stream);
519  break;
520 
521  case TYPE_CODE_STRUCT:
522  java_print_value_fields (type, valaddr, embedded_offset,
523  address, stream, recurse, val, options);
524  break;
525 
526  default:
527  c_val_print (type, valaddr, embedded_offset, address, stream,
528  recurse, val, options);
529  break;
530  }
531 }
void val_print_scalar_formatted(struct type *type, const gdb_byte *valaddr, int embedded_offset, const struct value *val, const struct value_print_options *options, int size, struct ui_file *stream)
Definition: valprint.c:960
ULONGEST extract_unsigned_integer(const gdb_byte *, int, enum bfd_endian)
Definition: findvar.c:84
void annotate_field_value(void)
Definition: annotate.c:274
struct value * value_mark(void)
Definition: value.c:1499
int demangle
Definition: demangle.c:49
void fprintf_symbol_filtered(struct ui_file *stream, const char *name, enum language lang, int arg_mode)
Definition: utils.c:2477
CORE_ADDR value_raw_address(struct value *value)
Definition: value.c:1453
struct value * value_addr(struct value *arg1)
Definition: valops.c:1472
void java_val_print(struct type *type, const gdb_byte *valaddr, int embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options)
Definition: jv-valprint.c:455
struct value * value_field_bitfield(struct type *type, int fieldno, const gdb_byte *valaddr, int embedded_offset, const struct value *val)
Definition: value.c:3323
void value_free_to_mark(struct value *mark)
Definition: value.c:1551
struct type * java_primitive_type_from_name(struct gdbarch *gdbarch, const char *name, int namelen)
Definition: jv-lang.c:666
static void java_print_value_fields(struct type *type, const gdb_byte *valaddr, int offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options)
Definition: jv-valprint.c:267
bfd_vma CORE_ADDR
Definition: common-types.h:41
#define TYPE_FIELD_NAME(thistype, n)
Definition: gdbtypes.h:1369
#define TYPE_N_BASECLASSES(thistype)
Definition: gdbtypes.h:1327
int value_offset(const struct value *value)
Definition: value.c:1032
CORE_ADDR unpack_pointer(struct type *type, const gdb_byte *valaddr)
Definition: value.c:2914
void java_value_print(struct value *val, struct ui_file *stream, const struct value_print_options *options)
Definition: jv-valprint.c:35
#define TYPE_NAME(thistype)
Definition: gdbtypes.h:1227
int gdbarch_ptr_bit(struct gdbarch *gdbarch)
Definition: gdbarch.c:1690
struct value * value_at(struct type *type, CORE_ADDR addr)
Definition: valops.c:940
void common_val_print(struct value *val, struct ui_file *stream, int recurse, const struct value_print_options *options, const struct language_defn *language)
Definition: valprint.c:846
const struct builtin_java_type * builtin_java_type(struct gdbarch *gdbarch)
Definition: jv-lang.c:1236
#define BASETYPE_VIA_VIRTUAL(thistype, index)
Definition: gdbtypes.h:1335
void val_print_type_code_int(struct type *type, const gdb_byte *valaddr, struct ui_file *stream)
Definition: valprint.c:898
void c_val_print(struct type *, const gdb_byte *, int, CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *)
Definition: c-valprint.c:134
void type_print(struct type *type, const char *varstring, struct ui_file *stream, int show)
Definition: typeprint.c:360
void set_value_lazy(struct value *value, int val)
Definition: value.c:1311
struct value * value_ind(struct value *arg1)
Definition: valops.c:1533
void annotate_field_name_end(void)
Definition: annotate.c:267
#define _(String)
Definition: gdb_locale.h:40
#define TYPE_FIELD(thistype, n)
Definition: gdbtypes.h:1367
#define TYPE_FIELD_TYPE(thistype, n)
Definition: gdbtypes.h:1368
enum val_prettyformat prettyformat
Definition: valprint.h:28
struct value * allocate_value(struct type *type)
Definition: value.c:962
struct type * type_from_class(struct gdbarch *gdbarch, struct value *clas)
Definition: jv-lang.c:262
const char * paddress(struct gdbarch *gdbarch, CORE_ADDR addr)
Definition: utils.c:2743
void set_value_address(struct value *value, CORE_ADDR addr)
Definition: value.c:1463
const char *const name
Definition: aarch64-tdep.c:68
struct value * value_struct_elt(struct value **argp, struct value **args, const char *name, int *static_memfuncp, const char *err)
Definition: valops.c:2128
struct type * check_typedef(struct type *type)
Definition: gdbtypes.c:2217
int field_is_static(struct field *f)
Definition: gdbtypes.c:3797
struct value * value_static_field(struct type *type, int fieldno)
Definition: value.c:2926
void fprintf_filtered(struct ui_file *stream, const char *format,...)
Definition: utils.c:2351
void fputs_filtered(const char *linebuffer, struct ui_file *stream)
Definition: utils.c:2145
enum bfd_endian gdbarch_byte_order(struct gdbarch *gdbarch)
Definition: gdbarch.c:1420
#define TYPE_FIELD_IGNORE(thistype, n)
Definition: gdbtypes.h:1402
Definition: gdbtypes.h:749
struct gdbarch * get_type_arch(const struct type *type)
Definition: gdbtypes.c:232
char * n_spaces(int n)
Definition: utils.c:2442
static const char * type
Definition: language.c:103
void set_value_offset(struct value *value, int offset)
Definition: value.c:1037
#define TYPE_BASECLASS(thistype, index)
Definition: gdbtypes.h:1326
void wrap_here(char *indent)
Definition: utils.c:1930
struct value * java_class_from_object(struct value *obj_val)
Definition: jv-lang.c:233
#define TYPE_FIELD_PACKED(thistype, n)
Definition: gdbtypes.h:1378
int get_java_object_header_size(struct gdbarch *gdbarch)
Definition: jv-lang.c:600
void read_memory(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
Definition: corefile.c:244
#define TYPE_FIELD_BITSIZE(thistype, n)
Definition: gdbtypes.h:1377
LONGEST unpack_long(struct type *type, const gdb_byte *valaddr)
Definition: value.c:2797
#define TYPE_FIELD_BITPOS(thistype, n)
Definition: gdbtypes.h:1371
Definition: value.c:172
int value_bits_synthetic_pointer(const struct value *value, int offset, int length)
Definition: value.c:1376
void print_spaces_filtered(int n, struct ui_file *stream)
Definition: utils.c:2464
bfd_byte gdb_byte
Definition: common-types.h:38
unsigned length
Definition: gdbtypes.h:807
int value_contents_eq(const struct value *val1, int offset1, const struct value *val2, int offset2, int length)
Definition: value.c:865
const struct language_defn * current_language
Definition: language.c:85
#define TYPE_TARGET_TYPE(thistype)
Definition: gdbtypes.h:1229
void print_longest(struct ui_file *stream, int format, int use_c_format, LONGEST val_long)
Definition: valprint.c:1016
void value_fetch_lazy(struct value *val)
Definition: value.c:3793
#define TYPE_CODE(thistype)
Definition: gdbtypes.h:1240
int offset
Definition: agent.c:65
#define TYPE_NFIELDS(thistype)
Definition: gdbtypes.h:1241
int print_address_demangle(const struct value_print_options *opts, struct gdbarch *gdbarch, CORE_ADDR addr, struct ui_file *stream, int do_demangle)
Definition: printcmd.c:771
#define CHECK_TYPEDEF(TYPE)
Definition: gdbtypes.h:1817
int value_logical_not(struct value *arg1)
Definition: valarith.c:1513
#define TYPE_TAG_NAME(type)
Definition: gdbtypes.h:1228
int is_object_type(struct type *type)
Definition: jv-lang.c:611
void annotate_field_end(void)
Definition: annotate.c:281
unsigned long long ULONGEST
Definition: common-types.h:53
int value_embedded_offset(struct value *value)
Definition: value.c:1388
struct type * builtin_char
Definition: jv-lang.h:38
struct type * value_type(const struct value *value)
Definition: value.c:1021
CORE_ADDR value_as_address(struct value *val)
Definition: value.c:2679
const char * type_name_no_tag(const struct type *type)
Definition: gdbtypes.c:1361
#define TYPE_LENGTH(thistype)
Definition: gdbtypes.h:1237
#define HOST_CHAR_BIT
Definition: host-defs.h:40
int val_print_string(struct type *elttype, const char *encoding, CORE_ADDR addr, int len, struct ui_file *stream, const struct value_print_options *options)
Definition: valprint.c:2496
CORE_ADDR address
Definition: value.c:216
#define LA_PRINT_CHAR(ch, type, stream)
Definition: language.h:494
LONGEST extract_signed_integer(const gdb_byte *, int, enum bfd_endian)
Definition: findvar.c:49
CORE_ADDR value_address(const struct value *value)
Definition: value.c:1440
enum bfd_endian byte_order
Definition: gdbarch.c:128
void val_print(struct type *type, const gdb_byte *valaddr, int embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, const struct language_defn *language)
Definition: valprint.c:737
struct type * lookup_pointer_type(struct type *type)
Definition: gdbtypes.c:368
void annotate_field_begin(struct type *type)
Definition: annotate.c:256
const ULONGEST const LONGEST len
Definition: target.h:309