aboutsummaryrefslogtreecommitdiff
path: root/gdb/objc-lang.c
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2020-05-14 23:19:48 +0100
committerAndrew Burgess <andrew.burgess@embecosm.com>2020-06-02 13:53:11 +0100
commitf6eee2d098049afd18f90b8f4bb6a5d1a49d900c (patch)
tree50d744e8e9bb6fa77425b8d51e13ae8968b01c7e /gdb/objc-lang.c
parent0a50df5dabfe12c8bf20f4f724622ff38ef7828b (diff)
downloadgdb-f6eee2d098049afd18f90b8f4bb6a5d1a49d900c.zip
gdb-f6eee2d098049afd18f90b8f4bb6a5d1a49d900c.tar.gz
gdb-f6eee2d098049afd18f90b8f4bb6a5d1a49d900c.tar.bz2
gdb: Convert language skip_trampoline field to a method
This commit changes the language_data::skip_trampoline function pointer member variable into a member function of language_defn. There should be no user visible changes after this commit. gdb/ChangeLog: * 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.
Diffstat (limited to 'gdb/objc-lang.c')
-rw-r--r--gdb/objc-lang.c66
1 files changed, 34 insertions, 32 deletions
diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c
index 1e3d1fd..ff028fc 100644
--- a/gdb/objc-lang.c
+++ b/gdb/objc-lang.c
@@ -281,37 +281,6 @@ objc_demangle (const char *mangled, int options)
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. */
@@ -376,7 +345,6 @@ extern const struct language_data objc_language_data =
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 */
@@ -434,6 +402,40 @@ public:
{
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. */