This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Expand bitpos to LONGEST to allow access to large offsets within a struct
- From: Siddhesh Poyarekar <siddhesh at redhat dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: gdb-patches at sourceware dot org, Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Date: Wed, 22 Feb 2012 09:35:30 +0530
- Subject: Re: [PATCH] Expand bitpos to LONGEST to allow access to large offsets within a struct
- References: <20120220132724.GB4753@spoyarek.pnq.redhat.com> <87d397syts.fsf@fleche.redhat.com>
On Tue, Feb 21, 2012 at 01:42:23PM -0700, Tom Tromey wrote:
> I think this should fix http://sourceware.org/bugzilla/show_bug.cgi?id=7259.
> If so, at the top of the ChangeLog, write 'PR symtab/7259:'.
>
> If it does fix this PR then this suggests a simple test case that
> doesn't require a huge allocation.
Yes, it does. I'll update the ChangeLog entry.
>
> Most of the patch seems perfectly fine -- just the logical consequence
> of the core change. However there are a few issues, mostly minor.
>
Thanks for your feedback. I'll work on these and send an updated
patch.
On Tue, Feb 21, 2012 at 10:02:35PM +0100, Jan Kratochvil wrote:
> On top of Tom's comments - have you verified you caught all the cases?
> In these cases I use some
> typedef struct { LONGEST x; } LONGESTT;
>
> which is compatible for assignment only with itself catching all the cases.
> Unfortunately one needs to adjust by hand all the arithmetic operations just
> for the purpose of this verification.
>
> I guess there exist better static analysis tools for that.
>
I relied mostly on manual code inspection for this and for gcc to tell
me if something is getting truncated. I'll look for a more formal
method to make sure I have caught all cases.
Thanks,
Siddhesh