summaryrefslogtreecommitdiff
path: root/gdb/language.c
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2004-07-06 19:29:31 +0000
committerJeff Johnston <jjohnstn@redhat.com>2004-07-06 19:29:31 +0000
commit240149d17ab391c871cda431556a6cd700fc80a7 (patch)
tree7743f2c3ae562ad1a5783c9058202f4d0ee1b024 /gdb/language.c
parent078110c18bf0f784e41b25ffa970b2493ec03a09 (diff)
downloadgdb-240149d17ab391c871cda431556a6cd700fc80a7.tar.gz
2004-07-06 Jeff Johnston <jjohnstn@redhat.com>
* language.h (struct_language_defn): Add new function pointer: la_class_name_from_physname. Also add new prototype for language_class_name_from_physname. * language.c (language_class_name_from_physname): New function. (unk_lang_class_name): Ditto. (unknown_language_defn, auto_language_defn): Change to add unk_lang_class_name function pointer for la_class_name_from_physname. (local_language_defn): Ditto. * dwarf2read.c (guess_structure_name): Change to call language_class_name_from_physname. (determine_class_name): Ditto. * cp-support.c (class_name_from_physname): Renamed. (cp_class_name_from_physname): New name of function. * cp-support.h: Ditto. * c-lang.c (c_language_defn): Change to add NULL for class_name_from_physname function pointer. (cplus_language_defn): Change to add cp_class_name_from_physname. * jv-lang.c (java_class_name_physname): New function. (java_find_last_component): New static routine. (java_language_defn): Add java_class_name_from_physname pointer. * ada-lang.c (ada_language_defn): Change to add NULL for class_name_from_physname function pointer. * f-lang.c (f_language_defn): Ditto. * m2-lang.c (m2_language_defn): Ditto. * objc-lang.c (objc_language_defn): Ditto. * p-lang.c (pascal_language_defn): Ditto. * scm-lang.c (scm_language_defn): Ditto.
Diffstat (limited to 'gdb/language.c')
-rw-r--r--gdb/language.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gdb/language.c b/gdb/language.c
index b4d38ea364a..dae3e809a4b 100644
--- a/gdb/language.c
+++ b/gdb/language.c
@@ -1176,6 +1176,16 @@ language_demangle (const struct language_defn *current_language,
return NULL;
}
+/* Return class name from physname or NULL. */
+char *
+language_class_name_from_physname (const struct language_defn *current_language,
+ const char *physname)
+{
+ if (current_language != NULL && current_language->la_class_name_from_physname)
+ return current_language->la_class_name_from_physname (physname);
+ return NULL;
+}
+
/* Return the default string containing the list of characters
delimiting words. This is a reasonable default value that
most languages should be able to use. */
@@ -1258,6 +1268,10 @@ static char *unk_lang_demangle (const char *mangled, int options)
return cplus_demangle (mangled, options);
}
+static char *unk_lang_class_name (const char *mangled)
+{
+ return NULL;
+}
static struct type **const (unknown_builtin_types[]) =
{
@@ -1292,6 +1306,7 @@ const struct language_defn unknown_language_defn =
basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
basic_lookup_transparent_type,/* lookup_transparent_type */
unk_lang_demangle, /* Language specific symbol demangler */
+ unk_lang_class_name, /* Language specific class_name_from_physname */
{"", "", "", ""}, /* Binary format info */
{"0%lo", "0", "o", ""}, /* Octal format info */
{"%ld", "", "d", ""}, /* Decimal format info */
@@ -1329,6 +1344,7 @@ const struct language_defn auto_language_defn =
basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
basic_lookup_transparent_type,/* lookup_transparent_type */
unk_lang_demangle, /* Language specific symbol demangler */
+ unk_lang_class_name, /* Language specific class_name_from_physname */
{"", "", "", ""}, /* Binary format info */
{"0%lo", "0", "o", ""}, /* Octal format info */
{"%ld", "", "d", ""}, /* Decimal format info */
@@ -1365,6 +1381,7 @@ const struct language_defn local_language_defn =
basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
basic_lookup_transparent_type,/* lookup_transparent_type */
unk_lang_demangle, /* Language specific symbol demangler */
+ unk_lang_class_name, /* Language specific class_name_from_physname */
{"", "", "", ""}, /* Binary format info */
{"0%lo", "0", "o", ""}, /* Octal format info */
{"%ld", "", "d", ""}, /* Decimal format info */