aboutsummaryrefslogtreecommitdiff
path: root/gdb/language.c
diff options
context:
space:
mode:
authorAdam Fedor <fedor@gnu.org>2003-03-26 03:39:44 +0000
committerAdam Fedor <fedor@gnu.org>2003-03-26 03:39:44 +0000
commitf636b87d5a32b8962b7dce92b2d289b6c314bad8 (patch)
tree1c43c3f4e734ed132d7896acf57a0ec0240ccbdd /gdb/language.c
parent05e6bb2fc936e70269f11767fd0112518cd4ef96 (diff)
downloadgdb-f636b87d5a32b8962b7dce92b2d289b6c314bad8.zip
gdb-f636b87d5a32b8962b7dce92b2d289b6c314bad8.tar.gz
gdb-f636b87d5a32b8962b7dce92b2d289b6c314bad8.tar.bz2
* Makefile.in (infrun.o): Add $(language_h)
* infrun.c (handle_inferior_event): Use skip_language_trampoline for language specific trampolines. * language.h (struct language_defn): Add skip_trampoline. (skip_language_trampoline): Declare. * language.c (unk_lang_trampoline, skip_language_trampoline): New functions. (unknown_language_defn, auto_language_defn, local_language_defn): Add ukn_lang_trampoline. * ada-lang.c (ada_language_defn): Add NULL for language specific skip_trampoline. * c-lang.c, f-lang.c, jv-lang.c, m2-lang.c, p-lang.c, scm-lang.c: Likewise. * objc-lang.c (objc_skip_trampoline): New function. (objc_language_defn): Add objc_skip_trampoline.
Diffstat (limited to 'gdb/language.c')
-rw-r--r--gdb/language.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/gdb/language.c b/gdb/language.c
index 258152c..2b71d1f 100644
--- a/gdb/language.c
+++ b/gdb/language.c
@@ -100,6 +100,8 @@ static int unk_lang_val_print (struct type *, char *, int, CORE_ADDR,
static int unk_lang_value_print (struct value *, struct ui_file *, int, enum val_prettyprint);
+static CORE_ADDR unk_lang_trampoline (CORE_ADDR pc);
+
/* Forward declaration */
extern const struct language_defn unknown_language_defn;
@@ -1337,6 +1339,29 @@ add_language (const struct language_defn *lang)
languages[languages_size++] = lang;
}
+/* Iterate through all registered languages looking for and calling
+ any non-NULL struct language_defn.skip_trampoline() functions.
+ Return the result from the first that returns non-zero, or 0 if all
+ `fail'. */
+CORE_ADDR
+skip_language_trampoline (CORE_ADDR pc)
+{
+ int i;
+
+ for (i = 0; i < languages_size; i++)
+ {
+ if (languages[i]->skip_trampoline)
+ {
+ CORE_ADDR real_pc = (languages[i]->skip_trampoline) (pc);
+ if (real_pc)
+ return real_pc;
+ }
+ }
+
+ return 0;
+}
+
+
/* Define the language that is no language. */
static int
@@ -1398,6 +1423,11 @@ unk_lang_value_print (struct value *val, struct ui_file *stream, int format,
error ("internal error - unimplemented function unk_lang_value_print called.");
}
+static CORE_ADDR unk_lang_trampoline (CORE_ADDR pc)
+{
+ return 0;
+}
+
static struct type **const (unknown_builtin_types[]) =
{
0
@@ -1425,6 +1455,7 @@ const struct language_defn unknown_language_defn =
unk_lang_print_type, /* Print a type using appropriate syntax */
unk_lang_val_print, /* Print a value using appropriate syntax */
unk_lang_value_print, /* Print a top-level value */
+ unk_lang_trampoline, /* Language specific skip_trampoline */
{"", "", "", ""}, /* Binary format info */
{"0%lo", "0", "o", ""}, /* Octal format info */
{"%ld", "", "d", ""}, /* Decimal format info */
@@ -1455,6 +1486,7 @@ const struct language_defn auto_language_defn =
unk_lang_print_type, /* Print a type using appropriate syntax */
unk_lang_val_print, /* Print a value using appropriate syntax */
unk_lang_value_print, /* Print a top-level value */
+ unk_lang_trampoline, /* Language specific skip_trampoline */
{"", "", "", ""}, /* Binary format info */
{"0%lo", "0", "o", ""}, /* Octal format info */
{"%ld", "", "d", ""}, /* Decimal format info */
@@ -1484,6 +1516,7 @@ const struct language_defn local_language_defn =
unk_lang_print_type, /* Print a type using appropriate syntax */
unk_lang_val_print, /* Print a value using appropriate syntax */
unk_lang_value_print, /* Print a top-level value */
+ unk_lang_trampoline, /* Language specific skip_trampoline */
{"", "", "", ""}, /* Binary format info */
{"0%lo", "0", "o", ""}, /* Octal format info */
{"%ld", "", "d", ""}, /* Decimal format info */