aboutsummaryrefslogtreecommitdiff
path: root/gdb/c-lang.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/c-lang.c')
-rw-r--r--gdb/c-lang.c34
1 files changed, 9 insertions, 25 deletions
diff --git a/gdb/c-lang.c b/gdb/c-lang.c
index 3628ebe..a65002c 100644
--- a/gdb/c-lang.c
+++ b/gdb/c-lang.c
@@ -38,8 +38,6 @@
#include "block.h"
#include "linespec.h" /* for find_toplevel_char */
-extern void _initialize_c_language (void);
-
/* Given a C string type, STR_TYPE, return the corresponding target
character set name. */
@@ -573,15 +571,12 @@ evaluate_subexp_c (struct type *expect_type, struct expression *exp,
{
int oplen, limit;
struct type *type;
- struct obstack output;
- struct cleanup *cleanup;
struct value *result;
c_string_type dest_type;
const char *dest_charset;
int satisfy_expected = 0;
- obstack_init (&output);
- cleanup = make_cleanup_obstack_free (&output);
+ auto_obstack output;
++*pos;
oplen = longest_to_int (exp->elts[*pos].longconst);
@@ -659,7 +654,6 @@ evaluate_subexp_c (struct type *expect_type, struct expression *exp,
result = allocate_value (type);
else
result = value_cstring ("", 0, type);
- do_cleanups (cleanup);
return result;
}
@@ -705,7 +699,6 @@ evaluate_subexp_c (struct type *expect_type, struct expression *exp,
obstack_object_size (&output),
type);
}
- do_cleanups (cleanup);
return result;
}
break;
@@ -901,7 +894,7 @@ static const char *c_extensions[] =
".c", NULL
};
-const struct language_defn c_language_defn =
+extern const struct language_defn c_language_defn =
{
"c", /* Language name */
"C",
@@ -935,7 +928,7 @@ const struct language_defn c_language_defn =
1, /* c-style arrays */
0, /* String lower bound */
default_word_break_characters,
- default_make_symbol_completion_list,
+ default_collect_symbol_completion_matches,
c_language_arch_info,
default_print_array_index,
default_pass_by_reference,
@@ -1046,7 +1039,7 @@ static const char *cplus_extensions[] =
".C", ".cc", ".cp", ".cpp", ".cxx", ".c++", NULL
};
-const struct language_defn cplus_language_defn =
+extern const struct language_defn cplus_language_defn =
{
"c++", /* Language name */
"C++",
@@ -1080,7 +1073,7 @@ const struct language_defn cplus_language_defn =
1, /* c-style arrays */
0, /* String lower bound */
default_word_break_characters,
- default_make_symbol_completion_list,
+ default_collect_symbol_completion_matches,
cplus_language_arch_info,
default_print_array_index,
cp_pass_by_reference,
@@ -1100,7 +1093,7 @@ static const char *asm_extensions[] =
".s", ".sx", ".S", NULL
};
-const struct language_defn asm_language_defn =
+extern const struct language_defn asm_language_defn =
{
"asm", /* Language name */
"assembly",
@@ -1134,7 +1127,7 @@ const struct language_defn asm_language_defn =
1, /* c-style arrays */
0, /* String lower bound */
default_word_break_characters,
- default_make_symbol_completion_list,
+ default_collect_symbol_completion_matches,
c_language_arch_info, /* FIXME: la_language_arch_info. */
default_print_array_index,
default_pass_by_reference,
@@ -1154,7 +1147,7 @@ const struct language_defn asm_language_defn =
to do some simple operations when debugging applications that use
a language currently not supported by GDB. */
-const struct language_defn minimal_language_defn =
+extern const struct language_defn minimal_language_defn =
{
"minimal", /* Language name */
"Minimal",
@@ -1188,7 +1181,7 @@ const struct language_defn minimal_language_defn =
1, /* c-style arrays */
0, /* String lower bound */
default_word_break_characters,
- default_make_symbol_completion_list,
+ default_collect_symbol_completion_matches,
c_language_arch_info,
default_print_array_index,
default_pass_by_reference,
@@ -1202,12 +1195,3 @@ const struct language_defn minimal_language_defn =
NULL,
LANG_MAGIC
};
-
-void
-_initialize_c_language (void)
-{
- add_language (&c_language_defn);
- add_language (&cplus_language_defn);
- add_language (&asm_language_defn);
- add_language (&minimal_language_defn);
-}