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] Fix length calculation in aarch64_linux_set_debug_regs


On 11/02/2015 05:09 PM, Simon Marchi wrote:
> I looked a bit more into the issue and did some testing, and it appears the
> current code is correct (as Yao mentioned).  It's probably not as clear as it
> could be though.  I think it would be nicer if expressed as
> 
>   (size of fixed part) + (size of variable part)

Looking a bit more at the code in question, I agree.

> On 15-11-02 11:00 AM, Pedro Alves wrote:
>> IIUYC, you're pointing out two issues:
>> #1 - the offsetof that doesn't work in C++.
> 
> This actually appears to be a bug in g++.
> 
> See this, especially towards the end: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=14932
> 
> The expression is accepted by gcc and clang++, but not g++ (test with 4.8 and 5.2).

OK.  Still not sure whether it's a bug or not.  It may still be invalid C++ that
happens to be accepted by clang++.


>> I think it's a little nicer to hide away the offsetof+sizeof.
> 
> You mean hide in in a function?  This expression is only used at one place and I think it's
> reasonably straightforward if expressed correctly, but if you think it will make the code
> clearer I don't mind.

You convinced me.  This is not really the same as the x86 case, where
we wanted the offset of a register field.

Thanks,
Pedro Alves


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