X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=gdb%2Finfrun.c;h=a9588f896a5f6f489402faf67073a3a44b4639b0;hb=e699d33164a59dcfe7ad4a5154e5c6c811c1f958;hp=2dc418923655dd3fd8a1e3b9f5a86189038bc5d6;hpb=33eca68072e73d984fc139dde45b8140b94757cb;p=external%2Fbinutils.git diff --git a/gdb/infrun.c b/gdb/infrun.c index 2dc4189..a9588f8 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -4115,18 +4115,35 @@ fill_in_stop_func (struct gdbarch *gdbarch, { if (!ecs->stop_func_filled_in) { + const block *block; + /* Don't care about return value; stop_func_start and stop_func_name will both be 0 if it doesn't work. */ - find_function_entry_range_from_pc (ecs->event_thread->suspend.stop_pc, - &ecs->stop_func_name, - &ecs->stop_func_start, - &ecs->stop_func_end); - ecs->stop_func_start - += gdbarch_deprecated_function_start_offset (gdbarch); - - if (gdbarch_skip_entrypoint_p (gdbarch)) - ecs->stop_func_start = gdbarch_skip_entrypoint (gdbarch, - ecs->stop_func_start); + find_pc_partial_function (ecs->event_thread->suspend.stop_pc, + &ecs->stop_func_name, + &ecs->stop_func_start, + &ecs->stop_func_end, + &block); + + /* The call to find_pc_partial_function, above, will set + stop_func_start and stop_func_end to the start and end + of the range containing the stop pc. If this range + contains the entry pc for the block (which is always the + case for contiguous blocks), advance stop_func_start past + the function's start offset and entrypoint. Note that + stop_func_start is NOT advanced when in a range of a + non-contiguous block that does not contain the entry pc. */ + if (block != nullptr + && ecs->stop_func_start <= BLOCK_ENTRY_PC (block) + && BLOCK_ENTRY_PC (block) < ecs->stop_func_end) + { + ecs->stop_func_start + += gdbarch_deprecated_function_start_offset (gdbarch); + + if (gdbarch_skip_entrypoint_p (gdbarch)) + ecs->stop_func_start + = gdbarch_skip_entrypoint (gdbarch, ecs->stop_func_start); + } ecs->stop_func_filled_in = 1; }