aboutsummaryrefslogtreecommitdiff
path: root/gdb/symtab.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/symtab.c')
-rw-r--r--gdb/symtab.c52
1 files changed, 28 insertions, 24 deletions
diff --git a/gdb/symtab.c b/gdb/symtab.c
index c0e5884..346c162 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -4108,8 +4108,8 @@ completion_list_objc_symbol (struct minimal_symbol *msymbol,
/* Break the non-quoted text based on the characters which are in
symbols. FIXME: This should probably be language-specific. */
-static char *
-language_search_unquoted_string (char *text, char *p)
+static const char *
+language_search_unquoted_string (const char *text, const char *p)
{
for (; p > text; --p)
{
@@ -4125,7 +4125,7 @@ language_search_unquoted_string (char *text, char *p)
p -= 2; /* Beginning of a method name. */
else if (p[-1] == ' ' || p[-1] == '(' || p[-1] == ')')
{ /* Might be part of a method name. */
- char *t = p;
+ const char *t = p;
/* Seeing a ' ' or a '(' is not conclusive evidence
that we are in the middle of a method name. However,
@@ -4152,8 +4152,9 @@ language_search_unquoted_string (char *text, char *p)
}
static void
-completion_list_add_fields (struct symbol *sym, char *sym_text,
- int sym_text_len, char *text, char *word)
+completion_list_add_fields (struct symbol *sym, const char *sym_text,
+ int sym_text_len, const char *text,
+ const char *word)
{
if (SYMBOL_CLASS (sym) == LOC_TYPEDEF)
{
@@ -4174,10 +4175,10 @@ completion_list_add_fields (struct symbol *sym, char *sym_text,
needed by completion_list_add_name. */
struct add_name_data
{
- char *sym_text;
+ const char *sym_text;
int sym_text_len;
- char *text;
- char *word;
+ const char *text;
+ const char *word;
};
/* A callback used with macro_for_each and macro_for_each_in_scope.
@@ -4206,7 +4207,8 @@ expand_partial_symbol_name (const char *name, void *user_data)
}
VEC (char_ptr) *
-default_make_symbol_completion_list_break_on (char *text, char *word,
+default_make_symbol_completion_list_break_on (const char *text,
+ const char *word,
const char *break_on,
enum type_code code)
{
@@ -4222,7 +4224,7 @@ default_make_symbol_completion_list_break_on (char *text, char *word,
const struct block *surrounding_static_block, *surrounding_global_block;
struct block_iterator iter;
/* The symbol we are completing on. Points in same buffer as text. */
- char *sym_text;
+ const char *sym_text;
/* Length of sym_text. */
int sym_text_len;
struct add_name_data datum;
@@ -4230,9 +4232,9 @@ default_make_symbol_completion_list_break_on (char *text, char *word,
/* Now look for the symbol we are supposed to complete on. */
{
- char *p;
+ const char *p;
char quote_found;
- char *quote_pos = NULL;
+ const char *quote_pos = NULL;
/* First see if this is a quoted string. */
quote_found = '\0';
@@ -4437,7 +4439,7 @@ default_make_symbol_completion_list_break_on (char *text, char *word,
}
VEC (char_ptr) *
-default_make_symbol_completion_list (char *text, char *word,
+default_make_symbol_completion_list (const char *text, const char *word,
enum type_code code)
{
return default_make_symbol_completion_list_break_on (text, word, "", code);
@@ -4448,7 +4450,7 @@ default_make_symbol_completion_list (char *text, char *word,
is NULL. */
VEC (char_ptr) *
-make_symbol_completion_list (char *text, char *word)
+make_symbol_completion_list (const char *text, const char *word)
{
return current_language->la_make_symbol_completion_list (text, word,
TYPE_CODE_UNDEF);
@@ -4458,7 +4460,8 @@ make_symbol_completion_list (char *text, char *word)
symbols whose type code is CODE. */
VEC (char_ptr) *
-make_symbol_completion_type (char *text, char *word, enum type_code code)
+make_symbol_completion_type (const char *text, const char *word,
+ enum type_code code)
{
gdb_assert (code == TYPE_CODE_UNION
|| code == TYPE_CODE_STRUCT
@@ -4472,7 +4475,7 @@ make_symbol_completion_type (char *text, char *word, enum type_code code)
VEC (char_ptr) *
make_symbol_completion_list_fn (struct cmd_list_element *ignore,
- char *text, char *word)
+ const char *text, const char *word)
{
return make_symbol_completion_list (text, word);
}
@@ -4481,23 +4484,24 @@ make_symbol_completion_list_fn (struct cmd_list_element *ignore,
defined in a source file FILE. */
VEC (char_ptr) *
-make_file_symbol_completion_list (char *text, char *word, char *srcfile)
+make_file_symbol_completion_list (const char *text, const char *word,
+ const char *srcfile)
{
struct symbol *sym;
struct symtab *s;
struct block *b;
struct block_iterator iter;
/* The symbol we are completing on. Points in same buffer as text. */
- char *sym_text;
+ const char *sym_text;
/* Length of sym_text. */
int sym_text_len;
/* Now look for the symbol we are supposed to complete on.
FIXME: This should be language-specific. */
{
- char *p;
+ const char *p;
char quote_found;
- char *quote_pos = NULL;
+ const char *quote_pos = NULL;
/* First see if this is a quoted string. */
quote_found = '\0';
@@ -4579,7 +4583,7 @@ make_file_symbol_completion_list (char *text, char *word, char *srcfile)
list as necessary. */
static void
-add_filename_to_list (const char *fname, char *text, char *word,
+add_filename_to_list (const char *fname, const char *text, const char *word,
VEC (char_ptr) **list)
{
char *new;
@@ -4630,8 +4634,8 @@ not_interesting_fname (const char *fname)
struct add_partial_filename_data
{
struct filename_seen_cache *filename_seen_cache;
- char *text;
- char *word;
+ const char *text;
+ const char *word;
int text_len;
VEC (char_ptr) **list;
};
@@ -4670,7 +4674,7 @@ maybe_add_partial_symtab_filename (const char *filename, const char *fullname,
NULL. */
VEC (char_ptr) *
-make_source_files_completion_list (char *text, char *word)
+make_source_files_completion_list (const char *text, const char *word)
{
struct symtab *s;
struct objfile *objfile;