public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug gdb/17416] -var-list-children fails with "set print object on" and invalid/NULL value
Date: Fri, 23 Jan 2015 18:01:00 -0000	[thread overview]
Message-ID: <bug-17416-4717-7isXk1YqLz@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-17416-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=17416

--- Comment #2 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Simon Marchi <simark@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=f7e5394d614db4456fc0d9598bbfa936cc7941af

commit f7e5394d614db4456fc0d9598bbfa936cc7941af
Author: Simon Marchi <simon.marchi@ericsson.com>
Date:   Fri Jan 23 12:59:24 2015 -0500

    Catch exception in value_rtti_indirect_type

    In the situation described in bug 17416 [1]:

      * "set print object" is on;
      * The variable object is a pointer to a struct, and it contains an
        invalid value (e.g. NULL, or random uninitialized value);
      * The variable object (struct) has a child which is also a pointer to a
        struct;
      * We try to use "-var-list-children".

    ... an exception thrown in value_ind can propagate too far and leave an
    half-built variable object, leading to a wrong state. This patch adds a
    TRY_CATCH to catch it and makes value_rtti_indirect_type return NULL in
    that case, meaning that the type of the pointed object could not be
    found.

    A test for the fix is also added.

    New in v2:

      * Added test.
      * Restructured "catch" code.
      * Added details about the bug in commit log.

    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.

    [1] https://sourceware.org/bugzilla/show_bug.cgi?id=17416

-- 
You are receiving this mail because:
You are on the CC list for the bug.


  parent reply	other threads:[~2015-01-23 18:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-19 21:24 [Bug gdb/17416] New: " simon.marchi at ericsson dot com
2014-09-19 21:25 ` [Bug gdb/17416] " simon.marchi at ericsson dot com
2015-01-23 18:01 ` cvs-commit at gcc dot gnu.org [this message]
2015-01-23 18:08 ` simon.marchi at ericsson dot com
2015-05-02 13:32 ` malaperle at gmail dot com
2015-05-03  3:18 ` simon.marchi at polymtl dot ca
2015-05-03 14:44 ` malaperle at gmail dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-17416-4717-7isXk1YqLz@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).