This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 2/4] Support up to 3 conditional branches in an atomic sequence
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: Anton Blanchard <anton at samba dot org>, gdb-patches at sourceware dot org, emachado at linux dot vnet dot ibm dot com, luis_gustavo at mentor dot com, ulrich dot weigand at de dot ibm dot com
- Date: Fri, 28 Mar 2014 10:32:51 -0700
- Subject: Re: [PATCH 2/4] Support up to 3 conditional branches in an atomic sequence
- Authentication-results: sourceware.org; auth=none
- References: <1395978111-30706-1-git-send-email-anton at samba dot org> <1395978111-30706-2-git-send-email-anton at samba dot org> <20140328131230 dot GE4030 at adacore dot com> <5335AD94 dot 4030701 at redhat dot com>
> > IIUC, it looks like MAX_SINGLE_STEP_BREAKPOINTS is actually not
> > the max, but MAX - 1. I was a little confused by that. Why not
> > change MAX to 3, and then adjust the array definition and code
> > accordingly? I think things will be slightly simpler to understand.
>
> IMO that would be more confusing. I read MAX_SINGLE_STEP_BREAKPOINTS
> as meaning the "maximum number of of single-step breakpoints we
> can create simultaneously". I think you're reading it as
> "the highest index possible into the single-step breakpoints
> array" ?
Here is how I read the patch: MAX_SINGLE_STEP_BREAKPOINTS is the size
of the array, and we rely on the last element always being NULL
to determine the number of "live" elements we actually have.
Hence, to me, the maximum number of SS breakpoints we can handle
in practice is not MAX_SINGLE_STEP_BREAKPOINTS but 1 less. For
instance, I think the patch is trying to increase the number of
SS breakpoints to 3, and yet defines MAX_SINGLE_STEP_BREAKPOINTS
to 4.
Perhaps it's time to just use a vec? That way, we don't have
a limit at all anymore...
--
Joel