* gdbtypes.h (struct main_type): Change type of name,tag_name,

and fields.name members from char * to const char *.  All uses updated.
	(struct cplus_struct_type): Change type of fn_fieldlists.name member
	from char * to const char *.  All uses updated.
	(type_name_no_tag): Update.
	(lookup_unsigned_typename, lookup_signed_typename): Update.
	* gdbtypes.c (type_name_no_tag): Change result type
	from char * to const char *.  All callers updated.
	(lookup_unsigned_typename, lookup_signed_typename): Change type of
	name parameter from char * to const char *.
	* symtab.h (struct cplus_specific): Change type of demangled_name
	member from char * to const char *.  All uses updated.
	(struct general_symbol_info): Change type of name and
	mangled_lang.demangled_name members from char * to const char *.
	All uses updated.
	(symbol_get_demangled_name, symbol_natural_name): Update.
	(symbol_demangled_name, symbol_search_name): Update.
	* symtab.c (symbol_get_demangled_name): Change result type
	from char * to const char *.  All callers updated.
	(symbol_natural_name, symbol_demangled_name): Ditto.
	(symbol_search_name): Ditto.
	(completion_list_add_name): Change type of symname,sym_text,
	text,word parameters from char * to const char *.
	(completion_list_objc_symbol): Change type of sym_text,
	text,word parameters from char * to const char *.
	* ada-lang.c (find_struct_field): Change type of name parameter
	from char * to const char *.
	(encoded_ordered_before): Similarly for N0,N1 parameters.
	(old_renaming_is_invisible): Similarly for function_name parameter.
	(ada_type_name): Change result type from char * to const char *.
	All callers updated.
	* ada-lang.h (ada_type_name): Update.
	* buildsym.c (hashname): Change type of name parameter
	from char * to const char *.
	* buildsym.h (hashname): Update.
	* dbxread.c (end_psymtab): Change type of include_list parameter
	from char ** to const char **.
	* dwarf2read.c (determine_prefix): Change result type
	from char * to const char *.  All callers updated.
	* f-lang.c (find_common_for_function): Change type of name, funcname
	parameters from char * to const char *.
	* f-lang.c (find_common_for_function): Update.
	* f-valprint.c (list_all_visible_commons): Change type of funcname
	parameters from char * to const char *.
	* gdbarch.sh (static_transform_name): Change type of name parameter
	and result from char * to const char *.
	* gdbarch.c: Regenerate.
	* gdbarch.h: Regenerate.
	* i386-sol2-tdep.c (i386_sol2_static_transform_name): Change type
	of name parameter from char * to const char *.
	* jv-lang.c (java_primitive_type_from_name): Ditto.
	(java_demangled_signature_length): Similarly for signature parameter.
	(java_demangled_signature_copy): Ditto.
	(java_demangle_type_signature): Ditto.
	* jv-lang.h (java_primitive_type_from_name): Update.
	(java_demangle_type_signature): Update.
	* objc-lang.c (specialcmp): Change type of a,b parameters
	from char * to const char *.
	* p-lang.c (is_pascal_string_type): Change type of arrayname parameter
	from char * to const char *.  All callers updated.
	* p-lang.h (is_pascal_string_type): Update.
	* solib-frv.c (find_canonical_descriptor_in_load_object): Change type
	of name parameter from char * to const char *.
	* sparc-sol2-tdep.c (sparc_sol2_static_transform_name): Ditto.
	* utils.c (fprintf_symbol_filtered): Ditto.
	* defs.h (fprintf_symbol_filtered): Update.
	* sparc-tdep.h (sparc_sol2_static_transform_name): Update.
	* stabsread.h (end_psymtab): Update.
	* stack.c (find_frame_funname): Change type of funname parameter
	from char ** to const char **.
	* stack.h (find_frame_funname): Update.
	* typeprint.c (type_print): Change type of varstring parameter
	from char * to const char *.
	* value.h (type_print): Update.
	* xcoffread.c (xcoff_start_psymtab): Change type of filename parameter
	from char * to const char *.  All callers updated.
	(xcoff_end_psymtab): Change type of include_list parameter
	from char ** to const char **.  All callers updated.
	(swap_sym): Similarly for name parameter.  All callers updated.
	* coffread.c (patch_type): Add (char*) cast to xfree parameter.
	Use xstrdup.
	(process_coff_symbol): Use xstrdup.
	* stabsread.c (stabs_method_name_from_physname): Renamed from
	update_method_name_from_physname.  Change result type from void
	to char *.  All callers updated.
	(read_member_functions): In has_destructor case, store name in objfile
	obstack instead of malloc space.  In !has_stub case, fix mem leak.
This commit is contained in:
Doug Evans 2012-02-07 04:48:23 +00:00
parent 7fda53d583
commit 0d5cff5020
64 changed files with 367 additions and 266 deletions

View file

@ -1,3 +1,93 @@
2012-02-06 Doug Evans <dje@google.com>
* gdbtypes.h (struct main_type): Change type of name,tag_name,
and fields.name members from char * to const char *. All uses updated.
(struct cplus_struct_type): Change type of fn_fieldlists.name member
from char * to const char *. All uses updated.
(type_name_no_tag): Update.
(lookup_unsigned_typename, lookup_signed_typename): Update.
* gdbtypes.c (type_name_no_tag): Change result type
from char * to const char *. All callers updated.
(lookup_unsigned_typename, lookup_signed_typename): Change type of
name parameter from char * to const char *.
* symtab.h (struct cplus_specific): Change type of demangled_name
member from char * to const char *. All uses updated.
(struct general_symbol_info): Change type of name and
mangled_lang.demangled_name members from char * to const char *.
All uses updated.
(symbol_get_demangled_name, symbol_natural_name): Update.
(symbol_demangled_name, symbol_search_name): Update.
* symtab.c (symbol_get_demangled_name): Change result type
from char * to const char *. All callers updated.
(symbol_natural_name, symbol_demangled_name): Ditto.
(symbol_search_name): Ditto.
(completion_list_add_name): Change type of symname,sym_text,
text,word parameters from char * to const char *.
(completion_list_objc_symbol): Change type of sym_text,
text,word parameters from char * to const char *.
* ada-lang.c (find_struct_field): Change type of name parameter
from char * to const char *.
(encoded_ordered_before): Similarly for N0,N1 parameters.
(old_renaming_is_invisible): Similarly for function_name parameter.
(ada_type_name): Change result type from char * to const char *.
All callers updated.
* ada-lang.h (ada_type_name): Update.
* buildsym.c (hashname): Change type of name parameter
from char * to const char *.
* buildsym.h (hashname): Update.
* dbxread.c (end_psymtab): Change type of include_list parameter
from char ** to const char **.
* dwarf2read.c (determine_prefix): Change result type
from char * to const char *. All callers updated.
* f-lang.c (find_common_for_function): Change type of name, funcname
parameters from char * to const char *.
* f-lang.c (find_common_for_function): Update.
* f-valprint.c (list_all_visible_commons): Change type of funcname
parameters from char * to const char *.
* gdbarch.sh (static_transform_name): Change type of name parameter
and result from char * to const char *.
* gdbarch.c: Regenerate.
* gdbarch.h: Regenerate.
* i386-sol2-tdep.c (i386_sol2_static_transform_name): Change type
of name parameter from char * to const char *.
* jv-lang.c (java_primitive_type_from_name): Ditto.
(java_demangled_signature_length): Similarly for signature parameter.
(java_demangled_signature_copy): Ditto.
(java_demangle_type_signature): Ditto.
* jv-lang.h (java_primitive_type_from_name): Update.
(java_demangle_type_signature): Update.
* objc-lang.c (specialcmp): Change type of a,b parameters
from char * to const char *.
* p-lang.c (is_pascal_string_type): Change type of arrayname parameter
from char * to const char *. All callers updated.
* p-lang.h (is_pascal_string_type): Update.
* solib-frv.c (find_canonical_descriptor_in_load_object): Change type
of name parameter from char * to const char *.
* sparc-sol2-tdep.c (sparc_sol2_static_transform_name): Ditto.
* utils.c (fprintf_symbol_filtered): Ditto.
* defs.h (fprintf_symbol_filtered): Update.
* sparc-tdep.h (sparc_sol2_static_transform_name): Update.
* stabsread.h (end_psymtab): Update.
* stack.c (find_frame_funname): Change type of funname parameter
from char ** to const char **.
* stack.h (find_frame_funname): Update.
* typeprint.c (type_print): Change type of varstring parameter
from char * to const char *.
* value.h (type_print): Update.
* xcoffread.c (xcoff_start_psymtab): Change type of filename parameter
from char * to const char *. All callers updated.
(xcoff_end_psymtab): Change type of include_list parameter
from char ** to const char **. All callers updated.
(swap_sym): Similarly for name parameter. All callers updated.
* coffread.c (patch_type): Add (char*) cast to xfree parameter.
Use xstrdup.
(process_coff_symbol): Use xstrdup.
* stabsread.c (stabs_method_name_from_physname): Renamed from
update_method_name_from_physname. Change result type from void
to char *. All callers updated.
(read_member_functions): In has_destructor case, store name in objfile
obstack instead of malloc space. In !has_stub case, fix mem leak.
2012-02-06 Luca Pizzamiglio <luca.pizzamiglio@gmail.com> 2012-02-06 Luca Pizzamiglio <luca.pizzamiglio@gmail.com>
* configure: Rebuild. * configure: Rebuild.

View file

@ -223,7 +223,7 @@ static struct value *ada_search_struct_field (char *, struct value *, int,
static struct value *ada_value_primitive_field (struct value *, int, int, static struct value *ada_value_primitive_field (struct value *, int, int,
struct type *); struct type *);
static int find_struct_field (char *, struct type *, int, static int find_struct_field (const char *, struct type *, int,
struct type **, int *, int *, int *, int *); struct type **, int *, int *, int *, int *);
static struct value *ada_to_fixed_value_create (struct type *, CORE_ADDR, static struct value *ada_to_fixed_value_create (struct type *, CORE_ADDR,
@ -1370,7 +1370,7 @@ ada_fixup_array_indexes_type (struct type *index_desc_type)
/* Fixup each field of INDEX_DESC_TYPE. */ /* Fixup each field of INDEX_DESC_TYPE. */
for (i = 0; i < TYPE_NFIELDS (index_desc_type); i++) for (i = 0; i < TYPE_NFIELDS (index_desc_type); i++)
{ {
char *name = TYPE_FIELD_NAME (index_desc_type, i); const char *name = TYPE_FIELD_NAME (index_desc_type, i);
struct type *raw_type = ada_check_typedef (ada_find_any_type (name)); struct type *raw_type = ada_check_typedef (ada_find_any_type (name));
if (raw_type) if (raw_type)
@ -1962,8 +1962,8 @@ ada_is_unconstrained_packed_array_type (struct type *type)
static long static long
decode_packed_array_bitsize (struct type *type) decode_packed_array_bitsize (struct type *type)
{ {
char *raw_name; const char *raw_name;
char *tail; const char *tail;
long bits; long bits;
/* Access to arrays implemented as fat pointers are encoded as a typedef /* Access to arrays implemented as fat pointers are encoded as a typedef
@ -2042,9 +2042,9 @@ constrained_packed_array_type (struct type *type, long *elt_bits)
static struct type * static struct type *
decode_constrained_packed_array_type (struct type *type) decode_constrained_packed_array_type (struct type *type)
{ {
char *raw_name = ada_type_name (ada_check_typedef (type)); const char *raw_name = ada_type_name (ada_check_typedef (type));
char *name; char *name;
char *tail; const char *tail;
struct type *shadow_type; struct type *shadow_type;
long bits; long bits;
@ -3407,7 +3407,7 @@ ada_resolve_function (struct ada_symbol_info syms[],
such symbols by their trailing number (__N or $N). */ such symbols by their trailing number (__N or $N). */
static int static int
encoded_ordered_before (char *N0, char *N1) encoded_ordered_before (const char *N0, const char *N1)
{ {
if (N1 == NULL) if (N1 == NULL)
return 0; return 0;
@ -4248,8 +4248,8 @@ lesseq_defined_than (struct symbol *sym0, struct symbol *sym1)
{ {
struct type *type0 = SYMBOL_TYPE (sym0); struct type *type0 = SYMBOL_TYPE (sym0);
struct type *type1 = SYMBOL_TYPE (sym1); struct type *type1 = SYMBOL_TYPE (sym1);
char *name0 = SYMBOL_LINKAGE_NAME (sym0); const char *name0 = SYMBOL_LINKAGE_NAME (sym0);
char *name1 = SYMBOL_LINKAGE_NAME (sym1); const char *name1 = SYMBOL_LINKAGE_NAME (sym1);
int len0 = strlen (name0); int len0 = strlen (name0);
return return
@ -4380,7 +4380,7 @@ add_symbols_from_enclosing_procs (struct obstack *obstackp,
static int static int
is_nondebugging_type (struct type *type) is_nondebugging_type (struct type *type)
{ {
char *name = ada_type_name (type); const char *name = ada_type_name (type);
return (name != NULL && strcmp (name, "<variable, no debug info>") == 0); return (name != NULL && strcmp (name, "<variable, no debug info>") == 0);
} }
@ -4411,8 +4411,8 @@ ada_identical_enum_types_p (struct type *type1, struct type *type2)
suffix). */ suffix). */
for (i = 0; i < TYPE_NFIELDS (type1); i++) for (i = 0; i < TYPE_NFIELDS (type1); i++)
{ {
char *name_1 = TYPE_FIELD_NAME (type1, i); const char *name_1 = TYPE_FIELD_NAME (type1, i);
char *name_2 = TYPE_FIELD_NAME (type2, i); const char *name_2 = TYPE_FIELD_NAME (type2, i);
int len_1 = strlen (name_1); int len_1 = strlen (name_1);
int len_2 = strlen (name_2); int len_2 = strlen (name_2);
@ -4647,7 +4647,7 @@ is_package_name (const char *name)
not visible from FUNCTION_NAME. */ not visible from FUNCTION_NAME. */
static int static int
old_renaming_is_invisible (const struct symbol *sym, char *function_name) old_renaming_is_invisible (const struct symbol *sym, const char *function_name)
{ {
char *scope; char *scope;
@ -4717,7 +4717,7 @@ remove_irrelevant_renamings (struct ada_symbol_info *syms,
int nsyms, const struct block *current_block) int nsyms, const struct block *current_block)
{ {
struct symbol *current_function; struct symbol *current_function;
char *current_function_name; const char *current_function_name;
int i; int i;
int is_new_style_renaming; int is_new_style_renaming;
@ -5854,7 +5854,7 @@ ada_make_symbol_completion_list (char *text0, char *word)
static int static int
ada_is_dispatch_table_ptr_type (struct type *type) ada_is_dispatch_table_ptr_type (struct type *type)
{ {
char *name; const char *name;
if (TYPE_CODE (type) != TYPE_CODE_PTR) if (TYPE_CODE (type) != TYPE_CODE_PTR)
return 0; return 0;
@ -6367,7 +6367,7 @@ ada_value_primitive_field (struct value *arg1, int offset, int fieldno,
Returns 1 if found, 0 otherwise. */ Returns 1 if found, 0 otherwise. */
static int static int
find_struct_field (char *name, struct type *type, int offset, find_struct_field (const char *name, struct type *type, int offset,
struct type **field_type_p, struct type **field_type_p,
int *byte_offset_p, int *bit_offset_p, int *bit_size_p, int *byte_offset_p, int *bit_offset_p, int *bit_size_p,
int *index_p) int *index_p)
@ -6389,7 +6389,7 @@ find_struct_field (char *name, struct type *type, int offset,
{ {
int bit_pos = TYPE_FIELD_BITPOS (type, i); int bit_pos = TYPE_FIELD_BITPOS (type, i);
int fld_offset = offset + bit_pos / 8; int fld_offset = offset + bit_pos / 8;
char *t_field_name = TYPE_FIELD_NAME (type, i); const char *t_field_name = TYPE_FIELD_NAME (type, i);
if (t_field_name == NULL) if (t_field_name == NULL)
continue; continue;
@ -6466,7 +6466,7 @@ ada_search_struct_field (char *name, struct value *arg, int offset,
type = ada_check_typedef (type); type = ada_check_typedef (type);
for (i = 0; i < TYPE_NFIELDS (type); i += 1) for (i = 0; i < TYPE_NFIELDS (type); i += 1)
{ {
char *t_field_name = TYPE_FIELD_NAME (type, i); const char *t_field_name = TYPE_FIELD_NAME (type, i);
if (t_field_name == NULL) if (t_field_name == NULL)
continue; continue;
@ -6725,7 +6725,7 @@ ada_lookup_struct_elt_type (struct type *type, char *name, int refok,
for (i = 0; i < TYPE_NFIELDS (type); i += 1) for (i = 0; i < TYPE_NFIELDS (type); i += 1)
{ {
char *t_field_name = TYPE_FIELD_NAME (type, i); const char *t_field_name = TYPE_FIELD_NAME (type, i);
struct type *t; struct type *t;
int disp; int disp;
@ -6764,7 +6764,7 @@ ada_lookup_struct_elt_type (struct type *type, char *name, int refok,
NOT wrapped in a struct, since the compiler sometimes NOT wrapped in a struct, since the compiler sometimes
generates these for unchecked variant types. Revisit generates these for unchecked variant types. Revisit
if the compiler changes this practice. */ if the compiler changes this practice. */
char *v_field_name = TYPE_FIELD_NAME (field_type, j); const char *v_field_name = TYPE_FIELD_NAME (field_type, j);
disp = 0; disp = 0;
if (v_field_name != NULL if (v_field_name != NULL
&& field_name_match (v_field_name, name)) && field_name_match (v_field_name, name))
@ -7030,7 +7030,7 @@ find_old_style_renaming_symbol (const char *name, struct block *block)
qualified. This means we need to prepend the function name qualified. This means we need to prepend the function name
as well as adding the ``___XR'' suffix to build the name of as well as adding the ``___XR'' suffix to build the name of
the associated renaming symbol. */ the associated renaming symbol. */
char *function_name = SYMBOL_LINKAGE_NAME (function_sym); const char *function_name = SYMBOL_LINKAGE_NAME (function_sym);
/* Function names sometimes contain suffixes used /* Function names sometimes contain suffixes used
for instance to qualify nested subprograms. When building for instance to qualify nested subprograms. When building
the XR type name, we need to make sure that this suffix is the XR type name, we need to make sure that this suffix is
@ -7110,7 +7110,7 @@ ada_prefer_type (struct type *type0, struct type *type1)
/* The name of TYPE, which is either its TYPE_NAME, or, if that is /* The name of TYPE, which is either its TYPE_NAME, or, if that is
null, its TYPE_TAG_NAME. Null if TYPE is null. */ null, its TYPE_TAG_NAME. Null if TYPE is null. */
char * const char *
ada_type_name (struct type *type) ada_type_name (struct type *type)
{ {
if (type == NULL) if (type == NULL)
@ -7137,7 +7137,7 @@ find_parallel_type_by_descriptive_type (struct type *type, const char *name)
result = TYPE_DESCRIPTIVE_TYPE (type); result = TYPE_DESCRIPTIVE_TYPE (type);
while (result != NULL) while (result != NULL)
{ {
char *result_name = ada_type_name (result); const char *result_name = ada_type_name (result);
if (result_name == NULL) if (result_name == NULL)
{ {
@ -7189,7 +7189,8 @@ ada_find_parallel_type_with_name (struct type *type, const char *name)
struct type * struct type *
ada_find_parallel_type (struct type *type, const char *suffix) ada_find_parallel_type (struct type *type, const char *suffix)
{ {
char *name, *typename = ada_type_name (type); char *name;
const char *typename = ada_type_name (type);
int len; int len;
if (typename == NULL) if (typename == NULL)
@ -7895,7 +7896,7 @@ ada_to_fixed_type_1 (struct type *type, const gdb_byte *valaddr,
If there is, then it provides the actual size of our type. */ If there is, then it provides the actual size of our type. */
else if (ada_type_name (fixed_record_type) != NULL) else if (ada_type_name (fixed_record_type) != NULL)
{ {
char *name = ada_type_name (fixed_record_type); const char *name = ada_type_name (fixed_record_type);
char *xvz_name = alloca (strlen (name) + 7 /* "___XVZ\0" */); char *xvz_name = alloca (strlen (name) + 7 /* "___XVZ\0" */);
int xvz_found = 0; int xvz_found = 0;
LONGEST size; LONGEST size;
@ -8090,7 +8091,7 @@ ada_check_typedef (struct type *type)
return type; return type;
else else
{ {
char *name = TYPE_TAG_NAME (type); const char *name = TYPE_TAG_NAME (type);
struct type *type1 = ada_find_any_type (name); struct type *type1 = ada_find_any_type (name);
if (type1 == NULL) if (type1 == NULL)
@ -8870,7 +8871,7 @@ aggregate_assign_from_choices (struct value *container,
else else
{ {
int ind; int ind;
char *name; const char *name;
switch (op) switch (op)
{ {
@ -9879,7 +9880,7 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
else if (discrete_type_p (type_arg)) else if (discrete_type_p (type_arg))
{ {
struct type *range_type; struct type *range_type;
char *name = ada_type_name (type_arg); const char *name = ada_type_name (type_arg);
range_type = NULL; range_type = NULL;
if (name != NULL && TYPE_CODE (type_arg) != TYPE_CODE_ENUM) if (name != NULL && TYPE_CODE (type_arg) != TYPE_CODE_ENUM)
@ -10411,7 +10412,7 @@ get_int_var_value (char *name, int *flag)
static struct type * static struct type *
to_fixed_range_type (struct type *raw_type, struct value *dval) to_fixed_range_type (struct type *raw_type, struct value *dval)
{ {
char *name; const char *name;
struct type *base_type; struct type *base_type;
char *subtype_info; char *subtype_info;
@ -10534,8 +10535,8 @@ ada_is_modular_type (struct type *type)
int int
ada_modulus_from_name (struct type *type, ULONGEST *modulus) ada_modulus_from_name (struct type *type, ULONGEST *modulus)
{ {
char *name = ada_type_name (type); const char *name = ada_type_name (type);
char *suffix; const char *suffix;
int k; int k;
LONGEST U; LONGEST U;
@ -10781,7 +10782,7 @@ static int
is_known_support_routine (struct frame_info *frame) is_known_support_routine (struct frame_info *frame)
{ {
struct symtab_and_line sal; struct symtab_and_line sal;
char *func_name; const char *func_name;
enum language func_lang; enum language func_lang;
int i; int i;
@ -10884,7 +10885,7 @@ ada_unhandled_exception_name_addr_from_raise (void)
while (fi != NULL) while (fi != NULL)
{ {
char *func_name; const char *func_name;
enum language func_lang; enum language func_lang;
find_frame_funname (fi, &func_name, &func_lang, NULL); find_frame_funname (fi, &func_name, &func_lang, NULL);

View file

@ -322,7 +322,7 @@ extern struct type *ada_template_to_fixed_record_type_1 (struct type *type,
extern int ada_name_prefix_len (const char *); extern int ada_name_prefix_len (const char *);
extern char *ada_type_name (struct type *); extern const char *ada_type_name (struct type *);
extern struct type *ada_find_parallel_type (struct type *, extern struct type *ada_find_parallel_type (struct type *,
const char *suffix); const char *suffix);

View file

@ -76,7 +76,7 @@ decoded_type_name (struct type *type)
return NULL; return NULL;
else else
{ {
char *raw_name = ada_type_name (type); const char *raw_name = ada_type_name (type);
char *s, *q; char *s, *q;
if (name_buffer == NULL || name_buffer_len <= strlen (raw_name)) if (name_buffer == NULL || name_buffer_len <= strlen (raw_name))
@ -223,9 +223,9 @@ print_dynamic_range_bound (struct type *type, const char *name, int name_len,
static void static void
print_range_type (struct type *raw_type, struct ui_file *stream) print_range_type (struct type *raw_type, struct ui_file *stream)
{ {
char *name; const char *name;
struct type *base_type; struct type *base_type;
char *subtype_info; const char *subtype_info;
gdb_assert (raw_type != NULL); gdb_assert (raw_type != NULL);
name = TYPE_NAME (raw_type); name = TYPE_NAME (raw_type);
@ -810,7 +810,7 @@ ada_print_type (struct type *type0, const char *varstring,
print_fixed_point_type (type, stream); print_fixed_point_type (type, stream);
else else
{ {
char *name = ada_type_name (type); const char *name = ada_type_name (type);
if (!ada_is_range_type_name (name)) if (!ada_is_range_type_name (name))
fprintf_filtered (stream, _("<%d-byte integer>"), fprintf_filtered (stream, _("<%d-byte integer>"),

View file

@ -44,7 +44,7 @@ arm_pe_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc)
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
ULONGEST indirect; ULONGEST indirect;
struct minimal_symbol *indsym; struct minimal_symbol *indsym;
char *symname; const char *symname;
CORE_ADDR next_pc; CORE_ADDR next_pc;
/* The format of an ARM DLL trampoline is: /* The format of an ARM DLL trampoline is:

View file

@ -1477,7 +1477,7 @@ gen_struct_ref_recursive (struct expression *exp, struct agent_expr *ax,
for (i = TYPE_NFIELDS (type) - 1; i >= nbases; i--) for (i = TYPE_NFIELDS (type) - 1; i >= nbases; i--)
{ {
char *this_name = TYPE_FIELD_NAME (type, i); const char *this_name = TYPE_FIELD_NAME (type, i);
if (this_name) if (this_name)
{ {
@ -1625,7 +1625,7 @@ gen_struct_elt_for_reference (struct expression *exp,
for (i = TYPE_NFIELDS (t) - 1; i >= TYPE_N_BASECLASSES (t); i--) for (i = TYPE_NFIELDS (t) - 1; i >= TYPE_N_BASECLASSES (t); i--)
{ {
char *t_field_name = TYPE_FIELD_NAME (t, i); const char *t_field_name = TYPE_FIELD_NAME (t, i);
if (t_field_name && strcmp (t_field_name, fieldname) == 0) if (t_field_name && strcmp (t_field_name, fieldname) == 0)
{ {

View file

@ -151,7 +151,7 @@ struct symbol *
find_symbol_in_list (struct pending *list, char *name, int length) find_symbol_in_list (struct pending *list, char *name, int length)
{ {
int j; int j;
char *pp; const char *pp;
while (list != NULL) while (list != NULL)
{ {
@ -1251,7 +1251,7 @@ pop_context (void)
/* Compute a small integer hash code for the given name. */ /* Compute a small integer hash code for the given name. */
int int
hashname (char *name) hashname (const char *name)
{ {
return (hash(name,strlen(name)) % HASHSIZE); return (hash(name,strlen(name)) % HASHSIZE);
} }

View file

@ -279,7 +279,7 @@ extern void record_line (struct subfile *subfile, int line, CORE_ADDR pc);
extern void start_symtab (char *name, char *dirname, CORE_ADDR start_addr); extern void start_symtab (char *name, char *dirname, CORE_ADDR start_addr);
extern int hashname (char *name); extern int hashname (const char *name);
extern void free_pending_blocks (void); extern void free_pending_blocks (void);

View file

@ -87,7 +87,7 @@ classify_type (struct type *elttype, struct gdbarch *gdbarch,
that would do the wrong thing. */ that would do the wrong thing. */
while (elttype) while (elttype)
{ {
char *name = TYPE_NAME (elttype); const char *name = TYPE_NAME (elttype);
if (TYPE_CODE (elttype) == TYPE_CODE_CHAR || !name) if (TYPE_CODE (elttype) == TYPE_CODE_CHAR || !name)
{ {

View file

@ -142,7 +142,7 @@ static void
cp_type_print_derivation_info (struct ui_file *stream, cp_type_print_derivation_info (struct ui_file *stream,
struct type *type) struct type *type)
{ {
char *name; const char *name;
int i; int i;
for (i = 0; i < TYPE_N_BASECLASSES (type); i++) for (i = 0; i < TYPE_N_BASECLASSES (type); i++)
@ -165,8 +165,8 @@ cp_type_print_derivation_info (struct ui_file *stream,
/* Print the C++ method arguments ARGS to the file STREAM. */ /* Print the C++ method arguments ARGS to the file STREAM. */
static void static void
cp_type_print_method_args (struct type *mtype, char *prefix, cp_type_print_method_args (struct type *mtype, const char *prefix,
char *varstring, int staticp, const char *varstring, int staticp,
struct ui_file *stream) struct ui_file *stream)
{ {
struct field *args = TYPE_FIELDS (mtype); struct field *args = TYPE_FIELDS (mtype);
@ -238,7 +238,7 @@ c_type_print_varspec_prefix (struct type *type,
int show, int passed_a_ptr, int show, int passed_a_ptr,
int need_post_space) int need_post_space)
{ {
char *name; const char *name;
if (type == 0) if (type == 0)
return; return;
@ -471,7 +471,7 @@ is_type_conversion_operator (struct type *type, int i, int j)
by their name is pretty terrible. But I don't think our present by their name is pretty terrible. But I don't think our present
data structure gives us any other way to tell. If you know of data structure gives us any other way to tell. If you know of
some other way, feel free to rewrite this function. */ some other way, feel free to rewrite this function. */
char *name = TYPE_FN_FIELDLIST_NAME (type, i); const char *name = TYPE_FN_FIELDLIST_NAME (type, i);
if (strncmp (name, "operator", 8) != 0) if (strncmp (name, "operator", 8) != 0)
return 0; return 0;
@ -990,8 +990,8 @@ c_type_print_base (struct type *type, struct ui_file *stream,
{ {
struct fn_field *f = TYPE_FN_FIELDLIST1 (type, i); struct fn_field *f = TYPE_FN_FIELDLIST1 (type, i);
int j, len2 = TYPE_FN_FIELDLIST_LENGTH (type, i); int j, len2 = TYPE_FN_FIELDLIST_LENGTH (type, i);
char *method_name = TYPE_FN_FIELDLIST_NAME (type, i); const char *method_name = TYPE_FN_FIELDLIST_NAME (type, i);
char *name = type_name_no_tag (type); const char *name = type_name_no_tag (type);
int is_constructor = name && strcmp (method_name, int is_constructor = name && strcmp (method_name,
name) == 0; name) == 0;

View file

@ -1455,10 +1455,11 @@ patch_type (struct type *type, struct type *real_type)
if (TYPE_NAME (real_target)) if (TYPE_NAME (real_target))
{ {
/* The previous copy of TYPE_NAME is allocated by
process_coff_symbol. */
if (TYPE_NAME (target)) if (TYPE_NAME (target))
xfree (TYPE_NAME (target)); xfree ((char*) TYPE_NAME (target));
TYPE_NAME (target) = concat (TYPE_NAME (real_target), TYPE_NAME (target) = xstrdup (TYPE_NAME (real_target));
(char *) NULL);
} }
} }
@ -1486,7 +1487,7 @@ patch_opaque_types (struct symtab *s)
&& TYPE_CODE (SYMBOL_TYPE (real_sym)) == TYPE_CODE_PTR && TYPE_CODE (SYMBOL_TYPE (real_sym)) == TYPE_CODE_PTR
&& TYPE_LENGTH (TYPE_TARGET_TYPE (SYMBOL_TYPE (real_sym))) != 0) && TYPE_LENGTH (TYPE_TARGET_TYPE (SYMBOL_TYPE (real_sym))) != 0)
{ {
char *name = SYMBOL_LINKAGE_NAME (real_sym); const char *name = SYMBOL_LINKAGE_NAME (real_sym);
int hash = hashname (name); int hash = hashname (name);
struct symbol *sym, *prev; struct symbol *sym, *prev;
@ -1675,7 +1676,7 @@ process_coff_symbol (struct coff_symbol *cs,
} }
else else
TYPE_NAME (SYMBOL_TYPE (sym)) = TYPE_NAME (SYMBOL_TYPE (sym)) =
concat (SYMBOL_LINKAGE_NAME (sym), (char *) NULL); xstrdup (SYMBOL_LINKAGE_NAME (sym));
} }
/* Keep track of any type which points to empty structured /* Keep track of any type which points to empty structured

View file

@ -386,7 +386,7 @@ add_struct_fields (struct type *type, int *nextp, char **output,
{ {
int i; int i;
int computed_type_name = 0; int computed_type_name = 0;
char *type_name = NULL; const char *type_name = NULL;
CHECK_TYPEDEF (type); CHECK_TYPEDEF (type);
for (i = 0; i < TYPE_NFIELDS (type); ++i) for (i = 0; i < TYPE_NFIELDS (type); ++i)
@ -416,7 +416,7 @@ add_struct_fields (struct type *type, int *nextp, char **output,
for (i = TYPE_NFN_FIELDS (type) - 1; i >= 0; --i) for (i = TYPE_NFN_FIELDS (type) - 1; i >= 0; --i)
{ {
char *name = TYPE_FN_FIELDLIST_NAME (type, i); const char *name = TYPE_FN_FIELDLIST_NAME (type, i);
if (name && ! strncmp (name, fieldname, namelen)) if (name && ! strncmp (name, fieldname, namelen))
{ {

View file

@ -1205,7 +1205,7 @@ make_symbol_overload_list_adl_namespace (struct type *type,
const char *func_name) const char *func_name)
{ {
char *namespace; char *namespace;
char *type_name; const char *type_name;
int i, prefix_len; int i, prefix_len;
while (TYPE_CODE (type) == TYPE_CODE_PTR while (TYPE_CODE (type) == TYPE_CODE_PTR

View file

@ -98,7 +98,7 @@ const char vtbl_ptr_name[] = "__vtbl_ptr_type";
int int
cp_is_vtbl_ptr_type (struct type *type) cp_is_vtbl_ptr_type (struct type *type)
{ {
char *typename = type_name_no_tag (type); const char *typename = type_name_no_tag (type);
return (typename != NULL && !strcmp (typename, vtbl_ptr_name)); return (typename != NULL && !strcmp (typename, vtbl_ptr_name));
} }
@ -495,7 +495,7 @@ cp_print_value (struct type *type, struct type *real_type,
int boffset = 0; int boffset = 0;
int skip; int skip;
struct type *baseclass = check_typedef (TYPE_BASECLASS (type, i)); struct type *baseclass = check_typedef (TYPE_BASECLASS (type, i));
char *basename = TYPE_NAME (baseclass); const char *basename = TYPE_NAME (baseclass);
const gdb_byte *base_valaddr = NULL; const gdb_byte *base_valaddr = NULL;
const struct value *base_val = NULL; const struct value *base_val = NULL;
volatile struct gdb_exception ex; volatile struct gdb_exception ex;
@ -794,7 +794,7 @@ cp_print_class_member (const gdb_byte *valaddr, struct type *type,
if (domain != NULL) if (domain != NULL)
{ {
char *name; const char *name;
fputs_filtered (prefix, stream); fputs_filtered (prefix, stream);
name = type_name_no_tag (domain); name = type_name_no_tag (domain);

View file

@ -1210,7 +1210,7 @@ read_dbx_symtab (struct objfile *objfile)
struct partial_symtab *pst; struct partial_symtab *pst;
/* List of current psymtab's include files. */ /* List of current psymtab's include files. */
char **psymtab_include_list; const char **psymtab_include_list;
int includes_allocated; int includes_allocated;
int includes_used; int includes_used;
@ -1232,8 +1232,8 @@ read_dbx_symtab (struct objfile *objfile)
includes_allocated = 30; includes_allocated = 30;
includes_used = 0; includes_used = 0;
psymtab_include_list = (char **) alloca (includes_allocated * psymtab_include_list = (const char **) alloca (includes_allocated *
sizeof (char *)); sizeof (const char *));
dependencies_allocated = 30; dependencies_allocated = 30;
dependencies_used = 0; dependencies_used = 0;
@ -1635,12 +1635,12 @@ read_dbx_symtab (struct objfile *objfile)
psymtab_include_list[includes_used++] = namestring; psymtab_include_list[includes_used++] = namestring;
if (includes_used >= includes_allocated) if (includes_used >= includes_allocated)
{ {
char **orig = psymtab_include_list; const char **orig = psymtab_include_list;
psymtab_include_list = (char **) psymtab_include_list = (const char **)
alloca ((includes_allocated *= 2) * sizeof (char *)); alloca ((includes_allocated *= 2) * sizeof (const char *));
memcpy (psymtab_include_list, orig, memcpy (psymtab_include_list, orig,
includes_used * sizeof (char *)); includes_used * sizeof (const char *));
} }
continue; continue;
} }
@ -2226,7 +2226,8 @@ start_psymtab (struct objfile *objfile, char *filename, CORE_ADDR textlow,
FIXME: List variables and peculiarities of same. */ FIXME: List variables and peculiarities of same. */
struct partial_symtab * struct partial_symtab *
end_psymtab (struct partial_symtab *pst, char **include_list, int num_includes, end_psymtab (struct partial_symtab *pst,
const char **include_list, int num_includes,
int capping_symbol_offset, CORE_ADDR capping_text, int capping_symbol_offset, CORE_ADDR capping_text,
struct partial_symtab **dependency_list, int number_dependencies, struct partial_symtab **dependency_list, int number_dependencies,
int textlow_not_set) int textlow_not_set)

View file

@ -582,7 +582,7 @@ extern CORE_ADDR string_to_core_addr (const char *my_string);
extern char *hex_string (LONGEST); extern char *hex_string (LONGEST);
extern char *hex_string_custom (LONGEST, int); extern char *hex_string_custom (LONGEST, int);
extern void fprintf_symbol_filtered (struct ui_file *, char *, extern void fprintf_symbol_filtered (struct ui_file *, const char *,
enum language, int); enum language, int);
extern void perror_with_name (const char *) ATTRIBUTE_NORETURN; extern void perror_with_name (const char *) ATTRIBUTE_NORETURN;

View file

@ -1029,7 +1029,7 @@ static struct type *read_type_die (struct die_info *, struct dwarf2_cu *);
static struct type *read_type_die_1 (struct die_info *, struct dwarf2_cu *); static struct type *read_type_die_1 (struct die_info *, struct dwarf2_cu *);
static char *determine_prefix (struct die_info *die, struct dwarf2_cu *); static const char *determine_prefix (struct die_info *die, struct dwarf2_cu *);
static char *typename_concat (struct obstack *obs, const char *prefix, static char *typename_concat (struct obstack *obs, const char *prefix,
const char *suffix, int physname, const char *suffix, int physname,
@ -5013,7 +5013,7 @@ dwarf2_compute_name (char *name, struct die_info *die, struct dwarf2_cu *cu,
if (die_needs_namespace (die, cu)) if (die_needs_namespace (die, cu))
{ {
long length; long length;
char *prefix; const char *prefix;
struct ui_file *buf; struct ui_file *buf;
prefix = determine_prefix (die, cu); prefix = determine_prefix (die, cu);
@ -7729,7 +7729,7 @@ process_structure_scope (struct die_info *die, struct dwarf2_cu *cu)
i >= TYPE_N_BASECLASSES (t); i >= TYPE_N_BASECLASSES (t);
--i) --i)
{ {
char *fieldname = TYPE_FIELD_NAME (t, i); const char *fieldname = TYPE_FIELD_NAME (t, i);
if (is_vtable_name (fieldname, cu)) if (is_vtable_name (fieldname, cu))
{ {
@ -12479,7 +12479,7 @@ anonymous_struct_prefix (struct die_info *die, struct dwarf2_cu *cu)
then determine_prefix on foo's die will return "N::C". */ then determine_prefix on foo's die will return "N::C". */
static char * static const char *
determine_prefix (struct die_info *die, struct dwarf2_cu *cu) determine_prefix (struct die_info *die, struct dwarf2_cu *cu)
{ {
struct die_info *parent, *spec_die; struct die_info *parent, *spec_die;

View file

@ -335,7 +335,8 @@ evaluate_struct_tuple (struct value *struct_val,
for (fieldno = 0; fieldno < TYPE_NFIELDS (struct_type); for (fieldno = 0; fieldno < TYPE_NFIELDS (struct_type);
fieldno++) fieldno++)
{ {
char *field_name = TYPE_FIELD_NAME (struct_type, fieldno); const char *field_name =
TYPE_FIELD_NAME (struct_type, fieldno);
if (field_name != NULL && strcmp (field_name, label) == 0) if (field_name != NULL && strcmp (field_name, label) == 0)
{ {
@ -348,7 +349,8 @@ evaluate_struct_tuple (struct value *struct_val,
for (fieldno = 0; fieldno < TYPE_NFIELDS (struct_type); for (fieldno = 0; fieldno < TYPE_NFIELDS (struct_type);
fieldno++) fieldno++)
{ {
char *field_name = TYPE_FIELD_NAME (struct_type, fieldno); const char *field_name =
TYPE_FIELD_NAME (struct_type, fieldno);
field_type = TYPE_FIELD_TYPE (struct_type, fieldno); field_type = TYPE_FIELD_TYPE (struct_type, fieldno);
if ((field_name == 0 || *field_name == '\0') if ((field_name == 0 || *field_name == '\0')

View file

@ -572,7 +572,7 @@ find_first_common_named (char *name)
that belongs to function funcname. */ that belongs to function funcname. */
SAVED_F77_COMMON_PTR SAVED_F77_COMMON_PTR
find_common_for_function (char *name, char *funcname) find_common_for_function (const char *name, const char *funcname)
{ {
SAVED_F77_COMMON_PTR tmp; SAVED_F77_COMMON_PTR tmp;

View file

@ -75,7 +75,8 @@ extern SAVED_F77_COMMON_PTR head_common_list; /* Ptr to 1st saved COMMON */
extern SAVED_F77_COMMON_PTR tail_common_list; /* Ptr to last saved COMMON */ extern SAVED_F77_COMMON_PTR tail_common_list; /* Ptr to last saved COMMON */
extern SAVED_F77_COMMON_PTR current_common; /* Ptr to current COMMON */ extern SAVED_F77_COMMON_PTR current_common; /* Ptr to current COMMON */
extern SAVED_F77_COMMON_PTR find_common_for_function (char *, char *); extern SAVED_F77_COMMON_PTR find_common_for_function (const char *,
const char *);
#define UNINITIALIZED_SECNUM -1 #define UNINITIALIZED_SECNUM -1
#define COMMON_NEEDS_PATCHING(blk) ((blk)->secnum == UNINITIALIZED_SECNUM) #define COMMON_NEEDS_PATCHING(blk) ((blk)->secnum == UNINITIALIZED_SECNUM)

View file

@ -41,7 +41,7 @@ static int there_is_a_visible_common_named (char *);
extern void _initialize_f_valprint (void); extern void _initialize_f_valprint (void);
static void info_common_command (char *, int); static void info_common_command (char *, int);
static void list_all_visible_commons (char *); static void list_all_visible_commons (const char *);
static void f77_create_arrayprint_offset_tbl (struct type *, static void f77_create_arrayprint_offset_tbl (struct type *,
struct ui_file *); struct ui_file *);
static void f77_get_dynamic_length_of_aggregate (struct type *); static void f77_get_dynamic_length_of_aggregate (struct type *);
@ -518,7 +518,7 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
} }
static void static void
list_all_visible_commons (char *funname) list_all_visible_commons (const char *funname)
{ {
SAVED_F77_COMMON_PTR tmp; SAVED_F77_COMMON_PTR tmp;
@ -545,7 +545,7 @@ info_common_command (char *comname, int from_tty)
SAVED_F77_COMMON_PTR the_common; SAVED_F77_COMMON_PTR the_common;
COMMON_ENTRY_PTR entry; COMMON_ENTRY_PTR entry;
struct frame_info *fi; struct frame_info *fi;
char *funname = 0; const char *funname = 0;
struct symbol *func; struct symbol *func;
/* We have been told to display the contents of F77 COMMON /* We have been told to display the contents of F77 COMMON

View file

@ -3646,8 +3646,8 @@ gdbarch_static_transform_name_p (struct gdbarch *gdbarch)
return gdbarch->static_transform_name != NULL; return gdbarch->static_transform_name != NULL;
} }
char * const char *
gdbarch_static_transform_name (struct gdbarch *gdbarch, char *name) gdbarch_static_transform_name (struct gdbarch *gdbarch, const char *name)
{ {
gdb_assert (gdbarch != NULL); gdb_assert (gdbarch != NULL);
gdb_assert (gdbarch->static_transform_name != NULL); gdb_assert (gdbarch->static_transform_name != NULL);

View file

@ -909,8 +909,8 @@ extern void set_gdbarch_core_read_description (struct gdbarch *gdbarch, gdbarch_
extern int gdbarch_static_transform_name_p (struct gdbarch *gdbarch); extern int gdbarch_static_transform_name_p (struct gdbarch *gdbarch);
typedef char * (gdbarch_static_transform_name_ftype) (char *name); typedef const char * (gdbarch_static_transform_name_ftype) (const char *name);
extern char * gdbarch_static_transform_name (struct gdbarch *gdbarch, char *name); extern const char * gdbarch_static_transform_name (struct gdbarch *gdbarch, const char *name);
extern void set_gdbarch_static_transform_name (struct gdbarch *gdbarch, gdbarch_static_transform_name_ftype *static_transform_name); extern void set_gdbarch_static_transform_name (struct gdbarch *gdbarch, gdbarch_static_transform_name_ftype *static_transform_name);
/* Set if the address in N_SO or N_FUN stabs may be zero. */ /* Set if the address in N_SO or N_FUN stabs may be zero. */

View file

@ -758,7 +758,7 @@ F:void:overlay_update:struct obj_section *osect:osect
M:const struct target_desc *:core_read_description:struct target_ops *target, bfd *abfd:target, abfd M:const struct target_desc *:core_read_description:struct target_ops *target, bfd *abfd:target, abfd
# Handle special encoding of static variables in stabs debug info. # Handle special encoding of static variables in stabs debug info.
F:char *:static_transform_name:char *name:name F:const char *:static_transform_name:const char *name:name
# Set if the address in N_SO or N_FUN stabs may be zero. # Set if the address in N_SO or N_FUN stabs may be zero.
v:int:sofun_address_maybe_missing:::0:0::0 v:int:sofun_address_maybe_missing:::0:0::0

View file

@ -1092,7 +1092,7 @@ smash_to_method_type (struct type *type, struct type *domain,
/* Return a typename for a struct/union/enum type without "struct ", /* Return a typename for a struct/union/enum type without "struct ",
"union ", or "enum ". If the type has a NULL name, return NULL. */ "union ", or "enum ". If the type has a NULL name, return NULL. */
char * const char *
type_name_no_tag (const struct type *type) type_name_no_tag (const struct type *type)
{ {
if (TYPE_TAG_NAME (type) != NULL) if (TYPE_TAG_NAME (type) != NULL)
@ -1164,7 +1164,7 @@ lookup_typename (const struct language_defn *language,
struct type * struct type *
lookup_unsigned_typename (const struct language_defn *language, lookup_unsigned_typename (const struct language_defn *language,
struct gdbarch *gdbarch, char *name) struct gdbarch *gdbarch, const char *name)
{ {
char *uns = alloca (strlen (name) + 10); char *uns = alloca (strlen (name) + 10);
@ -1175,7 +1175,7 @@ lookup_unsigned_typename (const struct language_defn *language,
struct type * struct type *
lookup_signed_typename (const struct language_defn *language, lookup_signed_typename (const struct language_defn *language,
struct gdbarch *gdbarch, char *name) struct gdbarch *gdbarch, const char *name)
{ {
struct type *t; struct type *t;
char *uns = alloca (strlen (name) + 8); char *uns = alloca (strlen (name) + 8);
@ -1338,7 +1338,7 @@ lookup_struct_elt_type (struct type *type, char *name, int noerr)
for (i = TYPE_NFIELDS (type) - 1; i >= TYPE_N_BASECLASSES (type); i--) for (i = TYPE_NFIELDS (type) - 1; i >= TYPE_N_BASECLASSES (type); i--)
{ {
char *t_field_name = TYPE_FIELD_NAME (type, i); const char *t_field_name = TYPE_FIELD_NAME (type, i);
if (t_field_name && (strcmp_iw (t_field_name, name) == 0)) if (t_field_name && (strcmp_iw (t_field_name, name) == 0))
{ {
@ -1480,7 +1480,7 @@ check_typedef (struct type *type)
{ {
if (!TYPE_TARGET_TYPE (type)) if (!TYPE_TARGET_TYPE (type))
{ {
char *name; const char *name;
struct symbol *sym; struct symbol *sym;
/* It is dangerous to call lookup_symbol if we are currently /* It is dangerous to call lookup_symbol if we are currently
@ -1543,7 +1543,7 @@ check_typedef (struct type *type)
&& opaque_type_resolution && opaque_type_resolution
&& !currently_reading_symtab) && !currently_reading_symtab)
{ {
char *name = type_name_no_tag (type); const char *name = type_name_no_tag (type);
struct type *newtype; struct type *newtype;
if (name == NULL) if (name == NULL)
@ -1577,7 +1577,7 @@ check_typedef (struct type *type)
types. */ types. */
else if (TYPE_STUB (type) && !currently_reading_symtab) else if (TYPE_STUB (type) && !currently_reading_symtab)
{ {
char *name = type_name_no_tag (type); const char *name = type_name_no_tag (type);
/* FIXME: shouldn't we separately check the TYPE_NAME and the /* FIXME: shouldn't we separately check the TYPE_NAME and the
TYPE_TAG_NAME, and look in STRUCT_DOMAIN and/or VAR_DOMAIN TYPE_TAG_NAME, and look in STRUCT_DOMAIN and/or VAR_DOMAIN
as appropriate? (this code was written before TYPE_NAME and as appropriate? (this code was written before TYPE_NAME and

View file

@ -436,9 +436,11 @@ struct main_type
/* Name of this type, or NULL if none. /* Name of this type, or NULL if none.
This is used for printing only, except by poorly designed C++ code. This is used for printing only, except by poorly designed C++ code.
For looking up a name, look for a symbol in the VAR_DOMAIN. */ For looking up a name, look for a symbol in the VAR_DOMAIN.
This is generally allocated in the objfile's obstack.
However coffread.c uses malloc. */
char *name; const char *name;
/* Tag name for this type, or NULL if none. This means that the /* Tag name for this type, or NULL if none. This means that the
name of the type consists of a keyword followed by the tag name. name of the type consists of a keyword followed by the tag name.
@ -451,7 +453,7 @@ struct main_type
One more legitimate use is that if TYPE_FLAG_STUB is set, this is One more legitimate use is that if TYPE_FLAG_STUB is set, this is
the name to use to look for definitions in other files. */ the name to use to look for definitions in other files. */
char *tag_name; const char *tag_name;
/* Every type is now associated with a particular objfile, and the /* Every type is now associated with a particular objfile, and the
type is allocated on the objfile_obstack for that objfile. One problem type is allocated on the objfile_obstack for that objfile. One problem
@ -556,7 +558,7 @@ struct main_type
NULL for range bounds, array domains, and member function NULL for range bounds, array domains, and member function
arguments. */ arguments. */
char *name; const char *name;
} *fields; } *fields;
/* Union member used for range types. */ /* Union member used for range types. */
@ -761,9 +763,11 @@ struct cplus_struct_type
struct fn_fieldlist struct fn_fieldlist
{ {
/* The overloaded name. */ /* The overloaded name.
This is generally allocated in the objfile's obstack.
However stabsread.c sometimes uses malloc. */
char *name; const char *name;
/* The number of methods with this name. */ /* The number of methods with this name. */
@ -1461,7 +1465,7 @@ extern void smash_to_methodptr_type (struct type *, struct type *);
extern struct type *allocate_stub_method (struct type *); extern struct type *allocate_stub_method (struct type *);
extern char *type_name_no_tag (const struct type *); extern const char *type_name_no_tag (const struct type *);
extern const char *type_name_no_tag_or_error (struct type *type); extern const char *type_name_no_tag_or_error (struct type *type);
@ -1489,10 +1493,10 @@ extern struct type *lookup_string_range_type (struct type *, int, int);
extern struct type *create_set_type (struct type *, struct type *); extern struct type *create_set_type (struct type *, struct type *);
extern struct type *lookup_unsigned_typename (const struct language_defn *, extern struct type *lookup_unsigned_typename (const struct language_defn *,
struct gdbarch *,char *); struct gdbarch *, const char *);
extern struct type *lookup_signed_typename (const struct language_defn *, extern struct type *lookup_signed_typename (const struct language_defn *,
struct gdbarch *,char *); struct gdbarch *, const char *);
extern struct type *check_typedef (struct type *); extern struct type *check_typedef (struct type *);

View file

@ -194,6 +194,7 @@ gnuv2_value_rtti_type (struct value *v, int *full, int *top, int *using_enc)
CORE_ADDR vtbl; CORE_ADDR vtbl;
struct minimal_symbol *minsym; struct minimal_symbol *minsym;
char *demangled_name, *p; char *demangled_name, *p;
const char *linkage_name;
struct type *btype; struct type *btype;
struct type *known_type_vptr_basetype; struct type *known_type_vptr_basetype;
int known_type_vptr_fieldno; int known_type_vptr_fieldno;
@ -246,12 +247,12 @@ gnuv2_value_rtti_type (struct value *v, int *full, int *top, int *using_enc)
/* Try to find a symbol that is the vtable. */ /* Try to find a symbol that is the vtable. */
minsym=lookup_minimal_symbol_by_pc(vtbl); minsym=lookup_minimal_symbol_by_pc(vtbl);
if (minsym==NULL if (minsym==NULL
|| (demangled_name=SYMBOL_LINKAGE_NAME (minsym))==NULL || (linkage_name=SYMBOL_LINKAGE_NAME (minsym))==NULL
|| !is_vtable_name (demangled_name)) || !is_vtable_name (linkage_name))
return NULL; return NULL;
/* If we just skip the prefix, we get screwed by namespaces. */ /* If we just skip the prefix, we get screwed by namespaces. */
demangled_name=cplus_demangle(demangled_name,DMGL_PARAMS|DMGL_ANSI); demangled_name=cplus_demangle(linkage_name,DMGL_PARAMS|DMGL_ANSI);
p = strchr (demangled_name, ' '); p = strchr (demangled_name, ' ');
if (p) if (p)
*p = '\0'; *p = '\0';
@ -297,8 +298,8 @@ static int
vb_match (struct type *type, int index, struct type *basetype) vb_match (struct type *type, int index, struct type *basetype)
{ {
struct type *fieldtype; struct type *fieldtype;
char *name = TYPE_FIELD_NAME (type, index); const char *name = TYPE_FIELD_NAME (type, index);
char *field_class_name = NULL; const char *field_class_name = NULL;
if (*name != '_') if (*name != '_')
return 0; return 0;

View file

@ -735,7 +735,7 @@ gnuv3_skip_trampoline (struct frame_info *frame, CORE_ADDR stop_pc)
struct gdbarch *gdbarch = get_frame_arch (frame); struct gdbarch *gdbarch = get_frame_arch (frame);
struct minimal_symbol *thunk_sym, *fn_sym; struct minimal_symbol *thunk_sym, *fn_sym;
struct obj_section *section; struct obj_section *section;
char *thunk_name, *fn_name; const char *thunk_name, *fn_name;
real_stop_pc = gdbarch_skip_trampoline_code (gdbarch, frame, stop_pc); real_stop_pc = gdbarch_skip_trampoline_code (gdbarch, frame, stop_pc);
if (real_stop_pc == 0) if (real_stop_pc == 0)
@ -804,7 +804,7 @@ gnuv3_pass_by_reference (struct type *type)
fieldelem++) fieldelem++)
{ {
struct fn_field *fn = TYPE_FN_FIELDLIST1 (type, fieldnum); struct fn_field *fn = TYPE_FN_FIELDLIST1 (type, fieldnum);
char *name = TYPE_FN_FIELDLIST_NAME (type, fieldnum); const char *name = TYPE_FN_FIELDLIST_NAME (type, fieldnum);
struct type *fieldtype = TYPE_FN_FIELD_TYPE (fn, fieldelem); struct type *fieldtype = TYPE_FN_FIELD_TYPE (fn, fieldelem);
/* If this function is marked as artificial, it is compiler-generated, /* If this function is marked as artificial, it is compiler-generated,

View file

@ -79,8 +79,8 @@ i386_sol2_mcontext_addr (struct frame_info *this_frame)
/* SunPRO encodes the static variables. This is not related to C++ /* SunPRO encodes the static variables. This is not related to C++
mangling, it is done for C too. */ mangling, it is done for C too. */
static char * static const char *
i386_sol2_static_transform_name (char *name) i386_sol2_static_transform_name (const char *name)
{ {
char *p; char *p;
if (name[0] == '.') if (name[0] == '.')

View file

@ -3273,7 +3273,7 @@ i386_pe_skip_trampoline_code (struct frame_info *frame,
read_memory_unsigned_integer (pc + 2, 4, byte_order); read_memory_unsigned_integer (pc + 2, 4, byte_order);
struct minimal_symbol *indsym = struct minimal_symbol *indsym =
indirect ? lookup_minimal_symbol_by_pc (indirect) : 0; indirect ? lookup_minimal_symbol_by_pc (indirect) : 0;
char *symname = indsym ? SYMBOL_LINKAGE_NAME (indsym) : 0; const char *symname = indsym ? SYMBOL_LINKAGE_NAME (indsym) : 0;
if (symname) if (symname)
{ {

View file

@ -45,8 +45,8 @@
extern void _initialize_java_language (void); extern void _initialize_java_language (void);
static int java_demangled_signature_length (char *); static int java_demangled_signature_length (const char *);
static void java_demangled_signature_copy (char *, char *); static void java_demangled_signature_copy (char *, const char *);
static struct symtab *get_java_class_symtab (struct gdbarch *gdbarch); static struct symtab *get_java_class_symtab (struct gdbarch *gdbarch);
static char *get_java_utf8_name (struct obstack *obstack, struct value *name); static char *get_java_utf8_name (struct obstack *obstack, struct value *name);
@ -341,8 +341,8 @@ java_link_class_type (struct gdbarch *gdbarch,
struct type *type, struct value *clas) struct type *type, struct value *clas)
{ {
struct value *temp; struct value *temp;
char *unqualified_name; const char *unqualified_name;
char *name = TYPE_TAG_NAME (type); const char *name = TYPE_TAG_NAME (type);
int ninterfaces, nfields, nmethods; int ninterfaces, nfields, nmethods;
int type_is_object = 0; int type_is_object = 0;
struct fn_field *fn_fields; struct fn_field *fn_fields;
@ -511,7 +511,7 @@ java_link_class_type (struct gdbarch *gdbarch,
methods = NULL; methods = NULL;
for (i = 0; i < nmethods; i++) for (i = 0; i < nmethods; i++)
{ {
char *mname; const char *mname;
int k; int k;
if (methods == NULL) if (methods == NULL)
@ -617,7 +617,7 @@ is_object_type (struct type *type)
if (TYPE_CODE (type) == TYPE_CODE_PTR) if (TYPE_CODE (type) == TYPE_CODE_PTR)
{ {
struct type *ttype = check_typedef (TYPE_TARGET_TYPE (type)); struct type *ttype = check_typedef (TYPE_TARGET_TYPE (type));
char *name; const char *name;
if (TYPE_CODE (ttype) != TYPE_CODE_STRUCT) if (TYPE_CODE (ttype) != TYPE_CODE_STRUCT)
return 0; return 0;
while (TYPE_N_BASECLASSES (ttype) > 0) while (TYPE_N_BASECLASSES (ttype) > 0)
@ -667,7 +667,7 @@ java_primitive_type (struct gdbarch *gdbarch, int signature)
struct type * struct type *
java_primitive_type_from_name (struct gdbarch *gdbarch, java_primitive_type_from_name (struct gdbarch *gdbarch,
char *name, int namelen) const char *name, int namelen)
{ {
const struct builtin_java_type *builtin = builtin_java_type (gdbarch); const struct builtin_java_type *builtin = builtin_java_type (gdbarch);
@ -742,7 +742,7 @@ java_primitive_type_name (int signature)
signature string SIGNATURE. */ signature string SIGNATURE. */
static int static int
java_demangled_signature_length (char *signature) java_demangled_signature_length (const char *signature)
{ {
int array = 0; int array = 0;
@ -762,7 +762,7 @@ java_demangled_signature_length (char *signature)
RESULT. */ RESULT. */
static void static void
java_demangled_signature_copy (char *result, char *signature) java_demangled_signature_copy (char *result, const char *signature)
{ {
int array = 0; int array = 0;
char *ptr; char *ptr;
@ -805,7 +805,7 @@ java_demangled_signature_copy (char *result, char *signature)
as a freshly allocated copy. */ as a freshly allocated copy. */
char * char *
java_demangle_type_signature (char *signature) java_demangle_type_signature (const char *signature)
{ {
int length = java_demangled_signature_length (signature); int length = java_demangled_signature_length (signature);
char *result = xmalloc (length + 1); char *result = xmalloc (length + 1);
@ -905,7 +905,7 @@ evaluate_subexp_java (struct type *expect_type, struct expression *exp,
{ {
int pc = *pos; int pc = *pos;
int i; int i;
char *name; const char *name;
enum exp_opcode op = exp->elts[*pos].opcode; enum exp_opcode op = exp->elts[*pos].opcode;
struct value *arg1; struct value *arg1;
struct value *arg2; struct value *arg2;

View file

@ -57,7 +57,7 @@ extern struct type *type_from_class (struct gdbarch *, struct value *);
extern struct type *java_primitive_type (struct gdbarch *, int signature); extern struct type *java_primitive_type (struct gdbarch *, int signature);
extern struct type *java_primitive_type_from_name (struct gdbarch *, extern struct type *java_primitive_type_from_name (struct gdbarch *,
char *, int); const char *, int);
extern struct type *java_array_type (struct type *, int); extern struct type *java_array_type (struct type *, int);
@ -72,6 +72,6 @@ extern int is_object_type (struct type *);
extern void java_print_type (struct type *, const char *, extern void java_print_type (struct type *, const char *,
struct ui_file *, int, int); struct ui_file *, int, int);
extern char *java_demangle_type_signature (char *); extern char *java_demangle_type_signature (const char *);
#endif #endif

View file

@ -39,7 +39,7 @@ static void java_type_print_base (struct type * type,
static void static void
java_type_print_derivation_info (struct ui_file *stream, struct type *type) java_type_print_derivation_info (struct ui_file *stream, struct type *type)
{ {
char *name; const char *name;
int i; int i;
int n_bases; int n_bases;
int prev; int prev;
@ -208,8 +208,8 @@ java_type_print_base (struct type *type, struct ui_file *stream, int show,
{ {
struct fn_field *f; struct fn_field *f;
int j; int j;
char *method_name; const char *method_name;
char *name; const char *name;
int is_constructor; int is_constructor;
int n_overloads; int n_overloads;

View file

@ -42,7 +42,7 @@ java_value_print (struct value *val, struct ui_file *stream,
struct type *type; struct type *type;
CORE_ADDR address; CORE_ADDR address;
int i; int i;
char *name; const char *name;
struct value_print_options opts; struct value_print_options opts;
type = value_type (val); type = value_type (val);
@ -283,7 +283,7 @@ java_print_value_fields (struct type *type, const gdb_byte *valaddr,
{ {
int boffset; int boffset;
struct type *baseclass = check_typedef (TYPE_BASECLASS (type, i)); struct type *baseclass = check_typedef (TYPE_BASECLASS (type, i));
char *basename = TYPE_NAME (baseclass); const char *basename = TYPE_NAME (baseclass);
const gdb_byte *base_valaddr; const gdb_byte *base_valaddr;
if (BASETYPE_VIA_VIRTUAL (type, i)) if (BASETYPE_VIA_VIRTUAL (type, i))
@ -325,7 +325,7 @@ java_print_value_fields (struct type *type, const gdb_byte *valaddr,
/* If requested, skip printing of static fields. */ /* If requested, skip printing of static fields. */
if (field_is_static (&TYPE_FIELD (type, i))) if (field_is_static (&TYPE_FIELD (type, i)))
{ {
char *name = TYPE_FIELD_NAME (type, i); const char *name = TYPE_FIELD_NAME (type, i);
if (!options->static_field_print) if (!options->static_field_print)
continue; continue;

View file

@ -435,8 +435,7 @@ find_methods (struct type *t, const char *name,
{ {
int i1 = 0; int i1 = 0;
int ibase; int ibase;
char *class_name = type_name_no_tag (t); const char *class_name = type_name_no_tag (t);
char *canon;
/* Ignore this class if it doesn't have a name. This is ugly, but /* Ignore this class if it doesn't have a name. This is ugly, but
unless we figure out how to get the physname without the name of unless we figure out how to get the physname without the name of
@ -456,7 +455,7 @@ find_methods (struct type *t, const char *name,
method_counter >= 0; method_counter >= 0;
--method_counter) --method_counter)
{ {
char *method_name = TYPE_FN_FIELDLIST_NAME (t, method_counter); const char *method_name = TYPE_FN_FIELDLIST_NAME (t, method_counter);
char dem_opname[64]; char dem_opname[64];
if (strncmp (method_name, "__", 2) == 0 || if (strncmp (method_name, "__", 2) == 0 ||

View file

@ -2452,7 +2452,7 @@ m32c_m16c_address_to_pointer (struct gdbarch *gdbarch,
if (target_code == TYPE_CODE_FUNC || target_code == TYPE_CODE_METHOD) if (target_code == TYPE_CODE_FUNC || target_code == TYPE_CODE_METHOD)
{ {
char *func_name; const char *func_name;
char *tramp_name; char *tramp_name;
struct minimal_symbol *tramp_msym; struct minimal_symbol *tramp_msym;
@ -2539,7 +2539,7 @@ m32c_m16c_pointer_to_address (struct gdbarch *gdbarch,
if (ptr_msym) if (ptr_msym)
{ {
char *ptr_msym_name = SYMBOL_LINKAGE_NAME (ptr_msym); const char *ptr_msym_name = SYMBOL_LINKAGE_NAME (ptr_msym);
int len = strlen (ptr_msym_name); int len = strlen (ptr_msym_name);
if (len > 4 if (len > 4

View file

@ -2359,7 +2359,7 @@ parse_partial_symbols (struct objfile *objfile)
int past_first_source_file = 0; int past_first_source_file = 0;
/* List of current psymtab's include files. */ /* List of current psymtab's include files. */
char **psymtab_include_list; const char **psymtab_include_list;
int includes_allocated; int includes_allocated;
int includes_used; int includes_used;
EXTR *extern_tab; EXTR *extern_tab;
@ -2389,8 +2389,8 @@ parse_partial_symbols (struct objfile *objfile)
includes_allocated = 30; includes_allocated = 30;
includes_used = 0; includes_used = 0;
psymtab_include_list = (char **) alloca (includes_allocated * psymtab_include_list = (const char **) alloca (includes_allocated *
sizeof (char *)); sizeof (const char *));
next_symbol_text_func = mdebug_next_symbol_text; next_symbol_text_func = mdebug_next_symbol_text;
dependencies_allocated = 30; dependencies_allocated = 30;
@ -2754,7 +2754,7 @@ parse_partial_symbols (struct objfile *objfile)
for (cur_sdx = 2; cur_sdx < fh->csym; cur_sdx++) for (cur_sdx = 2; cur_sdx < fh->csym; cur_sdx++)
{ {
int type_code; int type_code;
char *namestring; const char *namestring;
(*swap_sym_in) (cur_bfd, (*swap_sym_in) (cur_bfd,
(((char *) debug_info->external_sym) (((char *) debug_info->external_sym)
@ -3090,13 +3090,13 @@ parse_partial_symbols (struct objfile *objfile)
psymtab_include_list[includes_used++] = namestring; psymtab_include_list[includes_used++] = namestring;
if (includes_used >= includes_allocated) if (includes_used >= includes_allocated)
{ {
char **orig = psymtab_include_list; const char **orig = psymtab_include_list;
psymtab_include_list = (char **) psymtab_include_list = (const char **)
alloca ((includes_allocated *= 2) * alloca ((includes_allocated *= 2) *
sizeof (char *)); sizeof (const char *));
memcpy (psymtab_include_list, orig, memcpy (psymtab_include_list, orig,
includes_used * sizeof (char *)); includes_used * sizeof (const char *));
} }
continue; continue;
} }

View file

@ -988,8 +988,8 @@ compare_minimal_symbols (const void *fn1p, const void *fn2p)
else else
/* addrs are equal: sort by name */ /* addrs are equal: sort by name */
{ {
char *name1 = SYMBOL_LINKAGE_NAME (fn1); const char *name1 = SYMBOL_LINKAGE_NAME (fn1);
char *name2 = SYMBOL_LINKAGE_NAME (fn2); const char *name2 = SYMBOL_LINKAGE_NAME (fn2);
if (name1 && name2) /* both have names */ if (name1 && name2) /* both have names */
return strcmp (name1, name2); return strcmp (name1, name2);

View file

@ -636,14 +636,14 @@ end_msglist(void)
} }
/* /*
* Function: specialcmp (char *a, char *b) * Function: specialcmp (const char *a, const char *b)
* *
* Special strcmp: treats ']' and ' ' as end-of-string. * Special strcmp: treats ']' and ' ' as end-of-string.
* Used for qsorting lists of objc methods (either by class or selector). * Used for qsorting lists of objc methods (either by class or selector).
*/ */
static int static int
specialcmp (char *a, char *b) specialcmp (const char *a, const char *b)
{ {
while (*a && *a != ' ' && *a != ']' && *b && *b != ' ' && *b != ']') while (*a && *a != ' ' && *a != ']' && *b && *b != ' ' && *b != ']')
{ {
@ -668,7 +668,7 @@ specialcmp (char *a, char *b)
static int static int
compare_selectors (const void *a, const void *b) compare_selectors (const void *a, const void *b)
{ {
char *aname, *bname; const char *aname, *bname;
aname = SYMBOL_PRINT_NAME (*(struct symbol **) a); aname = SYMBOL_PRINT_NAME (*(struct symbol **) a);
bname = SYMBOL_PRINT_NAME (*(struct symbol **) b); bname = SYMBOL_PRINT_NAME (*(struct symbol **) b);
@ -697,7 +697,7 @@ selectors_info (char *regexp, int from_tty)
{ {
struct objfile *objfile; struct objfile *objfile;
struct minimal_symbol *msymbol; struct minimal_symbol *msymbol;
char *name; const char *name;
char *val; char *val;
int matches = 0; int matches = 0;
int maxlen = 0; int maxlen = 0;
@ -762,8 +762,8 @@ selectors_info (char *regexp, int from_tty)
} }
if (regexp == NULL || re_exec(++name) != 0) if (regexp == NULL || re_exec(++name) != 0)
{ {
char *mystart = name; const char *mystart = name;
char *myend = (char *) strchr (mystart, ']'); const char *myend = strchr (mystart, ']');
if (myend && (myend - mystart > maxlen)) if (myend && (myend - mystart > maxlen))
maxlen = myend - mystart; /* Get longest selector. */ maxlen = myend - mystart; /* Get longest selector. */
@ -834,7 +834,7 @@ selectors_info (char *regexp, int from_tty)
static int static int
compare_classes (const void *a, const void *b) compare_classes (const void *a, const void *b)
{ {
char *aname, *bname; const char *aname, *bname;
aname = SYMBOL_PRINT_NAME (*(struct symbol **) a); aname = SYMBOL_PRINT_NAME (*(struct symbol **) a);
bname = SYMBOL_PRINT_NAME (*(struct symbol **) b); bname = SYMBOL_PRINT_NAME (*(struct symbol **) b);
@ -859,7 +859,7 @@ classes_info (char *regexp, int from_tty)
{ {
struct objfile *objfile; struct objfile *objfile;
struct minimal_symbol *msymbol; struct minimal_symbol *msymbol;
char *name; const char *name;
char *val; char *val;
int matches = 0; int matches = 0;
int maxlen = 0; int maxlen = 0;
@ -901,8 +901,8 @@ classes_info (char *regexp, int from_tty)
if (regexp == NULL || re_exec(name+2) != 0) if (regexp == NULL || re_exec(name+2) != 0)
{ {
/* Compute length of classname part. */ /* Compute length of classname part. */
char *mystart = name + 2; const char *mystart = name + 2;
char *myend = (char *) strchr(mystart, ' '); const char *myend = strchr (mystart, ' ');
if (myend && (myend - mystart > maxlen)) if (myend && (myend - mystart > maxlen))
maxlen = myend - mystart; maxlen = myend - mystart;
@ -1119,7 +1119,7 @@ find_methods (char type, const char *class, const char *category,
{ {
struct objfile *objfile = NULL; struct objfile *objfile = NULL;
char *symname = NULL; const char *symname = NULL;
char ntype = '\0'; char ntype = '\0';
char *nclass = NULL; char *nclass = NULL;

View file

@ -338,7 +338,7 @@ exp : field_exp COMPLETE
exp : exp '[' exp : exp '['
/* We need to save the current_type value. */ /* We need to save the current_type value. */
{ char *arrayname; { const char *arrayname;
int arrayfieldindex; int arrayfieldindex;
arrayfieldindex = is_pascal_string_type ( arrayfieldindex = is_pascal_string_type (
current_type, NULL, NULL, current_type, NULL, NULL,

View file

@ -99,7 +99,7 @@ int
is_pascal_string_type (struct type *type,int *length_pos, is_pascal_string_type (struct type *type,int *length_pos,
int *length_size, int *string_pos, int *length_size, int *string_pos,
struct type **char_type, struct type **char_type,
char **arrayname) const char **arrayname)
{ {
if (type != NULL && TYPE_CODE (type) == TYPE_CODE_STRUCT) if (type != NULL && TYPE_CODE (type) == TYPE_CODE_STRUCT)
{ {

View file

@ -50,7 +50,7 @@ extern void pascal_type_print_method_args (const char *, const char *,
extern int extern int
is_pascal_string_type (struct type *, int *, int *, int *, is_pascal_string_type (struct type *, int *, int *, int *,
struct type **, char **); struct type **, const char **);
extern void pascal_printchar (int, struct type *, struct ui_file *); extern void pascal_printchar (int, struct type *, struct ui_file *);

View file

@ -131,7 +131,7 @@ pascal_print_typedef (struct type *type, struct symbol *new_symbol,
static void static void
pascal_type_print_derivation_info (struct ui_file *stream, struct type *type) pascal_type_print_derivation_info (struct ui_file *stream, struct type *type)
{ {
char *name; const char *name;
int i; int i;
for (i = 0; i < TYPE_N_BASECLASSES (type); i++) for (i = 0; i < TYPE_N_BASECLASSES (type); i++)
@ -630,7 +630,7 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show,
{ {
struct fn_field *f = TYPE_FN_FIELDLIST1 (type, i); struct fn_field *f = TYPE_FN_FIELDLIST1 (type, i);
int j, len2 = TYPE_FN_FIELDLIST_LENGTH (type, i); int j, len2 = TYPE_FN_FIELDLIST_LENGTH (type, i);
char *method_name = TYPE_FN_FIELDLIST_NAME (type, i); const char *method_name = TYPE_FN_FIELDLIST_NAME (type, i);
/* this is GNU C++ specific /* this is GNU C++ specific
how can we know constructor/destructor? how can we know constructor/destructor?

View file

@ -649,7 +649,7 @@ const char pascal_vtbl_ptr_name[] =
int int
pascal_object_is_vtbl_ptr_type (struct type *type) pascal_object_is_vtbl_ptr_type (struct type *type)
{ {
char *typename = type_name_no_tag (type); const char *typename = type_name_no_tag (type);
return (typename != NULL return (typename != NULL
&& strcmp (typename, pascal_vtbl_ptr_name) == 0); && strcmp (typename, pascal_vtbl_ptr_name) == 0);
@ -912,7 +912,7 @@ pascal_object_print_value (struct type *type, const gdb_byte *valaddr,
{ {
int boffset = 0; int boffset = 0;
struct type *baseclass = check_typedef (TYPE_BASECLASS (type, i)); struct type *baseclass = check_typedef (TYPE_BASECLASS (type, i));
char *basename = type_name_no_tag (baseclass); const char *basename = type_name_no_tag (baseclass);
const gdb_byte *base_valaddr = NULL; const gdb_byte *base_valaddr = NULL;
int thisoffset; int thisoffset;
volatile struct gdb_exception ex; volatile struct gdb_exception ex;

View file

@ -638,7 +638,7 @@ build_address_symbolic (struct gdbarch *gdbarch,
struct symbol *symbol; struct symbol *symbol;
CORE_ADDR name_location = 0; CORE_ADDR name_location = 0;
struct obj_section *section = NULL; struct obj_section *section = NULL;
char *name_temp = ""; const char *name_temp = "";
/* Let's say it is mapped (not unmapped). */ /* Let's say it is mapped (not unmapped). */
*unmapped = 0; *unmapped = 0;

View file

@ -124,7 +124,7 @@ static PyObject *
frapy_name (PyObject *self, PyObject *args) frapy_name (PyObject *self, PyObject *args)
{ {
struct frame_info *frame; struct frame_info *frame;
char *name; const char *name;
enum language lang; enum language lang;
PyObject *result; PyObject *result;
volatile struct gdb_exception except; volatile struct gdb_exception except;

View file

@ -1271,7 +1271,7 @@ typy_getitem (PyObject *self, PyObject *key)
for (i = 0; i < TYPE_NFIELDS (type); i++) for (i = 0; i < TYPE_NFIELDS (type); i++)
{ {
char *t_field_name = TYPE_FIELD_NAME (type, i); const char *t_field_name = TYPE_FIELD_NAME (type, i);
if (t_field_name && (strcmp_iw (t_field_name, field) == 0)) if (t_field_name && (strcmp_iw (t_field_name, field) == 0))
{ {
@ -1332,7 +1332,7 @@ typy_has_key (PyObject *self, PyObject *args)
for (i = 0; i < TYPE_NFIELDS (type); i++) for (i = 0; i < TYPE_NFIELDS (type); i++)
{ {
char *t_field_name = TYPE_FIELD_NAME (type, i); const char *t_field_name = TYPE_FIELD_NAME (type, i);
if (t_field_name && (strcmp_iw (t_field_name, field) == 0)) if (t_field_name && (strcmp_iw (t_field_name, field) == 0))
Py_RETURN_TRUE; Py_RETURN_TRUE;

View file

@ -961,7 +961,7 @@ frv_fdpic_find_global_pointer (CORE_ADDR addr)
/* Forward declarations for frv_fdpic_find_canonical_descriptor(). */ /* Forward declarations for frv_fdpic_find_canonical_descriptor(). */
static CORE_ADDR find_canonical_descriptor_in_load_object static CORE_ADDR find_canonical_descriptor_in_load_object
(CORE_ADDR, CORE_ADDR, char *, bfd *, struct lm_info *); (CORE_ADDR, CORE_ADDR, const char *, bfd *, struct lm_info *);
/* Given a function entry point, attempt to find the canonical descriptor /* Given a function entry point, attempt to find the canonical descriptor
associated with that entry point. Return 0 if no canonical descriptor associated with that entry point. Return 0 if no canonical descriptor
@ -970,7 +970,7 @@ static CORE_ADDR find_canonical_descriptor_in_load_object
CORE_ADDR CORE_ADDR
frv_fdpic_find_canonical_descriptor (CORE_ADDR entry_point) frv_fdpic_find_canonical_descriptor (CORE_ADDR entry_point)
{ {
char *name; const char *name;
CORE_ADDR addr; CORE_ADDR addr;
CORE_ADDR got_value; CORE_ADDR got_value;
struct int_elf32_fdpic_loadmap *ldm = 0; struct int_elf32_fdpic_loadmap *ldm = 0;
@ -1019,7 +1019,7 @@ frv_fdpic_find_canonical_descriptor (CORE_ADDR entry_point)
static CORE_ADDR static CORE_ADDR
find_canonical_descriptor_in_load_object find_canonical_descriptor_in_load_object
(CORE_ADDR entry_point, CORE_ADDR got_value, char *name, bfd *abfd, (CORE_ADDR entry_point, CORE_ADDR got_value, const char *name, bfd *abfd,
struct lm_info *lm) struct lm_info *lm)
{ {
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch);

View file

@ -173,8 +173,8 @@ static const struct frame_unwind sparc32_sol2_sigtramp_frame_unwind =
/* Unglobalize NAME. */ /* Unglobalize NAME. */
char * const const char *
sparc_sol2_static_transform_name (char *name) sparc_sol2_static_transform_name (const char *name)
{ {
/* The Sun compilers (Sun ONE Studio, Forte Developer, Sun WorkShop, /* The Sun compilers (Sun ONE Studio, Forte Developer, Sun WorkShop,
SunPRO) convert file static variables into global values, a SunPRO) convert file static variables into global values, a

View file

@ -217,7 +217,7 @@ extern const struct sparc_gregset sparc32_sol2_gregset;
extern int sparc_sol2_pc_in_sigtramp (CORE_ADDR pc, const char *name); extern int sparc_sol2_pc_in_sigtramp (CORE_ADDR pc, const char *name);
extern char *sparc_sol2_static_transform_name (char *name); extern const char *sparc_sol2_static_transform_name (const char *name);
extern void sparc32_sol2_init_abi (struct gdbarch_info info, extern void sparc32_sol2_init_abi (struct gdbarch_info info,
struct gdbarch *gdbarch); struct gdbarch *gdbarch);

View file

@ -1173,7 +1173,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
NULL, objfile); NULL, objfile);
if (msym != NULL) if (msym != NULL)
{ {
char *new_name = gdbarch_static_transform_name const char *new_name = gdbarch_static_transform_name
(gdbarch, SYMBOL_LINKAGE_NAME (sym)); (gdbarch, SYMBOL_LINKAGE_NAME (sym));
SYMBOL_SET_LINKAGE_NAME (sym, new_name); SYMBOL_SET_LINKAGE_NAME (sym, new_name);
@ -1367,7 +1367,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
NULL, objfile); NULL, objfile);
if (msym != NULL) if (msym != NULL)
{ {
char *new_name = gdbarch_static_transform_name const char *new_name = gdbarch_static_transform_name
(gdbarch, SYMBOL_LINKAGE_NAME (sym)); (gdbarch, SYMBOL_LINKAGE_NAME (sym));
SYMBOL_SET_LINKAGE_NAME (sym, new_name); SYMBOL_SET_LINKAGE_NAME (sym, new_name);
@ -2232,10 +2232,11 @@ rs6000_builtin_type (int typenum, struct objfile *objfile)
/* This page contains subroutines of read_type. */ /* This page contains subroutines of read_type. */
/* Replace *OLD_NAME with the method name portion of PHYSNAME. */ /* Wrapper around method_name_from_physname to flag a complaint
if there is an error. */
static void static char *
update_method_name_from_physname (char **old_name, const char *physname) stabs_method_name_from_physname (const char *physname)
{ {
char *method_name; char *method_name;
@ -2245,16 +2246,10 @@ update_method_name_from_physname (char **old_name, const char *physname)
{ {
complaint (&symfile_complaints, complaint (&symfile_complaints,
_("Method has bad physname %s\n"), physname); _("Method has bad physname %s\n"), physname);
return; return NULL;
} }
if (strcmp (*old_name, method_name) != 0) return method_name;
{
xfree (*old_name);
*old_name = method_name;
}
else
xfree (method_name);
} }
/* Read member function stabs info for C++ classes. The form of each member /* Read member function stabs info for C++ classes. The form of each member
@ -2687,14 +2682,24 @@ read_member_functions (struct field_info *fip, char **pp, struct type *type,
- in -gstabs instead of -gstabs+ - in -gstabs instead of -gstabs+
- or for static methods, which are output as a function type - or for static methods, which are output as a function type
instead of a method type. */ instead of a method type. */
char *new_method_name =
stabs_method_name_from_physname (sublist->fn_field.physname);
update_method_name_from_physname (&new_fnlist->fn_fieldlist.name, if (new_method_name != NULL
sublist->fn_field.physname); && strcmp (new_method_name,
new_fnlist->fn_fieldlist.name) != 0)
{
new_fnlist->fn_fieldlist.name = new_method_name;
xfree (main_fn_name);
}
else
xfree (new_method_name);
} }
else if (has_destructor && new_fnlist->fn_fieldlist.name[0] != '~') else if (has_destructor && new_fnlist->fn_fieldlist.name[0] != '~')
{ {
new_fnlist->fn_fieldlist.name = new_fnlist->fn_fieldlist.name =
concat ("~", main_fn_name, (char *)NULL); obconcat (&objfile->objfile_obstack,
"~", main_fn_name, (char *)NULL);
xfree (main_fn_name); xfree (main_fn_name);
} }
else if (!has_stub) else if (!has_stub)
@ -2711,6 +2716,7 @@ read_member_functions (struct field_info *fip, char **pp, struct type *type,
new_fnlist->fn_fieldlist.name new_fnlist->fn_fieldlist.name
= obsavestring (dem_opname, strlen (dem_opname), = obsavestring (dem_opname, strlen (dem_opname),
&objfile->objfile_obstack); &objfile->objfile_obstack);
xfree (main_fn_name);
} }
new_fnlist->fn_fieldlist.fn_fields = (struct fn_field *) new_fnlist->fn_fieldlist.fn_fields = (struct fn_field *)
@ -2753,7 +2759,7 @@ read_cpp_abbrev (struct field_info *fip, char **pp, struct type *type,
struct objfile *objfile) struct objfile *objfile)
{ {
char *p; char *p;
char *name; const char *name;
char cpp_abbrev; char cpp_abbrev;
struct type *context; struct type *context;
@ -3266,7 +3272,7 @@ read_tilde_fields (struct field_info *fip, char **pp, struct type *type,
i >= TYPE_N_BASECLASSES (t); i >= TYPE_N_BASECLASSES (t);
--i) --i)
{ {
char *name = TYPE_FIELD_NAME (t, i); const char *name = TYPE_FIELD_NAME (t, i);
if (!strncmp (name, vptr_name, sizeof (vptr_name) - 2) if (!strncmp (name, vptr_name, sizeof (vptr_name) - 2)
&& is_cplus_marker (name[sizeof (vptr_name) - 2])) && is_cplus_marker (name[sizeof (vptr_name) - 2]))
@ -3406,8 +3412,8 @@ attach_fields_to_type (struct field_info *fip, struct type *type,
static void static void
complain_about_struct_wipeout (struct type *type) complain_about_struct_wipeout (struct type *type)
{ {
char *name = ""; const char *name = "";
char *kind = ""; const char *kind = "";
if (TYPE_TAG_NAME (type)) if (TYPE_TAG_NAME (type))
{ {
@ -4545,7 +4551,7 @@ cleanup_undefined_types_1 (void)
struct pending *ppt; struct pending *ppt;
int i; int i;
/* Name of the type, without "struct" or "union". */ /* Name of the type, without "struct" or "union". */
char *typename = TYPE_TAG_NAME (*type); const char *typename = TYPE_TAG_NAME (*type);
if (typename == NULL) if (typename == NULL)
{ {

View file

@ -162,7 +162,7 @@ struct stab_section_list
they are only used by some stabs readers. */ they are only used by some stabs readers. */
extern struct partial_symtab *end_psymtab (struct partial_symtab *pst, extern struct partial_symtab *end_psymtab (struct partial_symtab *pst,
char **include_list, const char **include_list,
int num_includes, int num_includes,
int capping_symbol_offset, int capping_symbol_offset,
CORE_ADDR capping_text, CORE_ADDR capping_text,

View file

@ -999,7 +999,7 @@ get_last_displayed_sal (struct symtab_and_line *sal)
corresponding to FRAME. */ corresponding to FRAME. */
void void
find_frame_funname (struct frame_info *frame, char **funname, find_frame_funname (struct frame_info *frame, const char **funname,
enum language *funlang, struct symbol **funcp) enum language *funlang, struct symbol **funcp)
{ {
struct symbol *func; struct symbol *func;
@ -1095,7 +1095,7 @@ print_frame (struct frame_info *frame, int print_level,
{ {
struct gdbarch *gdbarch = get_frame_arch (frame); struct gdbarch *gdbarch = get_frame_arch (frame);
struct ui_out *uiout = current_uiout; struct ui_out *uiout = current_uiout;
char *funname = NULL; const char *funname = NULL;
enum language funlang = language_unknown; enum language funlang = language_unknown;
struct ui_stream *stb; struct ui_stream *stb;
struct cleanup *old_chain, *list_chain; struct cleanup *old_chain, *list_chain;
@ -1363,7 +1363,7 @@ frame_info (char *addr_exp, int from_tty)
struct symtab *s; struct symtab *s;
struct frame_info *calling_frame_info; struct frame_info *calling_frame_info;
int numregs; int numregs;
char *funname = 0; const char *funname = 0;
enum language funlang = language_unknown; enum language funlang = language_unknown;
const char *pc_regname; const char *pc_regname;
int selected_frame_p; int selected_frame_p;

View file

@ -22,7 +22,7 @@
void select_frame_command (char *level_exp, int from_tty); void select_frame_command (char *level_exp, int from_tty);
void find_frame_funname (struct frame_info *frame, char **funname, void find_frame_funname (struct frame_info *frame, const char **funname,
enum language *funlang, struct symbol **funcp); enum language *funlang, struct symbol **funcp);
typedef void (*iterate_over_block_arg_local_vars_cb) (const char *print_name, typedef void (*iterate_over_block_arg_local_vars_cb) (const char *print_name,

View file

@ -65,8 +65,6 @@
/* Prototypes for local functions */ /* Prototypes for local functions */
static void completion_list_add_name (char *, char *, int, char *, char *);
static void rbreak_command (char *, int); static void rbreak_command (char *, int);
static void types_info (char *, int); static void types_info (char *, int);
@ -366,9 +364,9 @@ gdb_mangle_name (struct type *type, int method_id, int signature_id)
char *mangled_name; char *mangled_name;
struct fn_field *f = TYPE_FN_FIELDLIST1 (type, method_id); struct fn_field *f = TYPE_FN_FIELDLIST1 (type, method_id);
struct fn_field *method = &f[signature_id]; struct fn_field *method = &f[signature_id];
char *field_name = TYPE_FN_FIELDLIST_NAME (type, method_id); const char *field_name = TYPE_FN_FIELDLIST_NAME (type, method_id);
const char *physname = TYPE_FN_FIELD_PHYSNAME (f, signature_id); const char *physname = TYPE_FN_FIELD_PHYSNAME (f, signature_id);
char *newname = type_name_no_tag (type); const char *newname = type_name_no_tag (type);
/* Does the form of physname indicate that it is the full mangled name /* Does the form of physname indicate that it is the full mangled name
of a constructor (not just the args)? */ of a constructor (not just the args)? */
@ -478,7 +476,7 @@ symbol_set_demangled_name (struct general_symbol_info *gsymbol,
/* Return the demangled name of GSYMBOL. */ /* Return the demangled name of GSYMBOL. */
char * const char *
symbol_get_demangled_name (const struct general_symbol_info *gsymbol) symbol_get_demangled_name (const struct general_symbol_info *gsymbol)
{ {
if (gsymbol->language == language_cplus) if (gsymbol->language == language_cplus)
@ -686,12 +684,14 @@ symbol_set_names (struct general_symbol_info *gsymbol,
name with the symbol, we don't need to use the same trick name with the symbol, we don't need to use the same trick
as Java. */ as Java. */
if (!copy_name) if (!copy_name)
gsymbol->name = (char *) linkage_name; gsymbol->name = linkage_name;
else else
{ {
gsymbol->name = obstack_alloc (&objfile->objfile_obstack, len + 1); char *name = obstack_alloc (&objfile->objfile_obstack, len + 1);
memcpy (gsymbol->name, linkage_name, len);
gsymbol->name[len] = '\0'; memcpy (name, linkage_name, len);
name[len] = '\0';
gsymbol->name = name;
} }
symbol_set_demangled_name (gsymbol, NULL, NULL); symbol_set_demangled_name (gsymbol, NULL, NULL);
@ -797,7 +797,7 @@ symbol_set_names (struct general_symbol_info *gsymbol,
/* Return the source code name of a symbol. In languages where /* Return the source code name of a symbol. In languages where
demangling is necessary, this is the demangled name. */ demangling is necessary, this is the demangled name. */
char * const char *
symbol_natural_name (const struct general_symbol_info *gsymbol) symbol_natural_name (const struct general_symbol_info *gsymbol)
{ {
switch (gsymbol->language) switch (gsymbol->language)
@ -825,7 +825,7 @@ symbol_natural_name (const struct general_symbol_info *gsymbol)
/* Return the demangled name for a symbol based on the language for /* Return the demangled name for a symbol based on the language for
that symbol. If no demangled name exists, return NULL. */ that symbol. If no demangled name exists, return NULL. */
char * const char *
symbol_demangled_name (const struct general_symbol_info *gsymbol) symbol_demangled_name (const struct general_symbol_info *gsymbol)
{ {
switch (gsymbol->language) switch (gsymbol->language)
@ -855,7 +855,7 @@ symbol_demangled_name (const struct general_symbol_info *gsymbol)
If there is no distinct demangled name, then returns the same value If there is no distinct demangled name, then returns the same value
(same pointer) as SYMBOL_LINKAGE_NAME. */ (same pointer) as SYMBOL_LINKAGE_NAME. */
char * const char *
symbol_search_name (const struct general_symbol_info *gsymbol) symbol_search_name (const struct general_symbol_info *gsymbol)
{ {
if (gsymbol->language == language_ada) if (gsymbol->language == language_ada)
@ -3833,8 +3833,9 @@ static char **return_val;
characters. If so, add it to the current completion list. */ characters. If so, add it to the current completion list. */
static void static void
completion_list_add_name (char *symname, char *sym_text, int sym_text_len, completion_list_add_name (const char *symname,
char *text, char *word) const char *sym_text, int sym_text_len,
const char *text, const char *word)
{ {
int newsize; int newsize;
@ -3882,13 +3883,14 @@ completion_list_add_name (char *symname, char *sym_text, int sym_text_len,
again and feed all the selectors into the mill. */ again and feed all the selectors into the mill. */
static void static void
completion_list_objc_symbol (struct minimal_symbol *msymbol, char *sym_text, completion_list_objc_symbol (struct minimal_symbol *msymbol,
int sym_text_len, char *text, char *word) const char *sym_text, int sym_text_len,
const char *text, const char *word)
{ {
static char *tmp = NULL; static char *tmp = NULL;
static unsigned int tmplen = 0; static unsigned int tmplen = 0;
char *method, *category, *selector; const char *method, *category, *selector;
char *tmp2 = NULL; char *tmp2 = NULL;
method = SYMBOL_NATURAL_NAME (msymbol); method = SYMBOL_NATURAL_NAME (msymbol);

View file

@ -81,7 +81,7 @@ struct language_defn;
struct cplus_specific struct cplus_specific
{ {
char *demangled_name; const char *demangled_name;
}; };
/* Define a structure for the information that is common to all symbol types, /* Define a structure for the information that is common to all symbol types,
@ -99,7 +99,7 @@ struct general_symbol_info
the mangled name and demangled name, this is the mangled the mangled name and demangled name, this is the mangled
name. */ name. */
char *name; const char *name;
/* Value of the symbol. Which member of this union to use, and what /* Value of the symbol. Which member of this union to use, and what
it means, depends on what kind of symbol this is and its it means, depends on what kind of symbol this is and its
@ -135,7 +135,7 @@ struct general_symbol_info
currently used by Ada, Java, and Objective C. */ currently used by Ada, Java, and Objective C. */
struct mangled_lang struct mangled_lang
{ {
char *demangled_name; const char *demangled_name;
} }
mangled_lang; mangled_lang;
@ -166,7 +166,8 @@ struct general_symbol_info
extern void symbol_set_demangled_name (struct general_symbol_info *, char *, extern void symbol_set_demangled_name (struct general_symbol_info *, char *,
struct objfile *); struct objfile *);
extern char *symbol_get_demangled_name (const struct general_symbol_info *); extern const char *symbol_get_demangled_name
(const struct general_symbol_info *);
extern CORE_ADDR symbol_overlayed_address (CORE_ADDR, struct obj_section *); extern CORE_ADDR symbol_overlayed_address (CORE_ADDR, struct obj_section *);
@ -225,7 +226,8 @@ extern void symbol_set_names (struct general_symbol_info *symbol,
#define SYMBOL_NATURAL_NAME(symbol) \ #define SYMBOL_NATURAL_NAME(symbol) \
(symbol_natural_name (&(symbol)->ginfo)) (symbol_natural_name (&(symbol)->ginfo))
extern char *symbol_natural_name (const struct general_symbol_info *symbol); extern const char *symbol_natural_name
(const struct general_symbol_info *symbol);
/* Return SYMBOL's name from the point of view of the linker. In /* Return SYMBOL's name from the point of view of the linker. In
languages like C++ where symbols may be mangled for ease of languages like C++ where symbols may be mangled for ease of
@ -238,7 +240,8 @@ extern char *symbol_natural_name (const struct general_symbol_info *symbol);
that symbol. If no demangled name exists, return NULL. */ that symbol. If no demangled name exists, return NULL. */
#define SYMBOL_DEMANGLED_NAME(symbol) \ #define SYMBOL_DEMANGLED_NAME(symbol) \
(symbol_demangled_name (&(symbol)->ginfo)) (symbol_demangled_name (&(symbol)->ginfo))
extern char *symbol_demangled_name (const struct general_symbol_info *symbol); extern const char *symbol_demangled_name
(const struct general_symbol_info *symbol);
/* Macro that returns a version of the name of a symbol that is /* Macro that returns a version of the name of a symbol that is
suitable for output. In C++ this is the "demangled" form of the suitable for output. In C++ this is the "demangled" form of the
@ -261,7 +264,7 @@ extern int demangle;
returns the same value (same pointer) as SYMBOL_LINKAGE_NAME. */ returns the same value (same pointer) as SYMBOL_LINKAGE_NAME. */
#define SYMBOL_SEARCH_NAME(symbol) \ #define SYMBOL_SEARCH_NAME(symbol) \
(symbol_search_name (&(symbol)->ginfo)) (symbol_search_name (&(symbol)->ginfo))
extern char *symbol_search_name (const struct general_symbol_info *); extern const char *symbol_search_name (const struct general_symbol_info *);
/* Return non-zero if NAME matches the "search" name of SYMBOL. /* Return non-zero if NAME matches the "search" name of SYMBOL.
Whitespace and trailing parentheses are ignored. Whitespace and trailing parentheses are ignored.

View file

@ -2577,7 +2577,8 @@ scope_info (char *args, int from_tty)
struct symbol *sym; struct symbol *sym;
struct minimal_symbol *msym; struct minimal_symbol *msym;
struct block *block; struct block *block;
char *symname, *save_args = args; const char *symname;
char *save_args = args;
struct dict_iterator iter; struct dict_iterator iter;
int j, count = 0; int j, count = 0;
struct gdbarch *gdbarch; struct gdbarch *gdbarch;

View file

@ -73,7 +73,7 @@ default_print_typedef (struct type *type, struct symbol *new_symbol,
If SHOW is negative, we never show the details of elements' types. */ If SHOW is negative, we never show the details of elements' types. */
void void
type_print (struct type *type, char *varstring, struct ui_file *stream, type_print (struct type *type, const char *varstring, struct ui_file *stream,
int show) int show)
{ {
LA_PRINT_TYPE (type, varstring, stream, show, 0); LA_PRINT_TYPE (type, varstring, stream, show, 0);

View file

@ -2589,7 +2589,7 @@ print_spaces_filtered (int n, struct ui_file *stream)
demangling is off, the name is printed in its "raw" form. */ demangling is off, the name is printed in its "raw" form. */
void void
fprintf_symbol_filtered (struct ui_file *stream, char *name, fprintf_symbol_filtered (struct ui_file *stream, const char *name,
enum language lang, int arg_mode) enum language lang, int arg_mode)
{ {
char *demangled; char *demangled;

View file

@ -64,7 +64,7 @@ find_size_for_pointer_math (struct type *ptr_type)
sz = 1; sz = 1;
else else
{ {
char *name; const char *name;
name = TYPE_NAME (ptr_target); name = TYPE_NAME (ptr_target);
if (name == NULL) if (name == NULL)

View file

@ -2005,7 +2005,7 @@ search_struct_field (const char *name, struct value *arg1, int offset,
if (!looking_for_baseclass) if (!looking_for_baseclass)
for (i = TYPE_NFIELDS (type) - 1; i >= nbases; i--) for (i = TYPE_NFIELDS (type) - 1; i >= nbases; i--)
{ {
char *t_field_name = TYPE_FIELD_NAME (type, i); const char *t_field_name = TYPE_FIELD_NAME (type, i);
if (t_field_name && (strcmp_iw (t_field_name, name) == 0)) if (t_field_name && (strcmp_iw (t_field_name, name) == 0))
{ {
@ -2163,7 +2163,7 @@ search_struct_method (const char *name, struct value **arg1p,
CHECK_TYPEDEF (type); CHECK_TYPEDEF (type);
for (i = TYPE_NFN_FIELDS (type) - 1; i >= 0; i--) for (i = TYPE_NFN_FIELDS (type) - 1; i >= 0; i--)
{ {
char *t_field_name = TYPE_FN_FIELDLIST_NAME (type, i); const char *t_field_name = TYPE_FN_FIELDLIST_NAME (type, i);
/* FIXME! May need to check for ARM demangling here. */ /* FIXME! May need to check for ARM demangling here. */
if (strncmp (t_field_name, "__", 2) == 0 || if (strncmp (t_field_name, "__", 2) == 0 ||
@ -2407,7 +2407,7 @@ find_method_list (struct value **argp, const char *method,
for (i = TYPE_NFN_FIELDS (type) - 1; i >= 0; i--) for (i = TYPE_NFN_FIELDS (type) - 1; i >= 0; i--)
{ {
/* pai: FIXME What about operators and type conversions? */ /* pai: FIXME What about operators and type conversions? */
char *fn_field_name = TYPE_FN_FIELDLIST_NAME (type, i); const char *fn_field_name = TYPE_FN_FIELDLIST_NAME (type, i);
if (fn_field_name && (strcmp_iw (fn_field_name, method) == 0)) if (fn_field_name && (strcmp_iw (fn_field_name, method) == 0))
{ {
@ -3154,7 +3154,7 @@ check_field (struct type *type, const char *name)
for (i = TYPE_NFIELDS (type) - 1; i >= TYPE_N_BASECLASSES (type); i--) for (i = TYPE_NFIELDS (type) - 1; i >= TYPE_N_BASECLASSES (type); i--)
{ {
char *t_field_name = TYPE_FIELD_NAME (type, i); const char *t_field_name = TYPE_FIELD_NAME (type, i);
if (t_field_name && (strcmp_iw (t_field_name, name) == 0)) if (t_field_name && (strcmp_iw (t_field_name, name) == 0))
return 1; return 1;
@ -3280,7 +3280,7 @@ value_struct_elt_for_reference (struct type *domain, int offset,
for (i = TYPE_NFIELDS (t) - 1; i >= TYPE_N_BASECLASSES (t); i--) for (i = TYPE_NFIELDS (t) - 1; i >= TYPE_N_BASECLASSES (t); i--)
{ {
char *t_field_name = TYPE_FIELD_NAME (t, i); const char *t_field_name = TYPE_FIELD_NAME (t, i);
if (t_field_name && strcmp (t_field_name, name) == 0) if (t_field_name && strcmp (t_field_name, name) == 0)
{ {
@ -3317,7 +3317,7 @@ value_struct_elt_for_reference (struct type *domain, int offset,
for (i = TYPE_NFN_FIELDS (t) - 1; i >= 0; --i) for (i = TYPE_NFN_FIELDS (t) - 1; i >= 0; --i)
{ {
char *t_field_name = TYPE_FN_FIELDLIST_NAME (t, i); const char *t_field_name = TYPE_FN_FIELDLIST_NAME (t, i);
char dem_opname[64]; char dem_opname[64];
if (strncmp (t_field_name, "__", 2) == 0 if (strncmp (t_field_name, "__", 2) == 0

View file

@ -777,7 +777,7 @@ extern int record_latest_value (struct value *val);
extern void modify_field (struct type *type, gdb_byte *addr, extern void modify_field (struct type *type, gdb_byte *addr,
LONGEST fieldval, int bitpos, int bitsize); LONGEST fieldval, int bitpos, int bitsize);
extern void type_print (struct type *type, char *varstring, extern void type_print (struct type *type, const char *varstring,
struct ui_file *stream, int show); struct ui_file *stream, int show);
extern char *type_to_string (struct type *type); extern char *type_to_string (struct type *type);

View file

@ -3086,7 +3086,7 @@ c_describe_child (struct varobj *parent, int index,
case TYPE_CODE_STRUCT: case TYPE_CODE_STRUCT:
case TYPE_CODE_UNION: case TYPE_CODE_UNION:
{ {
char *field_name; const char *field_name;
/* If the type is anonymous and the field has no name, /* If the type is anonymous and the field has no name,
set an appropriate name. */ set an appropriate name. */
@ -3515,7 +3515,7 @@ cplus_describe_child (struct varobj *parent, int index,
enum accessibility acc = public_field; enum accessibility acc = public_field;
int vptr_fieldno; int vptr_fieldno;
struct type *basetype = NULL; struct type *basetype = NULL;
char *field_name; const char *field_name;
vptr_fieldno = get_vptr_fieldno (type, &basetype); vptr_fieldno = get_vptr_fieldno (type, &basetype);
if (strcmp (parent->name, "private") == 0) if (strcmp (parent->name, "private") == 0)

View file

@ -882,7 +882,7 @@ enter_line_range (struct subfile *subfile, unsigned beginoffset,
#define RECORD_MINIMAL_SYMBOL(NAME, ADDR, TYPE, SECTION, OBJFILE) \ #define RECORD_MINIMAL_SYMBOL(NAME, ADDR, TYPE, SECTION, OBJFILE) \
{ \ { \
char *namestr; \ const char *namestr; \
\ \
namestr = (NAME); \ namestr = (NAME); \
if (namestr[0] == '.') ++namestr; \ if (namestr[0] == '.') ++namestr; \
@ -986,7 +986,7 @@ read_xcoff_symtab (struct partial_symtab *pst)
char *filestring = " _start_ "; /* Name of the current file. */ char *filestring = " _start_ "; /* Name of the current file. */
char *last_csect_name; /* Last seen csect's name and value. */ const char *last_csect_name; /* Last seen csect's name and value. */
CORE_ADDR last_csect_val; CORE_ADDR last_csect_val;
int last_csect_sec; int last_csect_sec;
@ -1989,10 +1989,6 @@ init_stringtab (bfd *abfd, file_ptr offset, struct objfile *objfile)
for the psymtab. */ for the psymtab. */
static unsigned int first_fun_line_offset; static unsigned int first_fun_line_offset;
static struct partial_symtab *xcoff_start_psymtab
(struct objfile *, char *, int,
struct partial_symbol **, struct partial_symbol **);
/* Allocate and partially fill a partial symtab. It will be /* Allocate and partially fill a partial symtab. It will be
completely filled at the end of the symbol list. completely filled at the end of the symbol list.
@ -2001,7 +1997,8 @@ static struct partial_symtab *xcoff_start_psymtab
(normal). */ (normal). */
static struct partial_symtab * static struct partial_symtab *
xcoff_start_psymtab (struct objfile *objfile, char *filename, int first_symnum, xcoff_start_psymtab (struct objfile *objfile,
const char *filename, int first_symnum,
struct partial_symbol **global_syms, struct partial_symbol **global_syms,
struct partial_symbol **static_syms) struct partial_symbol **static_syms)
{ {
@ -2023,10 +2020,6 @@ xcoff_start_psymtab (struct objfile *objfile, char *filename, int first_symnum,
return result; return result;
} }
static struct partial_symtab *xcoff_end_psymtab
(struct partial_symtab *, char **, int, int,
struct partial_symtab **, int, int);
/* Close off the current usage of PST. /* Close off the current usage of PST.
Returns PST, or NULL if the partial symtab was empty and thrown away. Returns PST, or NULL if the partial symtab was empty and thrown away.
@ -2036,7 +2029,7 @@ static struct partial_symtab *xcoff_end_psymtab
are the information for includes and dependencies. */ are the information for includes and dependencies. */
static struct partial_symtab * static struct partial_symtab *
xcoff_end_psymtab (struct partial_symtab *pst, char **include_list, xcoff_end_psymtab (struct partial_symtab *pst, const char **include_list,
int num_includes, int capping_symbol_number, int num_includes, int capping_symbol_number,
struct partial_symtab **dependency_list, struct partial_symtab **dependency_list,
int number_dependencies, int textlow_not_set) int number_dependencies, int textlow_not_set)
@ -2119,17 +2112,13 @@ xcoff_end_psymtab (struct partial_symtab *pst, char **include_list,
return pst; return pst;
} }
static void swap_sym (struct internal_syment *,
union internal_auxent *, char **, char **,
unsigned int *, struct objfile *);
/* Swap raw symbol at *RAW and put the name in *NAME, the symbol in /* Swap raw symbol at *RAW and put the name in *NAME, the symbol in
*SYMBOL, the first auxent in *AUX. Advance *RAW and *SYMNUMP over *SYMBOL, the first auxent in *AUX. Advance *RAW and *SYMNUMP over
the symbol and its auxents. */ the symbol and its auxents. */
static void static void
swap_sym (struct internal_syment *symbol, union internal_auxent *aux, swap_sym (struct internal_syment *symbol, union internal_auxent *aux,
char **name, char **raw, unsigned int *symnump, const char **name, char **raw, unsigned int *symnump,
struct objfile *objfile) struct objfile *objfile)
{ {
bfd_coff_swap_sym_in (objfile->obfd, *raw, symbol); bfd_coff_swap_sym_in (objfile->obfd, *raw, symbol);
@ -2189,9 +2178,9 @@ scan_xcoff_symtab (struct objfile *objfile)
{ {
struct gdbarch *gdbarch = get_objfile_arch (objfile); struct gdbarch *gdbarch = get_objfile_arch (objfile);
CORE_ADDR toc_offset = 0; /* toc offset value in data section. */ CORE_ADDR toc_offset = 0; /* toc offset value in data section. */
char *filestring = NULL; const char *filestring = NULL;
char *namestring; const char *namestring;
int past_first_source_file = 0; int past_first_source_file = 0;
bfd *abfd; bfd *abfd;
asection *bfd_sect; asection *bfd_sect;
@ -2201,7 +2190,7 @@ scan_xcoff_symtab (struct objfile *objfile)
struct partial_symtab *pst; struct partial_symtab *pst;
/* List of current psymtab's include files. */ /* List of current psymtab's include files. */
char **psymtab_include_list; const char **psymtab_include_list;
int includes_allocated; int includes_allocated;
int includes_used; int includes_used;
@ -2214,7 +2203,7 @@ scan_xcoff_symtab (struct objfile *objfile)
union internal_auxent main_aux[5]; union internal_auxent main_aux[5];
unsigned int ssymnum; unsigned int ssymnum;
char *last_csect_name = NULL; /* Last seen csect's name and value. */ const char *last_csect_name = NULL; /* Last seen csect's name and value. */
CORE_ADDR last_csect_val = 0; CORE_ADDR last_csect_val = 0;
int last_csect_sec = 0; int last_csect_sec = 0;
int misc_func_recorded = 0; /* true if any misc. function. */ int misc_func_recorded = 0; /* true if any misc. function. */
@ -2224,8 +2213,8 @@ scan_xcoff_symtab (struct objfile *objfile)
includes_allocated = 30; includes_allocated = 30;
includes_used = 0; includes_used = 0;
psymtab_include_list = (char **) alloca (includes_allocated * psymtab_include_list = (const char **) alloca (includes_allocated *
sizeof (char *)); sizeof (const char *));
dependencies_allocated = 30; dependencies_allocated = 30;
dependencies_used = 0; dependencies_used = 0;
@ -2619,13 +2608,13 @@ scan_xcoff_symtab (struct objfile *objfile)
psymtab_include_list[includes_used++] = namestring; psymtab_include_list[includes_used++] = namestring;
if (includes_used >= includes_allocated) if (includes_used >= includes_allocated)
{ {
char **orig = psymtab_include_list; const char **orig = psymtab_include_list;
psymtab_include_list = (char **) psymtab_include_list = (const char **)
alloca ((includes_allocated *= 2) * alloca ((includes_allocated *= 2) *
sizeof (char *)); sizeof (const char *));
memcpy (psymtab_include_list, orig, memcpy (psymtab_include_list, orig,
includes_used * sizeof (char *)); includes_used * sizeof (const char *));
} }
continue; continue;
} }