This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA v2 05/17] Change increment_reading_symtab to return a scoped_restore
- From: Pedro Alves <palves at redhat dot com>
- To: Tom Tromey <tom at tromey dot com>, gdb-patches at sourceware dot org
- Date: Wed, 12 Apr 2017 12:16:17 +0100
- Subject: Re: [RFA v2 05/17] Change increment_reading_symtab to return a scoped_restore
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=palves at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 7832AC05490A
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 7832AC05490A
- References: <20170411150112.23207-1-tom@tromey.com> <20170411150112.23207-6-tom@tromey.com>
On 04/11/2017 04:01 PM, Tom Tromey wrote:
> -struct cleanup *
> +scoped_restore_tmpl<int>
> increment_reading_symtab (void)
> {
> - ++currently_reading_symtab;
> + return make_scoped_restore (¤tly_reading_symtab,
> + currently_reading_symtab + 1);
> gdb_assert (currently_reading_symtab > 0);
> - return make_cleanup (decrement_reading_symtab, NULL);
> }
I noticed that this makes the gdb_assert unreachable.
Thanks,
Pedro Alves