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] btrace, gdbserver: check btrace target pointers


On Wed, Feb 28, 2018 at 5:10 PM, Metzger, Markus T
<markus.t.metzger@intel.com> wrote:
>
> I moved two of those checks into the target_* method since I thought
> it would be a good idea to be able to handle exceptions and since I had
> to add the TRY/CATCH/CATCH_END, anyway, I thought it made sense
> to handle the nullptr case also via exceptions.
>
> If we're not doing it that way, the caller would need to check the pointer
> (either directly or via a *_p () function like we do with gdbarch) and still
> be prepared to handle exceptions from the actual call.
>
> My motivation was to simplify the caller but if you think the other way
> is clearer I can move the check back into the callers.  Is that your preference?
>

I don't have a strong opinion on this.  It is more about personal flavour of
writing code.  You are the major btrace contributor, so it is better to keep
the code in a way you prefer.  Patch is good to me, please push.

-- 
Yao (齐尧)


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