This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2] Catch exception in value_rtti_indirect_type
- From: Simon Marchi <simon dot marchi at ericsson dot com>
- To: Pedro Alves <palves at redhat dot com>, <gdb-patches at sourceware dot org>
- Cc: <simon dot marchi at polymtl dot ca>
- Date: Fri, 23 Jan 2015 11:00:53 -0500
- Subject: Re: [PATCH v2] Catch exception in value_rtti_indirect_type
- Authentication-results: sourceware.org; auth=none
- References: <1411174953-8930-1-git-send-email-simon dot marchi at ericsson dot com> <54809E38 dot 3080606 at redhat dot com> <54821670 dot 6020006 at ericsson dot com> <54C23FB2 dot 90300 at redhat dot com>
On 15-01-23 07:33 AM, Pedro Alves wrote:
> On 12/05/2014 08:32 PM, Simon Marchi wrote:
>
>> gdb/Changelog:
>>
>> * valops.c (value_rtti_indirect_type): Catch exception thrown by
>> value_ind.
>>
>> gdb/testsuite/ChangeLog
>>
>> * gdb.mi/mi-var-list-children-invalid-grandchild.c: New file.
>> * gdb.mi/mi-var-list-children-invalid-grandchild.exp: New file.
>
> This is OK, thanks.
>
>> +/* This testcase is part of GDB, the GNU debugger.
>> +
>> + Copyright 2014 Free Software Foundation, Inc.
>
> Recall to update this to "2014-2015" before pushing.
>
>> +++ b/gdb/testsuite/gdb.mi/mi-var-list-children-invalid-grandchild.exp
>> @@ -0,0 +1,63 @@
>> +# Copyright 2014 Free Software Foundation, Inc.
>> +
>
> Please update these to "2014-2015" before pushing.
>
> Thanks,
> Pedro Alves
Hmm I am now getting a
/home/emaisin/src/binutils-gdb/gdb/valops.c:3625:13: error: âtargetâ may be used uninitialized in this function [-Werror=maybe-uninitialized]
real_type = value_rtti_type (target, full, top, using_enc);
Logically, target can't be uninitialized there because of the exception throw. I would expect gcc to be
smarter about it, since throw_error is marked as noreturn. I can obviously fix it by assigning it to NULL
at declaration time, but is there a better way of getting rid of the error in these cases?