From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32633 invoked by alias); 28 Nov 2011 17:14:03 -0000 Received: (qmail 32606 invoked by uid 22791); 28 Nov 2011 17:14:02 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_XG X-Spam-Check-By: sourceware.org Received: from localhost (HELO sourceware.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 28 Nov 2011 17:13:48 +0000 From: "xgsa at yandex dot ru" To: gdb-prs@sourceware.org Subject: [Bug mi/13393] There is no way to access runtime type of C++ variable via MI (using RTTI) Date: Mon, 28 Nov 2011 17:14:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: mi X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: xgsa at yandex dot ru X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Attachment #6047 is obsolete Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org X-SW-Source: 2011-q4/txt/msg00410.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=13393 Anton changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #6047|0 |1 is obsolete| | --- Comment #12 from Anton 2011-11-28 17:13:45 UTC --- Created attachment 6076 --> http://sourceware.org/bugzilla/attachment.cgi?id=6076 Proposed fixture (see details in comment) Ok, finally I have researched this problem more carefully and I am ready to propose a new patch. However there are a few notes that I want to share: - currently gdb loses cv-qualifiers after RTTI type access. The simplest way to check it - make a print command on any "const Base*" value. It will be "Derived*" if "set print object" is on (by the way, Qt Creator loses it too). This patch fixes this problem for gdb MI&CLI (and maybe for Qt Creator too - a didn't check it) - whatis command does not work for C++ references. It prints an error instead of reference type. The proposed patch fixes this problem for gdb MI&CLI too (by the way, Qt Creator does not show a real type for references too, but I think this patch will not help it). - indirect pointers (I mean pointer to pointer or reference to pointer and so on) do not have a real type in whatis/print commands. The proposed patch does not fix this problem because there is another problem in gdb which does not allow to cast pointer to reference to pointer ("T*" => "T*&"). If it will be fixed it is quite easy to provide support of indirect references too (a few changes in value_rtti_target_type() should be enough). - the last unresolved problem is type update when value changed. I am not sure about how it should be done. Should we just set "type_changed" & "new_type" properties in the result of -var-update command? If so I think not all frontends will support it (at least Eclipse will not - I have checked it). Or maybe we should create dynamic varobj some how? Can somebody advice me something about it? -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.