public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/17416] New: -var-list-children fails with "set print object on" and invalid/NULL value
@ 2014-09-19 21:24 simon.marchi at ericsson dot com
  2014-09-19 21:25 ` [Bug gdb/17416] " simon.marchi at ericsson dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: simon.marchi at ericsson dot com @ 2014-09-19 21:24 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 17416
           Summary: -var-list-children fails with "set print object on"
                    and invalid/NULL value
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: simon.marchi at ericsson dot com

Created attachment 7796
  --> https://sourceware.org/bugzilla/attachment.cgi?id=7796&action=edit
Test program

When

- "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.

-var-list-children returns an error. GDB tries to dereference the top-level
pointer to get the value of the child one, in order to go determine the real
type of the pointed object using RTTI. In the process, value_ind in
value_rtti_indirect_type throws an error that is never caught.

What happens then is that the variable object for the child is half-created. If
the top-level pointer is set to a sensible value and we try to do
-var-list-children again, we get a "Duplicate variable object name" error.

The attached test case shows the problem.

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-05-03 14:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-19 21:24 [Bug gdb/17416] New: -var-list-children fails with "set print object on" and invalid/NULL value 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
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

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).