+Sat Sep 17 02:26:58 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * cp-valprint.c (static_field_print): New variable, controls
+ printing of static members.
+ (_initialize_cp_valprint): New print set subcommand
+ "static-members". Turn on printing of static members by default.
+ (cp_print_value_fields): Print static members if necessary.
+
+ * solib.c: Remove inclusion of libelf.h and elf/mips.h.
+ (elf_locate_base): Use only standard BFD functions to collect
+ information about the .dynamic section. Check for DT_MIPS_RLD_MAP
+ tag only if it got defined via the inclusion of <link.h>.
+
+ * f-exp.y: Write block for OP_VAR_VALUE.
+ * f-valprint.c (info_common_command): Handle `info common'
+ without an argument correctly.
+
+ * c-typeprint.c (c_type_print_base): Handle template constructors.
+ * symtab.c (gdb_mangle_name): Handle template method mangling,
+ get rid of GCC_MANGLE_BUG code, which only applied to gcc-2.2.2.
+
Fri Sep 16 16:06:08 1994 Per Bothner (bothner@kalessin.cygnus.com)
* gdbtypes.h (TYPE_INDEX_TYPE): New macro.
#include <string.h>
#include <errno.h>
+#include <ctype.h>
static void
c_type_print_args PARAMS ((struct type *, GDB_FILE *));
int is_constructor = name && STREQ(method_name, name);
for (j = 0; j < len2; j++)
{
+ char *physname = TYPE_FN_FIELD_PHYSNAME (f, j);
+ int is_full_physname_constructor =
+ ((physname[0]=='_' && physname[1]=='_' &&
+ (isdigit(physname[2])
+ || physname[2]=='Q'
+ || physname[2]=='t'))
+ || (strncmp(physname, "__ct__", 6) == 0));
+
QUIT;
if (TYPE_FN_FIELD_PROTECTED (f, j))
{
TYPE_FN_FIELD_PHYSNAME (f, j));
break;
}
- else if (!is_constructor)
+ else if (!is_constructor && !is_full_physname_constructor)
{
type_print (TYPE_TARGET_TYPE (TYPE_FN_FIELD_TYPE (f, j)),
"", stream, 0);
int vtblprint; /* Controls printing of vtbl's */
int objectprint; /* Controls looking up an object's derived type
using what we find in its vtables. */
+static int static_field_print; /* Controls printing of static fields. */
struct obstack dont_print_obstack;
static void
for (i = n_baseclasses; i < len; i++)
{
- /* Check if static field */
- if (TYPE_FIELD_STATIC (type, i))
+ /* If requested, skip printing of static fields. */
+ if (!static_field_print && TYPE_FIELD_STATIC (type, i))
continue;
if (fields_seen)
fprintf_filtered (stream, ", ");
fputs_filtered ("\"( ptr \"", stream);
else
fputs_filtered ("\"( nodef \"", stream);
+ if (TYPE_FIELD_STATIC (type, i))
+ fputs_filtered ("static ", stream);
fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i),
language_cplus,
DMGL_PARAMS | DMGL_ANSI);
{
annotate_field_begin (TYPE_FIELD_TYPE (type, i));
+ if (TYPE_FIELD_STATIC (type, i))
+ fputs_filtered ("static ", stream);
fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i),
language_cplus,
DMGL_PARAMS | DMGL_ANSI);
annotate_field_value ();
}
- if (TYPE_FIELD_PACKED (type, i))
+ if (!TYPE_FIELD_STATIC (type, i) && TYPE_FIELD_PACKED (type, i))
{
value_ptr v;
{
fputs_filtered ("<optimized out or zero length>", stream);
}
+ else if (TYPE_FIELD_STATIC (type, i))
+ {
+ value_ptr v;
+ char *phys_name = TYPE_FIELD_STATIC_PHYSNAME (type, i);
+ struct symbol *sym =
+ lookup_symbol (phys_name, 0, VAR_NAMESPACE, 0, NULL);
+ if (sym == NULL)
+ fputs_filtered ("<optimized out>", stream);
+ else
+ {
+ v = value_at (TYPE_FIELD_TYPE (type, i),
+ (CORE_ADDR)SYMBOL_BLOCK_VALUE (sym));
+ val_print (TYPE_FIELD_TYPE (type, i),
+ VALUE_CONTENTS_RAW (v),
+ VALUE_ADDRESS (v),
+ stream, format, 0, recurse + 1, pretty);
+ }
+ }
else
{
val_print (TYPE_FIELD_TYPE (type, i),
void
_initialize_cp_valprint ()
{
+ add_show_from_set
+ (add_set_cmd ("static-members", class_support, var_boolean,
+ (char *)&static_field_print,
+ "Set printing of C++ static members.",
+ &setprintlist),
+ &showprintlist);
+ /* Turn on printing of static fields. */
+ static_field_print = 1;
+
add_show_from_set
(add_set_cmd ("vtbl", class_support, var_boolean, (char *)&vtblprint,
"Set printing of C++ virtual function tables.",