OLD | NEW |
1 /* Definitions for values of C expressions, for GDB. | 1 /* Definitions for values of C expressions, for GDB. |
2 | 2 |
3 Copyright (C) 1986-2012 Free Software Foundation, Inc. | 3 Copyright (C) 1986-2012 Free Software Foundation, Inc. |
4 | 4 |
5 This file is part of GDB. | 5 This file is part of GDB. |
6 | 6 |
7 This program is free software; you can redistribute it and/or modify | 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 | 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 | 9 the Free Software Foundation; either version 3 of the License, or |
10 (at your option) any later version. | 10 (at your option) any later version. |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 gdbarch_bits_big_endian=1 targets, it is the position of the MSB. */ | 67 gdbarch_bits_big_endian=1 targets, it is the position of the MSB. */ |
68 | 68 |
69 extern int value_bitpos (const struct value *); | 69 extern int value_bitpos (const struct value *); |
70 extern void set_value_bitpos (struct value *, int bit); | 70 extern void set_value_bitpos (struct value *, int bit); |
71 | 71 |
72 /* Only used for bitfields; the containing value. This allows a | 72 /* Only used for bitfields; the containing value. This allows a |
73 single read from the target when displaying multiple | 73 single read from the target when displaying multiple |
74 bitfields. */ | 74 bitfields. */ |
75 | 75 |
76 struct value *value_parent (struct value *); | 76 struct value *value_parent (struct value *); |
| 77 extern void set_value_parent (struct value *value, struct value *parent); |
77 | 78 |
78 /* Describes offset of a value within lval of a structure in bytes. | 79 /* Describes offset of a value within lval of a structure in bytes. |
79 If lval == lval_memory, this is an offset to the address. If lval | 80 If lval == lval_memory, this is an offset to the address. If lval |
80 == lval_register, this is a further offset from location.address | 81 == lval_register, this is a further offset from location.address |
81 within the registers structure. Note also the member | 82 within the registers structure. Note also the member |
82 embedded_offset below. */ | 83 embedded_offset below. */ |
83 | 84 |
84 extern int value_offset (const struct value *); | 85 extern int value_offset (const struct value *); |
85 extern void set_value_offset (struct value *, int offset); | 86 extern void set_value_offset (struct value *, int offset); |
86 | 87 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 until you indirect anyway.) | 131 until you indirect anyway.) |
131 | 132 |
132 If we're not doing anything fancy, `enclosing_type' is equal to | 133 If we're not doing anything fancy, `enclosing_type' is equal to |
133 `type', and `embedded_offset' is zero, so everything works | 134 `type', and `embedded_offset' is zero, so everything works |
134 normally. */ | 135 normally. */ |
135 | 136 |
136 extern struct type *value_enclosing_type (struct value *); | 137 extern struct type *value_enclosing_type (struct value *); |
137 extern void set_value_enclosing_type (struct value *val, | 138 extern void set_value_enclosing_type (struct value *val, |
138 struct type *new_type); | 139 struct type *new_type); |
139 | 140 |
| 141 /* Returns value_type or value_enclosing_type depending on |
| 142 value_print_options.objectprint. |
| 143 |
| 144 If RESOLVE_SIMPLE_TYPES is 0 the enclosing type will be resolved |
| 145 only for pointers and references, else it will be returned |
| 146 for all the types (e.g. structures). This option is useful |
| 147 to prevent retrieving enclosing type for the base classes fields. |
| 148 |
| 149 REAL_TYPE_FOUND is used to inform whether the real type was found |
| 150 (or just static type was used). The NULL may be passed if it is not |
| 151 necessary. */ |
| 152 |
| 153 extern struct type *value_actual_type (struct value *value, |
| 154 int resolve_simple_types, |
| 155 int *real_type_found); |
| 156 |
140 extern int value_pointed_to_offset (struct value *value); | 157 extern int value_pointed_to_offset (struct value *value); |
141 extern void set_value_pointed_to_offset (struct value *value, int val); | 158 extern void set_value_pointed_to_offset (struct value *value, int val); |
142 extern int value_embedded_offset (struct value *value); | 159 extern int value_embedded_offset (struct value *value); |
143 extern void set_value_embedded_offset (struct value *value, int val); | 160 extern void set_value_embedded_offset (struct value *value, int val); |
144 | 161 |
145 /* For lval_computed values, this structure holds functions used to | 162 /* For lval_computed values, this structure holds functions used to |
146 retrieve and set the value (or portions of the value). | 163 retrieve and set the value (or portions of the value). |
147 | 164 |
148 For each function, 'V' is the 'this' pointer: an lval_funcs | 165 For each function, 'V' is the 'this' pointer: an lval_funcs |
149 function F may always assume that the V it receives is an | 166 function F may always assume that the V it receives is an |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 void (*free_closure) (struct value *v); | 222 void (*free_closure) (struct value *v); |
206 }; | 223 }; |
207 | 224 |
208 /* Create a computed lvalue, with type TYPE, function pointers FUNCS, | 225 /* Create a computed lvalue, with type TYPE, function pointers FUNCS, |
209 and closure CLOSURE. */ | 226 and closure CLOSURE. */ |
210 | 227 |
211 extern struct value *allocate_computed_value (struct type *type, | 228 extern struct value *allocate_computed_value (struct type *type, |
212 const struct lval_funcs *funcs, | 229 const struct lval_funcs *funcs, |
213 void *closure); | 230 void *closure); |
214 | 231 |
| 232 /* Helper function to check the validity of some bits of a value. |
| 233 |
| 234 If TYPE represents some aggregate type (e.g., a structure), return 1. |
| 235 |
| 236 Otherwise, any of the bytes starting at OFFSET and extending for |
| 237 TYPE_LENGTH(TYPE) bytes are invalid, print a message to STREAM and |
| 238 return 0. The checking is done using FUNCS. |
| 239 |
| 240 Otherwise, return 1. */ |
| 241 |
| 242 extern int valprint_check_validity (struct ui_file *stream, struct type *type, |
| 243 int embedded_offset, |
| 244 const struct value *val); |
| 245 |
215 extern struct value *allocate_optimized_out_value (struct type *type); | 246 extern struct value *allocate_optimized_out_value (struct type *type); |
216 | 247 |
217 /* If VALUE is lval_computed, return its lval_funcs structure. */ | 248 /* If VALUE is lval_computed, return its lval_funcs structure. */ |
218 | 249 |
219 extern const struct lval_funcs *value_computed_funcs (const struct value *); | 250 extern const struct lval_funcs *value_computed_funcs (const struct value *); |
220 | 251 |
221 /* If VALUE is lval_computed, return its closure. The meaning of the | 252 /* If VALUE is lval_computed, return its closure. The meaning of the |
222 returned value depends on the functions VALUE uses. */ | 253 returned value depends on the functions VALUE uses. */ |
223 | 254 |
224 extern void *value_computed_closure (const struct value *value); | 255 extern void *value_computed_closure (const struct value *value); |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 | 375 |
345 /* Register number if the value is from a register. */ | 376 /* Register number if the value is from a register. */ |
346 extern short *deprecated_value_regnum_hack (struct value *); | 377 extern short *deprecated_value_regnum_hack (struct value *); |
347 #define VALUE_REGNUM(val) (*deprecated_value_regnum_hack (val)) | 378 #define VALUE_REGNUM(val) (*deprecated_value_regnum_hack (val)) |
348 | 379 |
349 /* Return value after lval_funcs->coerce_ref (after check_typedef). Return | 380 /* Return value after lval_funcs->coerce_ref (after check_typedef). Return |
350 NULL if lval_funcs->coerce_ref is not applicable for whatever reason. */ | 381 NULL if lval_funcs->coerce_ref is not applicable for whatever reason. */ |
351 | 382 |
352 extern struct value *coerce_ref_if_computed (const struct value *arg); | 383 extern struct value *coerce_ref_if_computed (const struct value *arg); |
353 | 384 |
| 385 /* Setup a new value type and enclosing value type for dereferenced value VALUE. |
| 386 ENC_TYPE is the new enclosing type that should be set. ORIGINAL_TYPE and |
| 387 ORIGINAL_VAL are the type and value of the original reference or pointer. |
| 388 |
| 389 Note, that VALUE is modified by this function. |
| 390 |
| 391 It is a common implementation for coerce_ref and value_ind. */ |
| 392 |
| 393 extern struct value * readjust_indirect_value_type (struct value *value, |
| 394 struct type *enc_type, |
| 395 struct type *original_type, |
| 396 struct value *original_val); |
| 397 |
354 /* Convert a REF to the object referenced. */ | 398 /* Convert a REF to the object referenced. */ |
355 | 399 |
356 extern struct value *coerce_ref (struct value *value); | 400 extern struct value *coerce_ref (struct value *value); |
357 | 401 |
358 /* If ARG is an array, convert it to a pointer. | 402 /* If ARG is an array, convert it to a pointer. |
359 If ARG is a function, convert it to a function pointer. | 403 If ARG is a function, convert it to a function pointer. |
360 | 404 |
361 References are dereferenced. */ | 405 References are dereferenced. */ |
362 | 406 |
363 extern struct value *coerce_array (struct value *value); | 407 extern struct value *coerce_array (struct value *value); |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 extern void read_value_memory (struct value *val, int embedded_offset, | 481 extern void read_value_memory (struct value *val, int embedded_offset, |
438 int stack, CORE_ADDR memaddr, | 482 int stack, CORE_ADDR memaddr, |
439 gdb_byte *buffer, size_t length); | 483 gdb_byte *buffer, size_t length); |
440 | 484 |
441 | 485 |
442 | 486 |
443 | 487 |
444 #include "symtab.h" | 488 #include "symtab.h" |
445 #include "gdbtypes.h" | 489 #include "gdbtypes.h" |
446 #include "expression.h" | 490 #include "expression.h" |
error: old chunk mismatch |
None
OLD | NEW |