This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 12/13] Determine the kind of single step breakpoint


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]