This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 12/13] Determine the kind of single step breakpoint
- From: Pedro Alves <palves at redhat dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>, gdb-patches at sourceware dot org
- Date: Thu, 27 Oct 2016 15:55:47 +0100
- Subject: Re: [PATCH 12/13] Determine the kind of single step breakpoint
- Authentication-results: sourceware.org; auth=none
- References: <1472655965-12212-1-git-send-email-yao.qi@linaro.org> <1472655965-12212-13-git-send-email-yao.qi@linaro.org>
On 08/31/2016 04:06 PM, Yao Qi wrote:
> --- a/gdb/breakpoint.c
> +++ b/gdb/breakpoint.c
> @@ -2607,7 +2607,18 @@ build_target_command_list (struct bp_location *bl)
> static int
> breakpoint_kind (struct bp_location *bl, CORE_ADDR *addr)
> {
> - return gdbarch_breakpoint_kind_from_pc (bl->gdbarch, addr);
> + if (bl->owner->type == bp_single_step)
> + {
> + struct thread_info *thr = find_thread_global_id (bl->owner->thread);
> + struct regcache *regcache;
> +
> + regcache = get_thread_regcache (thr->ptid);
> +
> + return gdbarch_breakpoint_kind_from_current_state (bl->gdbarch,
> + regcache, addr);
> + }
> + else
> + return gdbarch_breakpoint_kind_from_pc (bl->gdbarch, addr);
> }
This deserves a function intro comment update, I think.
Thanks,
Pedro Alves