+2020-06-02 Andrew Burgess <andrew.burgess@embecosm.com>
+
+ * ada-lang.c (ada_language_data): Delete skip_trampoline
+ initializer.
+ * c-lang.c (c_language_data): Likewise.
+ (cplus_language_data): Likewise.
+ (cplus_language::skip_trampoline): New member function.
+ (asm_language_data): Delete skip_trampoline initializer.
+ (minimal_language_data): Likewise.
+ * d-lang.c (d_language_data): Likewise.
+ * f-lang.c (f_language_data): Likewise.
+ * go-lang.c (go_language_data): Likewise.
+ * language.c (unk_lang_trampoline): Delete function.
+ (skip_language_trampoline): Update.
+ (unknown_language_data): Delete skip_trampoline initializer.
+ (auto_language_data): Likewise.
+ * language.h (language_data): Delete skip_trampoline field.
+ (language_defn::skip_trampoline): New function.
+ * m2-lang.c (m2_language_data): Delete skip_trampoline
+ initializer.
+ * objc-lang.c (objc_skip_trampoline): Delete function, move
+ implementation to objc_language::skip_trampoline.
+ (objc_language_data): Delete skip_trampoline initializer.
+ (objc_language::skip_trampoline): New member function with
+ implementation from objc_skip_trampoline.
+ * opencl-lang.c (opencl_language_data): Delete skip_trampoline
+ initializer.
+ * p-lang.c (pascal_language_data): Likewise.
+ * rust-lang.c (rust_language_data): Likewise.
+
2020-06-02 Andrew Burgess <andrew.burgess@embecosm.com>
* ada-lang.c (ada_language_data): Delete la_demangle initializer.
ada_print_typedef, /* Print a typedef using appropriate syntax */
ada_value_print_inner, /* la_value_print_inner */
ada_value_print, /* Print a top-level value */
- NULL, /* Language specific skip_trampoline */
NULL, /* name_of_this */
true, /* la_store_sym_names_in_linkage_form_p */
ada_lookup_symbol_nonlocal, /* Looking up non-local symbols. */
c_print_typedef, /* Print a typedef using appropriate syntax */
c_value_print_inner, /* la_value_print_inner */
c_value_print, /* Print a top-level value */
- NULL, /* Language specific skip_trampoline */
NULL, /* name_of_this */
true, /* la_store_sym_names_in_linkage_form_p */
basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
c_print_typedef, /* Print a typedef using appropriate syntax */
c_value_print_inner, /* la_value_print_inner */
c_value_print, /* Print a top-level value */
- cplus_skip_trampoline, /* Language specific skip_trampoline */
"this", /* name_of_this */
false, /* la_store_sym_names_in_linkage_form_p */
cp_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
{
c_print_type (type, varstring, stream, show, level, flags);
}
+
+ /* See language.h. */
+
+ CORE_ADDR skip_trampoline (struct frame_info *fi,
+ CORE_ADDR pc) const override
+ {
+ return cplus_skip_trampoline (fi, pc);
+ }
};
/* The single instance of the C++ language class. */
c_print_typedef, /* Print a typedef using appropriate syntax */
c_value_print_inner, /* la_value_print_inner */
c_value_print, /* Print a top-level value */
- NULL, /* Language specific skip_trampoline */
NULL, /* name_of_this */
true, /* la_store_sym_names_in_linkage_form_p */
basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
c_print_typedef, /* Print a typedef using appropriate syntax */
c_value_print_inner, /* la_value_print_inner */
c_value_print, /* Print a top-level value */
- NULL, /* Language specific skip_trampoline */
NULL, /* name_of_this */
true, /* la_store_sym_names_in_linkage_form_p */
basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
syntax. */
d_value_print_inner, /* la_value_print_inner */
c_value_print, /* Print a top-level value. */
- NULL, /* Language specific skip_trampoline. */
"this",
false, /* la_store_sym_names_in_linkage_form_p */
d_lookup_symbol_nonlocal,
f_print_typedef, /* Print a typedef using appropriate syntax */
f_value_print_innner, /* la_value_print_inner */
c_value_print, /* FIXME */
- NULL, /* Language specific skip_trampoline */
NULL, /* name_of_this */
false, /* la_store_sym_names_in_linkage_form_p */
cp_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
syntax. */
go_value_print_inner, /* la_value_print_inner */
c_value_print, /* Print a top-level value. */
- NULL, /* Language specific skip_trampoline. */
NULL, /* name_of_this */
false, /* la_store_sym_names_in_linkage_form_p */
basic_lookup_symbol_nonlocal,
static void unk_lang_value_print (struct value *, struct ui_file *,
const struct value_print_options *);
-static CORE_ADDR unk_lang_trampoline (struct frame_info *, CORE_ADDR pc);
-
/* The current (default at startup) state of type and range checking.
(If the modes are set to "auto", though, these are changed based
on the default language at startup, and then again based on the
{
for (const auto &lang : language_defn::languages)
{
- if (lang->skip_trampoline != NULL)
- {
- CORE_ADDR real_pc = lang->skip_trampoline (frame, pc);
+ CORE_ADDR real_pc = lang->skip_trampoline (frame, pc);
- if (real_pc)
- return real_pc;
- }
+ if (real_pc != 0)
+ return real_pc;
}
return 0;
"function unk_lang_value_print called."));
}
-static CORE_ADDR unk_lang_trampoline (struct frame_info *frame, CORE_ADDR pc)
-{
- return 0;
-}
-
static char *unk_lang_class_name (const char *mangled)
{
return NULL;
default_print_typedef, /* Print a typedef using appropriate syntax */
unk_lang_value_print_inner, /* la_value_print_inner */
unk_lang_value_print, /* Print a top-level value */
- unk_lang_trampoline, /* Language specific skip_trampoline */
"this", /* name_of_this */
true, /* store_sym_names_in_linkage_form_p */
basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
default_print_typedef, /* Print a typedef using appropriate syntax */
unk_lang_value_print_inner, /* la_value_print_inner */
unk_lang_value_print, /* Print a top-level value */
- unk_lang_trampoline, /* Language specific skip_trampoline */
"this", /* name_of_this */
false, /* store_sym_names_in_linkage_form_p */
basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
void (*la_value_print) (struct value *, struct ui_file *,
const struct value_print_options *);
- /* PC is possibly an unknown languages trampoline.
- If that PC falls in a trampoline belonging to this language,
- return the address of the first pc in the real function, or 0
- if it isn't a language tramp for this language. */
- CORE_ADDR (*skip_trampoline) (struct frame_info *, CORE_ADDR);
-
/* Now come some hooks for lookup_symbol. */
/* If this is non-NULL, specifies the name that of the implicit
virtual void print_type (struct type *, const char *, struct ui_file *, int,
int, const struct type_print_options *) const = 0;
+ /* PC is possibly an unknown languages trampoline.
+ If that PC falls in a trampoline belonging to this language, return
+ the address of the first pc in the real function, or 0 if it isn't a
+ language tramp for this language. */
+ virtual CORE_ADDR skip_trampoline (struct frame_info *fi, CORE_ADDR pc) const
+ {
+ return (CORE_ADDR) 0;
+ }
+
/* List of all known languages. */
static const struct language_defn *languages[nr_languages];
};
m2_print_typedef, /* Print a typedef using appropriate syntax */
m2_value_print_inner, /* la_value_print_inner */
c_value_print, /* Print a top-level value */
- NULL, /* Language specific skip_trampoline */
NULL, /* name_of_this */
false, /* la_store_sym_names_in_linkage_form_p */
basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
return NULL; /* Not an objc mangled name. */
}
-/* Determine if we are currently in the Objective-C dispatch function.
- If so, get the address of the method function that the dispatcher
- would call and use that as the function to step into instead. Also
- skip over the trampoline for the function (if any). This is better
- for the user since they are only interested in stepping into the
- method function anyway. */
-static CORE_ADDR
-objc_skip_trampoline (struct frame_info *frame, CORE_ADDR stop_pc)
-{
- struct gdbarch *gdbarch = get_frame_arch (frame);
- CORE_ADDR real_stop_pc;
- CORE_ADDR method_stop_pc;
-
- real_stop_pc = gdbarch_skip_trampoline_code (gdbarch, frame, stop_pc);
-
- if (real_stop_pc != 0)
- find_objc_msgcall (real_stop_pc, &method_stop_pc);
- else
- find_objc_msgcall (stop_pc, &method_stop_pc);
-
- if (method_stop_pc)
- {
- real_stop_pc = gdbarch_skip_trampoline_code
- (gdbarch, frame, method_stop_pc);
- if (real_stop_pc == 0)
- real_stop_pc = method_stop_pc;
- }
-
- return real_stop_pc;
-}
-
/* Table mapping opcodes into strings for printing operators
and precedences of the operators. */
c_print_typedef, /* Print a typedef using appropriate syntax */
c_value_print_inner, /* la_value_print_inner */
c_value_print, /* Print a top-level value */
- objc_skip_trampoline, /* Language specific skip_trampoline */
"self", /* name_of_this */
false, /* la_store_sym_names_in_linkage_form_p */
basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
{
c_print_type (type, varstring, stream, show, level, flags);
}
+
+ /* See language.h. */
+
+ CORE_ADDR skip_trampoline (struct frame_info *frame,
+ CORE_ADDR stop_pc) const override
+ {
+ struct gdbarch *gdbarch = get_frame_arch (frame);
+ CORE_ADDR real_stop_pc;
+ CORE_ADDR method_stop_pc;
+
+ /* Determine if we are currently in the Objective-C dispatch function.
+ If so, get the address of the method function that the dispatcher
+ would call and use that as the function to step into instead. Also
+ skip over the trampoline for the function (if any). This is better
+ for the user since they are only interested in stepping into the
+ method function anyway. */
+
+ real_stop_pc = gdbarch_skip_trampoline_code (gdbarch, frame, stop_pc);
+
+ if (real_stop_pc != 0)
+ find_objc_msgcall (real_stop_pc, &method_stop_pc);
+ else
+ find_objc_msgcall (stop_pc, &method_stop_pc);
+
+ if (method_stop_pc)
+ {
+ real_stop_pc = gdbarch_skip_trampoline_code
+ (gdbarch, frame, method_stop_pc);
+ if (real_stop_pc == 0)
+ real_stop_pc = method_stop_pc;
+ }
+
+ return real_stop_pc;
+ }
};
/* Single instance of the class representing the Objective-C language. */
c_print_typedef, /* Print a typedef using appropriate syntax */
c_value_print_inner, /* la_value_print_inner */
c_value_print, /* Print a top-level value */
- NULL, /* Language specific skip_trampoline */
NULL, /* name_of_this */
false, /* la_store_sym_names_in_linkage_form_p */
basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
pascal_print_typedef, /* Print a typedef using appropriate syntax */
pascal_value_print_inner, /* la_value_print_inner */
pascal_value_print, /* Print a top-level value */
- NULL, /* Language specific skip_trampoline */
"this", /* name_of_this */
false, /* la_store_sym_names_in_linkage_form_p */
basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
rust_print_typedef, /* Print a typedef using appropriate syntax */
rust_value_print_inner, /* la_value_print_inner */
c_value_print, /* Print a top-level value */
- NULL, /* Language specific skip_trampoline */
NULL, /* name_of_this */
false, /* la_store_sym_names_in_linkage_form_p */
rust_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */