This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: patch for PR gdb/574
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Thu, 15 Aug 2002 23:26:49 -0400
- Subject: Re: patch for PR gdb/574
- References: <15676.21042.125481.349851@jackfruit.Stanford.EDU>
On Mon, Jul 22, 2002 at 11:42:58AM -0700, david carlton wrote:
> For various reasons, I decided to delve into GDB recently, so I picked
> bug 574 somewhat at random and decided to try to fix it. Here's a
> patch.
>
> The problem: GDB tries to access an improper memory location while
> trying to find run time type info on certain code compiled with G++
> 2.something. In the situation in question, GDB is trying to find the
> vptr of an object that is a subclass of a class with virtual functions
> and static member data. It looks for the information about the vptr
> at a place where information about the static member data is actually
> stored. This is a data structure with a useless (and very large)
> bitpos field; adding this bitpos to a pointer causes that pointer to
> point to the middle of nowhere. Oops.
>
> The solution: Get rid of the check for
>
> if (VALUE_ENCLOSING_TYPE(v) != VALUE_TYPE(v))
>
> and the surrounding code in gnu-v2-abi.c(gnuv2_value_rtti_type).
> 2002-07-22 david carlton <carlton@math.stanford.edu>
>
> * gnu-v2-abi.c (gnuv2_value_rtti_type): Eliminate test for being
> enclosed. Fix PR gdb/574.
This patch is approved. When your FSF papers have been processed, I
would like to see you get write-after-approval access and commit it
yourself; Andrew, does this count as "one good patch"?
Also, I'd appreciate it if you would submit a testsuite patch to run the
reduced testcase you wrote. More tests are always good.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer