This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gdb.cp/userdef.exp, class reprensentation


Hi all
In gdb.cp/userdef.cc, you have the following class:

class Member
{
public:
 int z;
};


Which is semantically equivalent to the following and also printed like that using ptype.


struct Member {
   int z;
}


But the userdef.exp testsuite only expects gdb to return the 2nd semantic, which is fine with some gdb based debuggers, but not for all.
Here is a patch that allows both syntax.


Waiting for your feedback,
--
Denis

2008-10-13 Denis Pilat <denis.pilat@st.com>

* gdb.cp/userdef.exp: add a successful patern for for "ptype &*c".

Index: gdb.cp/userdef.exp
===================================================================
--- gdb.cp/userdef.exp  (revision 710)
+++ gdb.cp/userdef.exp  (working copy)
@@ -153,7 +153,14 @@
gdb_test "print c" "\\\$\[0-9\]* = {m = {z = .*}}"
gdb_test "print *c" "\\\$\[0-9\]* = \\(Member &\\) @$hex: {z = .*}"
gdb_test "print &*c" "\\\$\[0-9\]* = \\(Member \\*\\) $hex"
-gdb_test "ptype &*c" "type = struct Member {\[\r\n \]+int z;\[\r\n\]+} &\\*"
+gdb_test_multiple "ptype &*c" "ptype &*c" {
+    -re "type = struct Member {\[\r\n \]+int z;\[\r\n\]+} &\\*.*$gdb_prompt $" {
+        pass "ptype &*c"
+    }
+    -re "type = class Member {\[\r\n \]+ public:\[\r\n \]+int z;\[\r\n\]+} &\\*.*$gdb_prompt $" {
+        pass "ptype &*c"
+    }
+}







Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]