[RFA] Patch for PR gdb/2477

Paul Pluzhnikov ppluzhnikov@google.com
Mon Jul 14 18:12:00 GMT 2008


On Mon, Jul 14, 2008 at 10:42 AM, Daniel Jacobowitz <drow@false.org> wrote:

> There's nothing special about zero.  It's just an unreadable memory
> address; the same problem will reappear with any other invalid
> pointer.

There is something special about zero -- it very frequently occurs
in correct C++ programs :)

> So if we use TRY_CATCH and RETURN_MASK_ERROR around the call to
> current_cp_abi.rtti_type, we can return NULL in the error case.

Done.

I've also added a "non-zero but invalid" pointer test at ~0UL.
Is there a "canonical" invalid address I should be testing instead?

Thanks,
-- 
Paul Pluzhnikov

ChangeLog
2008-07-14  Paul Pluzhnikov  <ppluzhnikov@google.com>

       PR gdb/2477
       * cp-abi.c (value_virtual_fn_field): Handle invalid pointers.

testsuite/ChangeLog
2008-07-14  Paul Pluzhnikov  <ppluzhnikov@google.com>

       * gdb.cp/class2.exp, gdb.cp/class2.cc: Test for PR2477.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: gdb-patch-2477-20080714-2.txt
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20080714/ce5f363e/attachment.txt>


More information about the Gdb-patches mailing list