diff options
author | Doug Evans <dje@google.com> | 2012-02-07 04:48:23 +0000 |
---|---|---|
committer | Doug Evans <dje@google.com> | 2012-02-07 04:48:23 +0000 |
commit | 0d5cff5020224cfd67bc3d6e30b158105d03a324 (patch) | |
tree | 391b03bb5669edec5af9d377f1bdc4fbd0e9edc3 /gdb/ada-lang.c | |
parent | 7fda53d583bf5baaa15ccdea78c48bf57b205dad (diff) | |
download | gdb-0d5cff5020224cfd67bc3d6e30b158105d03a324.zip gdb-0d5cff5020224cfd67bc3d6e30b158105d03a324.tar.gz gdb-0d5cff5020224cfd67bc3d6e30b158105d03a324.tar.bz2 |
* 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.
Diffstat (limited to 'gdb/ada-lang.c')
-rw-r--r-- | gdb/ada-lang.c | 67 |
1 files changed, 34 insertions, 33 deletions
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 6ea013c..49178cf 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -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, 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 *); 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. */ 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)); if (raw_type) @@ -1962,8 +1962,8 @@ ada_is_unconstrained_packed_array_type (struct type *type) static long decode_packed_array_bitsize (struct type *type) { - char *raw_name; - char *tail; + const char *raw_name; + const char *tail; long bits; /* 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 * 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 *tail; + const char *tail; struct type *shadow_type; long bits; @@ -3407,7 +3407,7 @@ ada_resolve_function (struct ada_symbol_info syms[], such symbols by their trailing number (__N or $N). */ static int -encoded_ordered_before (char *N0, char *N1) +encoded_ordered_before (const char *N0, const char *N1) { if (N1 == NULL) return 0; @@ -4248,8 +4248,8 @@ lesseq_defined_than (struct symbol *sym0, struct symbol *sym1) { struct type *type0 = SYMBOL_TYPE (sym0); struct type *type1 = SYMBOL_TYPE (sym1); - char *name0 = SYMBOL_LINKAGE_NAME (sym0); - char *name1 = SYMBOL_LINKAGE_NAME (sym1); + const char *name0 = SYMBOL_LINKAGE_NAME (sym0); + const char *name1 = SYMBOL_LINKAGE_NAME (sym1); int len0 = strlen (name0); return @@ -4380,7 +4380,7 @@ add_symbols_from_enclosing_procs (struct obstack *obstackp, static int 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); } @@ -4411,8 +4411,8 @@ ada_identical_enum_types_p (struct type *type1, struct type *type2) suffix). */ for (i = 0; i < TYPE_NFIELDS (type1); i++) { - char *name_1 = TYPE_FIELD_NAME (type1, i); - char *name_2 = TYPE_FIELD_NAME (type2, i); + const char *name_1 = TYPE_FIELD_NAME (type1, i); + const char *name_2 = TYPE_FIELD_NAME (type2, i); int len_1 = strlen (name_1); int len_2 = strlen (name_2); @@ -4647,7 +4647,7 @@ is_package_name (const char *name) not visible from FUNCTION_NAME. */ 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; @@ -4717,7 +4717,7 @@ remove_irrelevant_renamings (struct ada_symbol_info *syms, int nsyms, const struct block *current_block) { struct symbol *current_function; - char *current_function_name; + const char *current_function_name; int i; int is_new_style_renaming; @@ -5854,7 +5854,7 @@ ada_make_symbol_completion_list (char *text0, char *word) static int ada_is_dispatch_table_ptr_type (struct type *type) { - char *name; + const char *name; if (TYPE_CODE (type) != TYPE_CODE_PTR) return 0; @@ -6367,7 +6367,7 @@ ada_value_primitive_field (struct value *arg1, int offset, int fieldno, Returns 1 if found, 0 otherwise. */ 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, int *byte_offset_p, int *bit_offset_p, int *bit_size_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 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) continue; @@ -6466,7 +6466,7 @@ ada_search_struct_field (char *name, struct value *arg, int offset, type = ada_check_typedef (type); 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) 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) { - char *t_field_name = TYPE_FIELD_NAME (type, i); + const char *t_field_name = TYPE_FIELD_NAME (type, i); struct type *t; 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 generates these for unchecked variant types. Revisit 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; if (v_field_name != NULL && 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 as well as adding the ``___XR'' suffix to build the name of 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 for instance to qualify nested subprograms. When building 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 null, its TYPE_TAG_NAME. Null if TYPE is null. */ -char * +const char * ada_type_name (struct type *type) { if (type == NULL) @@ -7137,7 +7137,7 @@ find_parallel_type_by_descriptive_type (struct type *type, const char *name) result = TYPE_DESCRIPTIVE_TYPE (type); while (result != NULL) { - char *result_name = ada_type_name (result); + const char *result_name = ada_type_name (result); if (result_name == NULL) { @@ -7189,7 +7189,8 @@ ada_find_parallel_type_with_name (struct type *type, const char *name) struct type * 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; 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. */ 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" */); int xvz_found = 0; LONGEST size; @@ -8090,7 +8091,7 @@ ada_check_typedef (struct type *type) return type; else { - char *name = TYPE_TAG_NAME (type); + const char *name = TYPE_TAG_NAME (type); struct type *type1 = ada_find_any_type (name); if (type1 == NULL) @@ -8870,7 +8871,7 @@ aggregate_assign_from_choices (struct value *container, else { int ind; - char *name; + const char *name; switch (op) { @@ -9879,7 +9880,7 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, else if (discrete_type_p (type_arg)) { struct type *range_type; - char *name = ada_type_name (type_arg); + const char *name = ada_type_name (type_arg); range_type = NULL; 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 * to_fixed_range_type (struct type *raw_type, struct value *dval) { - char *name; + const char *name; struct type *base_type; char *subtype_info; @@ -10534,8 +10535,8 @@ ada_is_modular_type (struct type *type) int ada_modulus_from_name (struct type *type, ULONGEST *modulus) { - char *name = ada_type_name (type); - char *suffix; + const char *name = ada_type_name (type); + const char *suffix; int k; LONGEST U; @@ -10781,7 +10782,7 @@ static int is_known_support_routine (struct frame_info *frame) { struct symtab_and_line sal; - char *func_name; + const char *func_name; enum language func_lang; int i; @@ -10884,7 +10885,7 @@ ada_unhandled_exception_name_addr_from_raise (void) while (fi != NULL) { - char *func_name; + const char *func_name; enum language func_lang; find_frame_funname (fi, &func_name, &func_lang, NULL); |