Re: [RFA] varobj: call CHECK_TYPEDEF

Keith Seitz
2003-04-24T21:55:01Z

[-- Attachment #1: Type: text/plain, Size: 489 bytes --]

On Thu, 2003-04-24 at 13:35, Andrew Cagney wrote:

> Don't forget a gdb.mi/insight219 testcase.

Doh! How about the attached? (This is the minimal test that I could get
to reproduce it. It must use multiple files. That's why it never showed
up before, apparently.)

Keith

testsuite/gdb.mi/ChangeLog
2003-04-24 Keith Seitz <keiths@redhat.com>

* insight219.exp: New test.
* insight219.cc: New file.
* insight219.h: New file.
* insight219-b.cc: New file.

[-- Attachment #2: insight219-test.patch --]
[-- Type: text/x-patch, Size: 2910 bytes --]

Index: insight219-b.cc
===================================================================
RCS file: insight219-b.cc
diff -N insight219-b.cc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ insight219-b.cc 24 Apr 2003 21:54:00 -0000
@@ -0,0 +1,4 @@
+#include "insight219.h"
+
+B::~B() {}
+
Index: insight219.cc
===================================================================
RCS file: insight219.cc
diff -N insight219.cc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ insight219.cc 24 Apr 2003 21:54:00 -0000
@@ -0,0 +1,8 @@
+#include "insight219.h"
+
+int
+main(int argc, char *argv[])
+{
+ B *b = new B();
+ return 0;
+};
Index: insight219.exp
===================================================================
RCS file: insight219.exp
diff -N insight219.exp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ insight219.exp 24 Apr 2003 21:54:00 -0000
@@ -0,0 +1,61 @@
+# Copyright 2003 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+#
+# test insight/792
+#
+
+if { [skip_cplus_tests] } { continue }
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile insight219
+set srcfiles [list insight219.cc insight219-b.cc]
+set binfile $objdir/$subdir/$testfile
+
+if [get_compiler_info ${binfile} "c++"] {
+ return -1;
+}
+
+set srcs ""
+foreach srcfile $srcfiles {
+ set srcs "$srcs $srcdir/$subdir/$srcfile"
+}
+
+if {[gdb_compile $srcs $binfile executable {debug c++}] != ""} {
+ gdb_suppress_entire_file "Testcase compile failed, so all test in this file will automatically fail."
+}
+
+# Test that children of classes are properly reported
+
+# Run to main
+mi_run_to_main
+
+mi_gdb_test "-var-create - * b" \
+ "(&\".*\"\r\n)*\\^done,name=\"var1\",numchild=\"1\",type=\"class B \\\*\"" \
+ "create var for class B"
+
+mi_gdb_exit
+return 0
Index: insight219.h
===================================================================
RCS file: insight219.h
diff -N insight219.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ insight219.h 24 Apr 2003 21:54:00 -0000
@@ -0,0 +1,8 @@
+class B
+{
+public:
+ virtual ~B();
+
+private:
+ int b;
+};