From 50e65b1713256487d50514b50b38b3fd1080b93e Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 19 Aug 2013 07:58:44 -0600 Subject: introduce minimal_symbol_upper_bound This introduces minimal_symbol_upper_bound and changes various bits of code to use it. Since this function is intimately tied to the implementation of minimal symbol tables, I believe it belongs in minsyms.c. The new function is extracted from find_pc_partial_function_gnu_ifunc. This isn't a "clean" move because the old function interleaved the caching and the computation; but this doesn't make sense for the new code. 2014-02-26 Tom Tromey * blockframe.c (find_pc_partial_function_gnu_ifunc): Use bound minimal symbols. Move code that knows about minsym table layout... * minsyms.c (minimal_symbol_upper_bound): ... here. New function. * minsyms.h (minimal_symbol_upper_bound): Declare. * objc-lang.c (find_objc_msgsend): Use bound minimal symbols, minimal_symbol_upper_bound. --- gdb/objc-lang.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'gdb/objc-lang.c') diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c index d79f361..8717947 100644 --- a/gdb/objc-lang.c +++ b/gdb/objc-lang.c @@ -1260,25 +1260,23 @@ find_objc_msgsend (void) for (i = 0; i < nmethcalls; i++) { - struct minimal_symbol *func; + struct bound_minimal_symbol func; /* Try both with and without underscore. */ - func = lookup_minimal_symbol (methcalls[i].name, NULL, NULL); - if ((func == NULL) && (methcalls[i].name[0] == '_')) + func = lookup_bound_minimal_symbol (methcalls[i].name); + if ((func.minsym == NULL) && (methcalls[i].name[0] == '_')) { - func = lookup_minimal_symbol (methcalls[i].name + 1, NULL, NULL); + func = lookup_bound_minimal_symbol (methcalls[i].name + 1); } - if (func == NULL) + if (func.minsym == NULL) { methcalls[i].begin = 0; methcalls[i].end = 0; continue; } - methcalls[i].begin = SYMBOL_VALUE_ADDRESS (func); - do { - methcalls[i].end = SYMBOL_VALUE_ADDRESS (++func); - } while (methcalls[i].begin == methcalls[i].end); + methcalls[i].begin = SYMBOL_VALUE_ADDRESS (func.minsym); + methcalls[i].end = minimal_symbol_upper_bound (func); } } -- cgit v1.1