| 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-2013 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. |
| 11 | 11 |
| 12 This program is distributed in the hope that it will be useful, | 12 This program is distributed in the hope that it will be useful, |
| 13 but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 embedded_offset below. */ | 83 embedded_offset below. */ |
| 84 | 84 |
| 85 extern int value_offset (const struct value *); | 85 extern int value_offset (const struct value *); |
| 86 extern void set_value_offset (struct value *, int offset); | 86 extern void set_value_offset (struct value *, int offset); |
| 87 | 87 |
| 88 /* The comment from "struct value" reads: ``Is it modifiable? Only | 88 /* The comment from "struct value" reads: ``Is it modifiable? Only |
| 89 relevant if lval != not_lval.''. Shouldn't the value instead be | 89 relevant if lval != not_lval.''. Shouldn't the value instead be |
| 90 not_lval and be done with it? */ | 90 not_lval and be done with it? */ |
| 91 | 91 |
| 92 extern int deprecated_value_modifiable (struct value *value); | 92 extern int deprecated_value_modifiable (struct value *value); |
| 93 extern void deprecated_set_value_modifiable (struct value *value, | |
| 94 int modifiable); | |
| 95 | 93 |
| 96 /* If a value represents a C++ object, then the `type' field gives the | 94 /* If a value represents a C++ object, then the `type' field gives the |
| 97 object's compile-time type. If the object actually belongs to some | 95 object's compile-time type. If the object actually belongs to some |
| 98 class derived from `type', perhaps with other base classes and | 96 class derived from `type', perhaps with other base classes and |
| 99 additional members, then `type' is just a subobject of the real | 97 additional members, then `type' is just a subobject of the real |
| 100 thing, and the full object is probably larger than `type' would | 98 thing, and the full object is probably larger than `type' would |
| 101 suggest. | 99 suggest. |
| 102 | 100 |
| 103 If `type' is a dynamic class (i.e. one with a vtable), then GDB can | 101 If `type' is a dynamic class (i.e. one with a vtable), then GDB can |
| 104 actually determine the object's run-time type by looking at the | 102 actually determine the object's run-time type by looking at the |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 when the user wants to watch a single struct member or array | 266 when the user wants to watch a single struct member or array |
| 269 element. If you ever change the way lazy flag is set and reset, be | 267 element. If you ever change the way lazy flag is set and reset, be |
| 270 sure to consider this use as well! */ | 268 sure to consider this use as well! */ |
| 271 | 269 |
| 272 extern int value_lazy (struct value *); | 270 extern int value_lazy (struct value *); |
| 273 extern void set_value_lazy (struct value *value, int val); | 271 extern void set_value_lazy (struct value *value, int val); |
| 274 | 272 |
| 275 extern int value_stack (struct value *); | 273 extern int value_stack (struct value *); |
| 276 extern void set_value_stack (struct value *value, int val); | 274 extern void set_value_stack (struct value *value, int val); |
| 277 | 275 |
| 276 /* Throw an error complaining that the value has been optimized |
| 277 out. */ |
| 278 |
| 279 extern void error_value_optimized_out (void); |
| 280 |
| 278 /* value_contents() and value_contents_raw() both return the address | 281 /* value_contents() and value_contents_raw() both return the address |
| 279 of the gdb buffer used to hold a copy of the contents of the lval. | 282 of the gdb buffer used to hold a copy of the contents of the lval. |
| 280 value_contents() is used when the contents of the buffer are needed | 283 value_contents() is used when the contents of the buffer are needed |
| 281 -- it uses value_fetch_lazy() to load the buffer from the process | 284 -- it uses value_fetch_lazy() to load the buffer from the process |
| 282 being debugged if it hasn't already been loaded | 285 being debugged if it hasn't already been loaded |
| 283 (value_contents_writeable() is used when a writeable but fetched | 286 (value_contents_writeable() is used when a writeable but fetched |
| 284 buffer is required).. value_contents_raw() is used when data is | 287 buffer is required).. value_contents_raw() is used when data is |
| 285 being stored into the buffer, or when it is certain that the | 288 being stored into the buffer, or when it is certain that the |
| 286 contents of the buffer are valid. | 289 contents of the buffer are valid. |
| 287 | 290 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 314 /* Like value_contents_for_printing, but accepts a constant value | 317 /* Like value_contents_for_printing, but accepts a constant value |
| 315 pointer. Unlike value_contents_for_printing however, the pointed | 318 pointer. Unlike value_contents_for_printing however, the pointed |
| 316 value must _not_ be lazy. */ | 319 value must _not_ be lazy. */ |
| 317 extern const gdb_byte * | 320 extern const gdb_byte * |
| 318 value_contents_for_printing_const (const struct value *value); | 321 value_contents_for_printing_const (const struct value *value); |
| 319 | 322 |
| 320 extern int value_fetch_lazy (struct value *val); | 323 extern int value_fetch_lazy (struct value *val); |
| 321 extern int value_contents_equal (struct value *val1, struct value *val2); | 324 extern int value_contents_equal (struct value *val1, struct value *val2); |
| 322 | 325 |
| 323 /* If nonzero, this is the value of a variable which does not actually | 326 /* If nonzero, this is the value of a variable which does not actually |
| 324 exist in the program. */ | 327 exist in the program, at least partially. If the value is lazy, |
| 328 this may fetch it now. */ |
| 325 extern int value_optimized_out (struct value *value); | 329 extern int value_optimized_out (struct value *value); |
| 326 extern void set_value_optimized_out (struct value *value, int val); | 330 extern void set_value_optimized_out (struct value *value, int val); |
| 327 | 331 |
| 332 /* Like value_optimized_out, but don't fetch the value even if it is |
| 333 lazy. Mainly useful for constructing other values using VALUE as |
| 334 template. */ |
| 335 extern int value_optimized_out_const (const struct value *value); |
| 336 |
| 328 /* Like value_optimized_out, but return false if any bit in the object | 337 /* Like value_optimized_out, but return false if any bit in the object |
| 329 is valid. */ | 338 is valid. */ |
| 330 extern int value_entirely_optimized_out (const struct value *value); | 339 extern int value_entirely_optimized_out (const struct value *value); |
| 331 | 340 |
| 332 /* Set or return field indicating whether a variable is initialized or | 341 /* Set or return field indicating whether a variable is initialized or |
| 333 not, based on debugging information supplied by the compiler. | 342 not, based on debugging information supplied by the compiler. |
| 334 1 = initialized; 0 = uninitialized. */ | 343 1 = initialized; 0 = uninitialized. */ |
| 335 extern int value_initialized (struct value *); | 344 extern int value_initialized (struct value *); |
| 336 extern void set_value_initialized (struct value *, int); | 345 extern void set_value_initialized (struct value *, int); |
| 337 | 346 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 nonzero if all bytes in the given range are available, zero if any | 433 nonzero if all bytes in the given range are available, zero if any |
| 425 byte is unavailable. */ | 434 byte is unavailable. */ |
| 426 | 435 |
| 427 extern int value_bytes_available (const struct value *value, | 436 extern int value_bytes_available (const struct value *value, |
| 428 int offset, int length); | 437 int offset, int length); |
| 429 | 438 |
| 430 /* Like value_bytes_available, but return false if any byte in the | 439 /* Like value_bytes_available, but return false if any byte in the |
| 431 whole object is unavailable. */ | 440 whole object is unavailable. */ |
| 432 extern int value_entirely_available (struct value *value); | 441 extern int value_entirely_available (struct value *value); |
| 433 | 442 |
| 443 /* Like value_entirely_available, but return false if any byte in the |
| 444 whole object is available. */ |
| 445 extern int value_entirely_unavailable (struct value *value); |
| 446 |
| 434 /* Mark VALUE's content bytes starting at OFFSET and extending for | 447 /* Mark VALUE's content bytes starting at OFFSET and extending for |
| 435 LENGTH bytes as unavailable. */ | 448 LENGTH bytes as unavailable. */ |
| 436 | 449 |
| 437 extern void mark_value_bytes_unavailable (struct value *value, | 450 extern void mark_value_bytes_unavailable (struct value *value, |
| 438 int offset, int length); | 451 int offset, int length); |
| 439 | 452 |
| 440 /* Compare LENGTH bytes of VAL1's contents starting at OFFSET1 with | 453 /* Compare LENGTH bytes of VAL1's contents starting at OFFSET1 with |
| 441 LENGTH bytes of VAL2's contents starting at OFFSET2. | 454 LENGTH bytes of VAL2's contents starting at OFFSET2. |
| 442 | 455 |
| 443 Note that "contents" refers to the whole value's contents | 456 Note that "contents" refers to the whole value's contents |
| (...skipping 14 matching lines...) Expand all Loading... |
| 458 contents: xxxxVVVVxxxxVVZZ | 471 contents: xxxxVVVVxxxxVVZZ |
| 459 | 472 |
| 460 then: | 473 then: |
| 461 | 474 |
| 462 value_available_contents_eq(val, 0, val, 8, 6) => 1 | 475 value_available_contents_eq(val, 0, val, 8, 6) => 1 |
| 463 value_available_contents_eq(val, 0, val, 4, 4) => 1 | 476 value_available_contents_eq(val, 0, val, 4, 4) => 1 |
| 464 value_available_contents_eq(val, 0, val, 8, 8) => 0 | 477 value_available_contents_eq(val, 0, val, 8, 8) => 0 |
| 465 value_available_contents_eq(val, 4, val, 12, 2) => 1 | 478 value_available_contents_eq(val, 4, val, 12, 2) => 1 |
| 466 value_available_contents_eq(val, 4, val, 12, 4) => 0 | 479 value_available_contents_eq(val, 4, val, 12, 4) => 0 |
| 467 value_available_contents_eq(val, 3, val, 4, 4) => 0 | 480 value_available_contents_eq(val, 3, val, 4, 4) => 0 |
| 468 */ | 481 |
| 482 We only know whether a value chunk is available if we've tried to |
| 483 read it. As this routine is used by printing routines, which may |
| 484 be printing values in the value history, long after the inferior is |
| 485 gone, it works with const values. Therefore, this routine must not |
| 486 be called with lazy values. */ |
| 469 | 487 |
| 470 extern int value_available_contents_eq (const struct value *val1, int offset1, | 488 extern int value_available_contents_eq (const struct value *val1, int offset1, |
| 471 const struct value *val2, int offset2, | 489 const struct value *val2, int offset2, |
| 472 int length); | 490 int length); |
| 473 | 491 |
| 474 /* Read LENGTH bytes of memory starting at MEMADDR into BUFFER, which | 492 /* Read LENGTH bytes of memory starting at MEMADDR into BUFFER, which |
| 475 is (or will be copied to) VAL's contents buffer offset by | 493 is (or will be copied to) VAL's contents buffer offset by |
| 476 EMBEDDED_OFFSET (that is, to &VAL->contents[EMBEDDED_OFFSET]). | 494 EMBEDDED_OFFSET (that is, to &VAL->contents[EMBEDDED_OFFSET]). |
| 477 Marks value contents ranges as unavailable if the corresponding | 495 Marks value contents ranges as unavailable if the corresponding |
| 478 memory is likewise unavailable. STACK indicates whether the memory | 496 memory is likewise unavailable. STACK indicates whether the memory |
| 479 is known to be stack memory. */ | 497 is known to be stack memory. */ |
| 480 | 498 |
| 481 extern void read_value_memory (struct value *val, int embedded_offset, | 499 extern void read_value_memory (struct value *val, int embedded_offset, |
error: old chunk mismatch |
None
| OLD | NEW |