This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [ping 2] [RFA][PATCH v4 0/5] Add TDB regset support
- From: Andreas Arnez <arnez at linux dot vnet dot ibm dot com>
- To: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- Cc: lgustavo at codesourcery dot com, gdb-patches at sourceware dot org
- Date: Tue, 16 Jul 2013 19:06:21 +0200
- Subject: Re: [ping 2] [RFA][PATCH v4 0/5] Add TDB regset support
- References: <201307161602 dot r6GG2up6007938 at d06av02 dot portsmouth dot uk dot ibm dot com>
"Ulrich Weigand" <uweigand@de.ibm.com> writes:
> Your patch below doesn't show the common code changes, so I'm not
> sure how you planned to handle legacy platforms. I guess it might
> be possible to detect them using zero markers in those fields ...
Right, before coming up with a complete patch I wanted to get some
feedback on this general idea. So I guess it's worth giving it a try?
> As an aside, I'm wondering:
>
>> + res = cb (tdep->wordsize == 4 ?
>> + &ppc32_linux_gregset : &ppc64_linux_gregset,
>> + cb_data);
>> + if (!res)
>> + res = cb (&ppc32_linux_fpregset, cb_data);
>> + if (!res && have_altivec)
>> + res = cb (&ppc32_linux_vrregset, cb_data);
>> + if (!res && have_vsx)
>> + cb (&ppc32_linux_vsxregset, cb_data);
>
> Why does the callback need to return a flag that has to be handled
> by the caller? If there is indeed a requirement for treating
> error conditions specially, couldn't the callback store error data
> in the cb_data and handle it on subsequent calls?
This is a good point. Yes, this is for error handling, and yes, the
error indication could be moved to cb_data.
> This would make the gdbarch implementations in the targets yet
> easier and simpler to write, something along the lines of:
>
> if (tdep->wordsize == 4)
> cb (&ppc32_linux_gregset, cb_data);
> else
> cb (&ppc64_linux_gregset, cb_data);
> cb (&ppc32_linux_fpregset, cb_data);
> if (have_altivec)
> cb (&ppc32_linux_vrregset, cb_data);
> if (have_vsx)
> cb (&ppc32_linux_vsxregset, cb_data);
Yup.