/* Support for printing C++ values for GDB, the GNU debugger.
- Copyright (C) 1986-2013 Free Software Foundation, Inc.
+ Copyright (C) 1986-2014 Free Software Foundation, Inc.
This file is part of GDB.
#include "gdbcmd.h"
#include "demangle.h"
#include "annotate.h"
-#include "gdb_string.h"
+#include <string.h>
#include "c-lang.h"
#include "target.h"
#include "cp-abi.h"
#include "valprint.h"
#include "cp-support.h"
#include "language.h"
-#include "python/python.h"
+#include "extension.h"
#include "exceptions.h"
#include "typeprint.h"
fprintf_filtered (stream, ", ");
else if (n_baseclasses > 0)
{
- if (options->pretty)
+ if (options->prettyformat)
{
fprintf_filtered (stream, "\n");
print_spaces_filtered (2 + 2 * recurse, stream);
}
fields_seen = 1;
- if (options->pretty)
+ if (options->prettyformat)
{
fprintf_filtered (stream, "\n");
print_spaces_filtered (2 + 2 * recurse, stream);
TYPE_FIELD_BITPOS (type, i),
TYPE_FIELD_BITSIZE (type, i)))
{
- val_print_optimized_out (stream);
+ val_print_optimized_out (val, stream);
}
else
{
fprintf_filtered (stream,
_("<error reading variable: %s>"),
ex.message);
- else if (v == NULL)
- val_print_optimized_out (stream);
- else
- cp_print_static_field (TYPE_FIELD_TYPE (type, i),
- v, stream, recurse + 1,
- options);
+ cp_print_static_field (TYPE_FIELD_TYPE (type, i),
+ v, stream, recurse + 1,
+ options);
}
else if (i == vptr_fieldno && type == vptr_basetype)
{
}
}
- if (options->pretty)
+ if (options->prettyformat)
{
fprintf_filtered (stream, "\n");
print_spaces_filtered (2 * recurse, stream);
}
/* Now do the printing. */
- if (options->pretty)
+ if (options->prettyformat)
{
fprintf_filtered (stream, "\n");
print_spaces_filtered (2 * recurse, stream);
{
int result = 0;
- /* Attempt to run the Python pretty-printers on the
+ /* Attempt to run an extension language pretty-printer on the
baseclass if possible. */
if (!options->raw)
- result = apply_val_pretty_printer (baseclass, base_valaddr,
- thisoffset + boffset,
- value_address (base_val),
- stream, recurse, base_val,
- options, current_language);
+ result
+ = apply_ext_lang_val_pretty_printer (baseclass, base_valaddr,
+ thisoffset + boffset,
+ value_address (base_val),
+ stream, recurse,
+ base_val, options,
+ current_language);
-
-
if (!result)
cp_print_value_fields (baseclass, thistype, base_valaddr,
thisoffset + boffset,
const struct value_print_options *options)
{
struct value_print_options opts;
-
+
+ if (value_entirely_optimized_out (val))
+ {
+ val_print_optimized_out (val, stream);
+ return;
+ }
+
if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
{
CORE_ADDR *first_dont_print;