nodebug_data_symbol, nodebug_unknown_symbol, and nodebug_tls_symbol.
* gdbtypes.c (gdbtypes_post_init): Initialize nodebug_ default types.
* parse.c (msym_text_symbol_type, msym_data_symbol_type): Remove.
(msym_unknown_symbol_type, msym_tls_symbol_type): Remove.
(write_exp_msymbol): Use builtin nodebug_ types instead of them.
(build_parse): Remove.
(_initialize_parse): Do not call build_parse. Do not register
msym_ types for gdbarch-swapping.
* dwarf2read.c (new_symbol): Use default nodebug_data_symbol type
instead of creating private type.
* xcoffread.c (func_symbol_type, var_symbol_type): Remove.
(_initialize_xcoffread): Do not initialized them.
(process_xcoff_symbol): Use builtin nodebug_ types instead of them.
* mdebugread.c (nodebug_func_symbol_type): Remove.
(nodebug_var_symbol_type): Remove.
(_initialize_mdebugread): Do not initialize them.
(parse_symbol): Use builtin nodebug_ type instead of them.
(parse_procedure): Likewise.
+2007-06-22 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * gdbtypes.h (struct builtin_type): New members nodebug_text_symbol,
+ nodebug_data_symbol, nodebug_unknown_symbol, and nodebug_tls_symbol.
+ * gdbtypes.c (gdbtypes_post_init): Initialize nodebug_ default types.
+
+ * parse.c (msym_text_symbol_type, msym_data_symbol_type): Remove.
+ (msym_unknown_symbol_type, msym_tls_symbol_type): Remove.
+ (write_exp_msymbol): Use builtin nodebug_ types instead of them.
+ (build_parse): Remove.
+ (_initialize_parse): Do not call build_parse. Do not register
+ msym_ types for gdbarch-swapping.
+
+ * dwarf2read.c (new_symbol): Use default nodebug_data_symbol type
+ instead of creating private type.
+
+ * xcoffread.c (func_symbol_type, var_symbol_type): Remove.
+ (_initialize_xcoffread): Do not initialized them.
+ (process_xcoff_symbol): Use builtin nodebug_ types instead of them.
+
+ * mdebugread.c (nodebug_func_symbol_type): Remove.
+ (nodebug_var_symbol_type): Remove.
+ (_initialize_mdebugread): Do not initialize them.
+ (parse_symbol): Use builtin nodebug_ type instead of them.
+ (parse_procedure): Likewise.
+
2007-06-21 Chris Dearman <chris@mips.com>
* printcmd.c (do_one_display): If display/i, start with an initial
with missing type entries. Change the misleading `void' type
to something sensible. */
if (TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_VOID)
- SYMBOL_TYPE (sym) = init_type (TYPE_CODE_INT,
- gdbarch_int_bit (current_gdbarch)
- / HOST_CHAR_BIT,
- 0, "<variable, no debug info>",
- objfile);
+ SYMBOL_TYPE (sym)
+ = builtin_type (current_gdbarch)->nodebug_data_symbol;
+
attr = dwarf2_attr (die, DW_AT_const_value, cu);
if (attr)
{
TYPE_FLAG_UNSIGNED,
"__CORE_ADDR", (struct objfile *) NULL);
+
+ /* The following set of types is used for symbols with no
+ debug information. */
+ builtin_type->nodebug_text_symbol
+ = init_type (TYPE_CODE_FUNC, 1, 0, "<text variable, no debug info>", NULL);
+ TYPE_TARGET_TYPE (builtin_type->nodebug_text_symbol)
+ = builtin_type->builtin_int;
+ builtin_type->nodebug_data_symbol
+ = init_type (TYPE_CODE_INT, gdbarch_int_bit (gdbarch) / HOST_CHAR_BIT, 0,
+ "<data variable, no debug info>", NULL);
+ builtin_type->nodebug_unknown_symbol
+ = init_type (TYPE_CODE_INT, 1, 0,
+ "<variable (not text or data), no debug info>", NULL);
+ builtin_type->nodebug_tls_symbol
+ = init_type (TYPE_CODE_INT, gdbarch_int_bit (gdbarch) / HOST_CHAR_BIT, 0,
+ "<thread local variable, no debug info>", NULL);
+
return builtin_type;
}
/* The target CPU's address type. This is the ISA address size. */
struct type *builtin_core_addr;
+
+ /* Types used for symbols with no debug information. */
+ struct type *nodebug_text_symbol;
+ struct type *nodebug_data_symbol;
+ struct type *nodebug_unknown_symbol;
+ struct type *nodebug_tls_symbol;
+
+
/* Integral types. */
/* We use this for the '/c' print format, because c_char is just a
static struct type *mdebug_type_float_dec;
static struct type *mdebug_type_string;
-/* Types for symbols from files compiled without debugging info. */
-
-static struct type *nodebug_func_symbol_type;
-static struct type *nodebug_var_symbol_type;
-
/* Nonzero if we have seen ecoff debugging info for a file. */
static int found_ecoff_debugging_info;
/* Type could be missing if file is compiled without debugging info. */
if (SC_IS_UNDEF (sh->sc)
|| sh->sc == scNil || sh->index == indexNil)
- SYMBOL_TYPE (s) = nodebug_var_symbol_type;
+ SYMBOL_TYPE (s) = builtin_type (current_gdbarch)->nodebug_data_symbol;
else
SYMBOL_TYPE (s) = parse_type (cur_fd, ax, sh->index, 0, bigend, name);
/* Value of a data symbol is its memory address */
if (processing_gcc_compilation == 0
&& found_ecoff_debugging_info == 0
&& TYPE_CODE (TYPE_TARGET_TYPE (SYMBOL_TYPE (s))) == TYPE_CODE_VOID)
- SYMBOL_TYPE (s) = nodebug_func_symbol_type;
+ SYMBOL_TYPE (s) = builtin_type (current_gdbarch)->nodebug_text_symbol;
}
/* Parse the external symbol ES. Just call parse_symbol() after
gdbarch_double_bit (current_gdbarch) / TARGET_CHAR_BIT,
0, "floating decimal",
(struct objfile *) NULL);
-
- nodebug_func_symbol_type = init_type (TYPE_CODE_FUNC, 1, 0,
- "<function, no debug info>", NULL);
- TYPE_TARGET_TYPE (nodebug_func_symbol_type) = mdebug_type_int;
- nodebug_var_symbol_type =
- init_type (TYPE_CODE_INT,
- gdbarch_int_bit (current_gdbarch) / HOST_CHAR_BIT, 0,
- "<variable, no debug info>", NULL);
}
based on the language, but they no longer have names like "int", so
the initial rationale is gone. */
-static struct type *msym_text_symbol_type;
-static struct type *msym_data_symbol_type;
-static struct type *msym_unknown_symbol_type;
-static struct type *msym_tls_symbol_type;
-
void
write_exp_msymbol (struct minimal_symbol *msymbol,
struct type *text_symbol_type,
struct type *data_symbol_type)
{
+ struct gdbarch *gdbarch = current_gdbarch;
CORE_ADDR addr;
write_exp_elt_opcode (OP_LONG);
write_exp_elt_opcode (UNOP_MEMVAL_TLS);
write_exp_elt_objfile (ofp);
- write_exp_elt_type (msym_tls_symbol_type);
+ write_exp_elt_type (builtin_type (gdbarch)->nodebug_tls_symbol);
write_exp_elt_opcode (UNOP_MEMVAL_TLS);
return;
}
case mst_text:
case mst_file_text:
case mst_solib_trampoline:
- write_exp_elt_type (msym_text_symbol_type);
+ write_exp_elt_type (builtin_type (gdbarch)->nodebug_text_symbol);
break;
case mst_data:
case mst_file_data:
case mst_bss:
case mst_file_bss:
- write_exp_elt_type (msym_data_symbol_type);
+ write_exp_elt_type (builtin_type (gdbarch)->nodebug_data_symbol);
break;
default:
- write_exp_elt_type (msym_unknown_symbol_type);
+ write_exp_elt_type (builtin_type (gdbarch)->nodebug_unknown_symbol);
break;
}
write_exp_elt_opcode (UNOP_MEMVAL);
return follow_type;
}
\f
-static void build_parse (void);
-static void
-build_parse (void)
-{
- int i;
-
- msym_text_symbol_type =
- init_type (TYPE_CODE_FUNC, 1, 0, "<text variable, no debug info>", NULL);
- TYPE_TARGET_TYPE (msym_text_symbol_type) = builtin_type_int;
- msym_data_symbol_type =
- init_type (TYPE_CODE_INT,
- gdbarch_int_bit (current_gdbarch) / HOST_CHAR_BIT, 0,
- "<data variable, no debug info>", NULL);
- msym_unknown_symbol_type =
- init_type (TYPE_CODE_INT, 1, 0,
- "<variable (not text or data), no debug info>",
- NULL);
-
- msym_tls_symbol_type =
- init_type (TYPE_CODE_INT,
- gdbarch_int_bit (current_gdbarch) / HOST_CHAR_BIT, 0,
- "<thread local variable, no debug info>", NULL);
-}
-
/* This function avoids direct calls to fprintf
in the parser generated debug code. */
void
type_stack = (union type_stack_elt *)
xmalloc (type_stack_size * sizeof (*type_stack));
- build_parse ();
-
- /* FIXME - For the moment, handle types by swapping them in and out.
- Should be using the per-architecture data-pointer and a large
- struct. */
- DEPRECATED_REGISTER_GDBARCH_SWAP (msym_text_symbol_type);
- DEPRECATED_REGISTER_GDBARCH_SWAP (msym_data_symbol_type);
- DEPRECATED_REGISTER_GDBARCH_SWAP (msym_unknown_symbol_type);
- deprecated_register_gdbarch_swap (NULL, 0, build_parse);
-
add_setshow_zinteger_cmd ("expression", class_maintenance,
&expressiondebug, _("\
Set expression debugging."), _("\
(ALLOCED) ? (NAME) : obsavestring ((NAME), strlen (NAME), &objfile->objfile_obstack);
-static struct type *func_symbol_type;
-static struct type *var_symbol_type;
-
/* process one xcoff symbol. */
static struct symbol *
patch_block_stabs (), unless the file was compiled without -g. */
DEPRECATED_SYMBOL_NAME (sym) = SYMNAME_ALLOC (name, symname_alloced);
- SYMBOL_TYPE (sym) = func_symbol_type;
+ SYMBOL_TYPE (sym) = builtin_type (current_gdbarch)->nodebug_text_symbol;
SYMBOL_CLASS (sym) = LOC_BLOCK;
SYMBOL_DUP (sym, sym2);
else
{
/* In case we can't figure out the type, provide default. */
- SYMBOL_TYPE (sym) = var_symbol_type;
+ SYMBOL_TYPE (sym) = builtin_type (current_gdbarch)->nodebug_data_symbol;
switch (cs->c_sclass)
{
_initialize_xcoffread (void)
{
add_symtab_fns (&xcoff_sym_fns);
-
- func_symbol_type = init_type (TYPE_CODE_FUNC, 1, 0,
- "<function, no debug info>", NULL);
- TYPE_TARGET_TYPE (func_symbol_type) = builtin_type_int;
- var_symbol_type =
- init_type (TYPE_CODE_INT,
- gdbarch_int_bit (current_gdbarch) / HOST_CHAR_BIT, 0,
- "<variable, no debug info>", NULL);
}