1 # Copyright 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004
2 # Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 # Please email any bugs, comments, and/or additions to this file to:
19 # bug-gdb@prep.ai.mit.edu
21 # This file was written by Fred Fish. (fnf@cygnus.com)
22 # And rewritten by Michael Chastain <mec.gnu@mindspring.com>.
24 set wsopt "\[\r\n\t \]*"
32 if { [skip_cplus_tests] } { continue }
34 set testfile "virtfunc"
35 set srcfile ${testfile}.cc
36 set binfile ${objdir}/${subdir}/${testfile}
38 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {c++ debug}] != "" } {
39 gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
42 # Test ptype of a class.
44 # Different C++ compilers produce different output. I build up regular
45 # expressions piece by piece to accommodate all the compilers that I
46 # have seen: gcc 2.95.3, gcc 3.3.2 (ABI 1), gcc 3.4 prerelease (ABI 2);
47 # and all the debug formats I have seen: dwarf-2 and stabs+.
49 # A complicated class declaration looks like this:
51 # class A : public virtual V { // re_class
53 # V * _vb$V; // re_vbptr
56 # public: // re_access_methods
57 # A & operator=(A const &); // re_synth_gcc_2
58 # A(int, A const &); // ...
60 # virtual int f(void); // re_methods
63 # RE_CLASS matches the class declaration. C++ allows multiple ways of
66 # struct ... { private: ... };
67 # class ... { private: ... };
70 # RE_VBPTR matches the virtual base declarations. gcc 2.95.3 sometimes
71 # emits these, but gcc 3.X.Y never emits these. The name depends on the
74 # RE_FIELDS matches the data fields of the class.
75 # RE_METHODS matches the methods explicitly declared for the class.
77 # RE_SYNTH_GCC_2 and RE_SYNTH_GCC_3 match the optional synthetic methods
78 # of the class. gcc -gstabs+ emits these methods, and gcc -gdwarf-2
81 # RE_ACCESS_METHODS is an access specifier after RE_FIELDS and before
82 # the methods (explicit methods and/or synthetic methods).
83 # There is also an RE_ACCESS_FIELDS.
85 # When I get HP-UX aCC, I hope that I can just add RE_SYNTH_ACC_NNN.
87 # Yet another twist: with gcc v2, ctor and dtor methods have a hidden
88 # argument in front, the "in-charge" flag. With gcc v3, there is no
89 # hidden argument; instead, there are multiple object functions for
92 # -- chastain 2004-01-01
94 # compatibility kludges
117 proc test_one_ptype { command testname re_class re_vbptr re_access_fields re_fields re_access_methods re_methods re_synth_gcc_2 re_synth_gcc_3 re_star } {
130 gdb_test_multiple "$command" "$testname" {
131 -re "type = $re_class${wsopt}$re_access_fields${wsopt}$re_fields${wsopt}$re_access_methods${wsopt}$re_methods$nl\}$re_star$nl$gdb_prompt $" {
132 # gcc 2.95.3, dwarf-2, no vbptr
133 # gcc 3.X, abi 1, dwarf-2
134 # gcc 3.X, abi 2, dwarf-2
137 -re "type = $re_class${wsopt}$re_vbptr${wsopt}$re_access_fields${wsopt}$re_fields${wsopt}$re_access_methods${wsopt}$re_methods$nl\}$re_star$nl$gdb_prompt $" {
138 # gcc 2.95.3, dwarf-2, vbptr
139 # TODO: drow says the vbptr is a bug
142 -re "type = $re_class${wsopt}$re_access_fields${wsopt}$re_fields${wsopt}$re_access_methods${wsopt}$re_synth_gcc_2${wsopt}$re_methods$nl\}$re_star$nl$gdb_prompt $" {
143 # gcc 2.95.3, stabs+, no vbptr
146 -re "type = $re_class${wsopt}$re_vbptr${wsopt}$re_access_fields${wsopt}$re_fields${wsopt}$re_access_methods${wsopt}$re_synth_gcc_2${wsopt}$re_methods$nl\}$re_star$nl$gdb_prompt $" {
147 # gcc 2.95.3, stabs+, vbptr
148 # TODO: drow says the vbptr is a bug
151 -re "type = $re_class${wsopt}$re_access_fields${wsopt}$re_fields${wsopt}$re_access_methods${wsopt}$re_synth_gcc_3${wsopt}$re_methods$nl\}$re_star$nl$gdb_prompt $" {
152 # gcc 3.X, abi 1, stabs+
155 -re "type = $re_class${wsopt}$re_access_fields${wsopt}$re_fields${wsopt}$re_access_methods${wsopt}$re_methods${wsopt}$re_synth_gcc_3$nl\}$re_star$nl$gdb_prompt $" {
156 # gcc 3.X, abi 2, stabs+
169 proc test_ptype_of_classes {} {
183 set kk0 " (obsolescent gcc or gdb)"
184 test_one_ptype "ptype VA" "ptype VA" \
185 "((struct|class) VA \{${ws}public:|struct VA \{)" \
189 "VA & operator=\\(VA const ?&\\);${ws}VA\\(VA const ?&\\);${ws}VA\\((void|)\\);" \
190 "VA & operator=\\(VA const ?&\\);${ws}VA\\(VA const ?&\\);${ws}VA\\((void|)\\);" \
195 set kk0 " (obsolescent gcc or gdb)"
196 test_one_ptype "ptype VB" "ptype VB" \
197 "((struct|class) VB \{${ws}public:|struct VB \{)" \
200 "" "int fvb\\((void|)\\);${ws}virtual int vvb\\((void|)\\);" \
201 "VB & operator=\\(VB const ?&\\);${ws}VB\\(VB const ?&\\);${ws}VB\\((void|)\\);" \
202 "VB & operator=\\(VB const ?&\\);${ws}VB\\(VB const ?&\\);${ws}VB\\((void|)\\);" \
207 set kk0 " (obsolescent gcc or gdb)"
208 test_one_ptype "ptype V" "ptype V" \
209 "class V : public VA, public VB \{${ws}public:" \
212 "" "int f\\((void|)\\);${ws}virtual int vv\\((void|)\\);" \
213 "V & operator=\\(V const ?&\\);${ws}V\\(V const ?&\\);${ws}V\\((void|)\\);" \
214 "V & operator=\\(V const ?&\\);${ws}V\\(V const ?&\\);${ws}V\\((void|)\\);" \
220 set kk1 " (obsolescent gcc or gdb)"
221 test_one_ptype "ptype A" "ptype A" \
222 "class A : public virtual V \{(${ws}private:|)" \
223 "V \\*(_vb.1V|_vb.V);" \
225 "public:" "virtual int f\\((void|)\\);" \
226 "A & operator=\\(A const ?&\\);${ws}A\\(int, A const ?&\\);${ws}A\\(int\\);" \
227 "A & operator=\\(A const ?&\\);${ws}A\\(A const ?&\\);${ws}A\\(\\);" \
232 set kk0 " (obsolescent gcc or gdb)"
233 test_one_ptype "ptype B" "ptype B" \
234 "class B : public A \{(${ws}private:|)" \
235 "V \\*(_vb.1V|_vb.V);" \
237 "public:" "virtual int f\\((void|)\\);" \
238 "B & operator=\\(B const ?&\\);${ws}B\\(int, B const ?&\\);${ws}B\\(int\\);" \
239 "B & operator=\\(B const ?&\\);${ws}B\\(B const ?&\\);${ws}B\\(\\);" \
245 set kk1 " (obsolescent gcc or gdb)"
246 test_one_ptype "ptype C" "ptype C" \
247 "class C : public virtual V \{(${ws}private:|)" \
248 "V \\*(_vb.1V|_vb.V);" \
251 "C & operator=\\(C const ?&\\);${ws}C\\(int, C const ?&\\);${ws}C\\(int\\);" \
252 "C & operator=\\(C const ?&\\);${ws}C\\(C const ?&\\);${ws}C\\(\\);" \
257 set kk0 " (obsolescent gcc or gdb)"
258 test_one_ptype "ptype AD" "ptype AD" \
259 "((struct|class) AD \{${ws}public:|struct AD \{)" \
262 "" "virtual int vg\\((void|)\\);" \
263 "AD & operator=\\(AD const ?&\\);${ws}AD\\(AD const ?&\\);${ws}AD\\((void|)\\);" \
264 "AD & operator=\\(AD const ?&\\);${ws}AD\\(AD const ?&\\);${ws}AD\\((void|)\\);" \
270 set kk1 " (obsolescent gcc or gdb)"
271 test_one_ptype "ptype D" "ptype D" \
272 "class D : public AD, public virtual V \{(${ws}private:|)" \
273 "V \\*(_vb.1V|_vb.V);" \
275 "" "static void s\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vd\\((void|)\\);${ws}int fd\\((void|)\\);" \
276 "D & operator=\\(D const ?&\\);${ws}D\\(int, D const ?&\\);${ws}D\\(int\\);" \
277 "D & operator=\\(D const ?&\\);${ws}D\\(D const ?&\\);${ws}D\\(\\);" \
281 # TODO: E does not show a vbptr for V. That seems strange.
283 set kk0 " (obsolescent gcc or gdb)"
284 test_one_ptype "ptype E" "ptype E" \
285 "class E : public B, public virtual V, public D, public C \{(${ws}private:|)" \
288 "" "virtual int f\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vv\\((void|)\\);" \
289 "E & operator=\\(E const ?&\\);${ws}E\\(int, E const ?&\\);${ws}E\\(int\\);" \
290 "E & operator=\\(E const ?&\\);${ws}E\\(E const ?&\\);${ws}E\\(\\);" \
296 set kk1 " (obsolescent gcc or gdb)"
297 test_one_ptype "ptype dd" "ptype dd" \
298 "class D : public AD, public virtual V \{(${ws}private:|)" \
299 "V \\*(_vb.1V|_vb.V);" \
301 "" "static void s\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vd\\((void|)\\);${ws}int fd\\((void|)\\);" \
302 "D & operator=\\(D const ?&\\);${ws}D\\(int, D const ?&\\);${ws}D\\(int\\);" \
303 "D & operator=\\(D const ?&\\);${ws}D\\(D const ?&\\);${ws}D\\(\\);" \
309 set kk1 " (obsolescent gcc or gdb)"
310 test_one_ptype "ptype ppd" "ptype ppd" \
311 "class D : public AD, public virtual V \{(${ws}private:|)" \
312 "V \\*(_vb.1V|_vb.V);" \
314 "" "static void s\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vd\\((void|)\\);${ws}int fd\\((void|)\\);" \
315 "D & operator=\\(D const ?&\\);${ws}D\\(int, D const ?&\\);${ws}D\\(int\\);" \
316 "D & operator=\\(D const ?&\\);${ws}D\\(D const ?&\\);${ws}D\\(\\);" \
319 # An instance of AD *
320 # TODO: this should be named pADd, not pAd.
322 set kk0 " (obsolescent gcc or gdb)"
323 test_one_ptype "ptype pAd" "ptype pAd" \
324 "((struct|class) AD \{${ws}public:|struct AD \{)" \
327 "" "virtual int vg\\((void|)\\);" \
328 "AD & operator=\\(AD const ?&\\);${ws}AD\\(AD const ?&\\);${ws}AD\\((void|)\\);" \
329 "AD & operator=\\(AD const ?&\\);${ws}AD\\(AD const ?&\\);${ws}AD\\((void|)\\);" \
335 set kk1 " (obsolescent gcc or gdb)"
336 test_one_ptype "ptype a" "ptype a" \
337 "class A : public virtual V \{(${ws}private:|)" \
338 "V \\*(_vb.1V|_vb.V);" \
340 "public:" "virtual int f\\((void|)\\);" \
341 "A & operator=\\(A const ?&\\);${ws}A\\(int, A const ?&\\);${ws}A\\(int\\);" \
342 "A & operator=\\(A const ?&\\);${ws}A\\(A const ?&\\);${ws}A\\(\\);" \
347 set kk0 " (obsolescent gcc or gdb)"
348 test_one_ptype "ptype b" "ptype b" \
349 "class B : public A \{(${ws}private:|)" \
350 "V \\*(_vb.1V|_vb.V);" \
352 "public:" "virtual int f\\((void|)\\);" \
353 "B & operator=\\(B const ?&\\);${ws}B\\(int, B const ?&\\);${ws}B\\(int\\);" \
354 "B & operator=\\(B const ?&\\);${ws}B\\(B const ?&\\);${ws}B\\(\\);" \
360 set kk1 " (obsolescent gcc or gdb)"
361 test_one_ptype "ptype c" "ptype c" \
362 "class C : public virtual V \{(${ws}private:|)" \
363 "V \\*(_vb.1V|_vb.V);" \
366 "C & operator=\\(C const ?&\\);${ws}C\\(int, C const ?&\\);${ws}C\\(int\\);" \
367 "C & operator=\\(C const ?&\\);${ws}C\\(C const ?&\\);${ws}C\\(\\);" \
373 set kk1 " (obsolescent gcc or gdb)"
374 test_one_ptype "ptype d" "ptype d" \
375 "class D : public AD, public virtual V \{(${ws}private:|)" \
376 "V \\*(_vb.1V|_vb.V);" \
378 "" "static void s\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vd\\((void|)\\);${ws}int fd\\((void|)\\);" \
379 "D & operator=\\(D const ?&\\);${ws}D\\(int, D const ?&\\);${ws}D\\(int\\);" \
380 "D & operator=\\(D const ?&\\);${ws}D\\(D const ?&\\);${ws}D\\(\\);" \
385 set kk0 " (obsolescent gcc or gdb)"
386 test_one_ptype "ptype e" "ptype e" \
387 "class E : public B, public virtual V, public D, public C \{(${ws}private:|)" \
390 "" "virtual int f\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vv\\((void|)\\);" \
391 "E & operator=\\(E const ?&\\);${ws}E\\(int, E const ?&\\);${ws}E\\(int\\);" \
392 "E & operator=\\(E const ?&\\);${ws}E\\(E const ?&\\);${ws}E\\(\\);" \
397 set kk0 " (obsolescent gcc or gdb)"
398 test_one_ptype "ptype v" "ptype v" \
399 "class V : public VA, public VB \{${ws}public:" \
402 "" "int f\\((void|)\\);${ws}virtual int vv\\((void|)\\);" \
403 "V & operator=\\(V const ?&\\);${ws}V\\(V const ?&\\);${ws}V\\((void|)\\);" \
404 "V & operator=\\(V const ?&\\);${ws}V\\(V const ?&\\);${ws}V\\((void|)\\);" \
409 set kk0 " (obsolescent gcc or gdb)"
410 test_one_ptype "ptype vb" "ptype vb" \
411 "((struct|class) VB \{${ws}public:|struct VB \{)" \
414 "" "int fvb\\((void|)\\);${ws}virtual int vvb\\((void|)\\);" \
415 "VB & operator=\\(VB const ?&\\);${ws}VB\\(VB const ?&\\);${ws}VB\\((void|)\\);" \
416 "VB & operator=\\(VB const ?&\\);${ws}VB\\(VB const ?&\\);${ws}VB\\((void|)\\);" \
422 set kk1 " (obsolescent gcc or gdb)"
423 test_one_ptype "ptype pAa" "ptype pAa" \
424 "class A : public virtual V \{(${ws}private:|)" \
425 "V \\*(_vb.1V|_vb.V);" \
427 "public:" "virtual int f\\((void|)\\);" \
428 "A & operator=\\(A const ?&\\);${ws}A\\(int, A const ?&\\);${ws}A\\(int\\);" \
429 "A & operator=\\(A const ?&\\);${ws}A\\(A const ?&\\);${ws}A\\(\\);" \
435 set kk1 " (obsolescent gcc or gdb)"
436 test_one_ptype "ptype pAe" "ptype pAe" \
437 "class A : public virtual V \{(${ws}private:|)" \
438 "V \\*(_vb.1V|_vb.V);" \
440 "public:" "virtual int f\\((void|)\\);" \
441 "A & operator=\\(A const ?&\\);${ws}A\\(int, A const ?&\\);${ws}A\\(int\\);" \
442 "A & operator=\\(A const ?&\\);${ws}A\\(A const ?&\\);${ws}A\\(\\);" \
447 set kk0 " (obsolescent gcc or gdb)"
448 test_one_ptype "ptype pBe" "ptype pBe" \
449 "class B : public A \{(${ws}private:|)" \
450 "V \\*(_vb.1V|_vb.V);" \
452 "public:" "virtual int f\\((void|)\\);" \
453 "B & operator=\\(B const ?&\\);${ws}B\\(int, B const ?&\\);${ws}B\\(int\\);" \
454 "B & operator=\\(B const ?&\\);${ws}B\\(B const ?&\\);${ws}B\\(\\);" \
460 set kk1 " (obsolescent gcc or gdb)"
461 test_one_ptype "ptype pDd" "ptype pDd" \
462 "class D : public AD, public virtual V \{(${ws}private:|)" \
463 "V \\*(_vb.1V|_vb.V);" \
465 "" "static void s\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vd\\((void|)\\);${ws}int fd\\((void|)\\);" \
466 "D & operator=\\(D const ?&\\);${ws}D\\(int, D const ?&\\);${ws}D\\(int\\);" \
467 "D & operator=\\(D const ?&\\);${ws}D\\(D const ?&\\);${ws}D\\(\\);" \
473 set kk1 " (obsolescent gcc or gdb)"
474 test_one_ptype "ptype pDe" "ptype pDe" \
475 "class D : public AD, public virtual V \{(${ws}private:|)" \
476 "V \\*(_vb.1V|_vb.V);" \
478 "" "static void s\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vd\\((void|)\\);${ws}int fd\\((void|)\\);" \
479 "D & operator=\\(D const ?&\\);${ws}D\\(int, D const ?&\\);${ws}D\\(int\\);" \
480 "D & operator=\\(D const ?&\\);${ws}D\\(D const ?&\\);${ws}D\\(\\);" \
485 set kk0 " (obsolescent gcc or gdb)"
486 test_one_ptype "ptype pVa" "ptype pVa" \
487 "class V : public VA, public VB \{${ws}public:" \
490 "" "int f\\((void|)\\);${ws}virtual int vv\\((void|)\\);" \
491 "V & operator=\\(V const ?&\\);${ws}V\\(V const ?&\\);${ws}V\\((void|)\\);" \
492 "V & operator=\\(V const ?&\\);${ws}V\\(V const ?&\\);${ws}V\\((void|)\\);" \
497 set kk0 " (obsolescent gcc or gdb)"
498 test_one_ptype "ptype pVv" "ptype pVv" \
499 "class V : public VA, public VB \{${ws}public:" \
502 "" "int f\\((void|)\\);${ws}virtual int vv\\((void|)\\);" \
503 "V & operator=\\(V const ?&\\);${ws}V\\(V const ?&\\);${ws}V\\((void|)\\);" \
504 "V & operator=\\(V const ?&\\);${ws}V\\(V const ?&\\);${ws}V\\((void|)\\);" \
509 set kk0 " (obsolescent gcc or gdb)"
510 test_one_ptype "ptype pVe" "ptype pVe" \
511 "class V : public VA, public VB \{${ws}public:" \
514 "" "int f\\((void|)\\);${ws}virtual int vv\\((void|)\\);" \
515 "V & operator=\\(V const ?&\\);${ws}V\\(V const ?&\\);${ws}V\\((void|)\\);" \
516 "V & operator=\\(V const ?&\\);${ws}V\\(V const ?&\\);${ws}V\\((void|)\\);" \
521 set kk0 " (obsolescent gcc or gdb)"
522 test_one_ptype "ptype pVd" "ptype pVd" \
523 "class V : public VA, public VB \{${ws}public:" \
526 "" "int f\\((void|)\\);${ws}virtual int vv\\((void|)\\);" \
527 "V & operator=\\(V const ?&\\);${ws}V\\(V const ?&\\);${ws}V\\((void|)\\);" \
528 "V & operator=\\(V const ?&\\);${ws}V\\(V const ?&\\);${ws}V\\((void|)\\);" \
531 # An instance of AD *
533 set kk0 " (obsolescent gcc or gdb)"
534 test_one_ptype "ptype pADe" "ptype pADe" \
535 "((struct|class) AD \{${ws}public:|struct AD \{)" \
538 "" "virtual int vg\\((void|)\\);" \
539 "AD & operator=\\(AD const ?&\\);${ws}AD\\(AD const ?&\\);${ws}AD\\((void|)\\);" \
540 "AD & operator=\\(AD const ?&\\);${ws}AD\\(AD const ?&\\);${ws}AD\\((void|)\\);" \
545 set kk0 " (obsolescent gcc or gdb)"
546 test_one_ptype "ptype pEe" "ptype pEe" \
547 "class E : public B, public virtual V, public D, public C \{(${ws}private:|)" \
550 "" "virtual int f\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vv\\((void|)\\);" \
551 "E & operator=\\(E const ?&\\);${ws}E\\(int, E const ?&\\);${ws}E\\(int\\);" \
552 "E & operator=\\(E const ?&\\);${ws}E\\(E const ?&\\);${ws}E\\(\\);" \
555 # An instance of VB *
557 set kk0 " (obsolescent gcc or gdb)"
558 test_one_ptype "ptype pVB" "ptype pVB" \
559 "((struct|class) VB \{${ws}public:|struct VB \{)" \
562 "" "int fvb\\((void|)\\);${ws}virtual int vvb\\((void|)\\);" \
563 "VB & operator=\\(VB const ?&\\);${ws}VB\\(VB const ?&\\);${ws}VB\\((void|)\\);" \
564 "VB & operator=\\(VB const ?&\\);${ws}VB\\(VB const ?&\\);${ws}VB\\((void|)\\);" \
568 # Call virtual functions.
570 proc test_virtual_calls {} {
574 if [target_info exists gdb,cannot_call_functions] {
575 setup_xfail "*-*-*" 2416
576 fail "This target can not call functions"
580 gdb_test "print pAe->f()" "\\$\[0-9\]+ = 20"
581 gdb_test "print pAa->f()" "\\$\[0-9\]+ = 1"
582 gdb_test "print pDe->vg()" "\\$\[0-9\]+ = 202"
583 gdb_test "print pADe->vg()" "\\$\[0-9\]+ = 202"
584 gdb_test "print pDd->vg()" "\\$\[0-9\]+ = 101"
585 gdb_test "print pEe->vvb()" "\\$\[0-9\]+ = 411"
586 gdb_test "print pVB->vvb()" "\\$\[0-9\]+ = 407"
587 gdb_test "print pBe->vvb()" "\\$\[0-9\]+ = 411"
588 gdb_test "print pDe->vvb()" "\\$\[0-9\]+ = 411"
589 gdb_test "print pEe->vd()" "\\$\[0-9\]+ = 282"
590 gdb_test "print pEe->fvb()" "\\$\[0-9\]+ = 311"
592 # fails on target=native, host=i686-pc-linux-gnu%rh-7.2,
593 # gdb=HEAD%2002-02-16, gcc=2.95.3, goption=-gdwarf-2.
595 # fails on target=native, host=i686-pc-linux-gnu%rh-7.2,
596 # gdb=HEAD%2002-02-16, gcc=2.95.3, goption=-gstabs+.
598 # fails on target=native, host=i686-pc-linux-gnu%rh-7.2,
599 # gdb=HEAD%2002-02-16, gcc=3.0.3, goption=-gdwarf-2.
601 # fails on target=native, host=i686-pc-linux-gnu%rh-7.2,
602 # gdb=HEAD%2002-02-16, gcc=3.0.3, goption=-gstabs+.
604 # fails on target=native, host=i686-pc-linux-gnu%rh-7.2,
605 # gdb=HEAD%2002-02-16, gcc=3.0.4-20020215, goption=-gdwarf-2.
607 # fails on target=native, host=i686-pc-linux-gnu%rh-7.2,
608 # gdb=HEAD%2002-02-16, gcc=3.0.4-20020215, goption=-gstabs+.
610 # fails on target=native, host=i686-pc-linux-gnu%rh-7.2,
611 # gdb=HEAD%2002-02-16, gcc=gcc-3_0-branch%2002-02-16, goption=-gdwarf-2.
613 # fails on target=native, host=i686-pc-linux-gnu%rh-7.2,
614 # gdb=HEAD%2002-02-16, gcc=gcc-3_0-branch%2002-02-16, goption=-gstabs+.
616 # fails on target=native, host=i686-pc-linux-gnu%rh-7.2,
617 # gdb=HEAD%2002-02-16, gcc=HEAD%2002-02-16, goption=-gdwarf-2.
619 # fails on target=native, host=i686-pc-linux-gnu%rh-7.2,
620 # gdb=HEAD%2002-02-16, gcc=HEAD%2002-02-16, goption=-gstabs+.
622 # -- chastain 2002-02-20
624 # more recent results:
626 # gcc 2.95.3 -gdwarf-2
627 # gcc 2.95.3 -gstabs+
628 # attempt to take addres of value not located in memory
629 # gcc 3.3.2 -gdwarf-2
632 # -- chastain 2003-12-31
634 gdb_test_multiple "print pEe->D::vg()" "print pEe->D::vg()" {
635 -re "\\$\[0-9]+ = 102$nl$gdb_prompt $" {
636 pass "print pEe->D::vg()"
638 -re "Attempt to take address of value not located in memory.$nl$gdb_prompt $" {
639 kfail "gdb/1064" "print pEe->D::vg()"
647 global srcdir subdir binfile
655 gdb_reinitialize_dir $srcdir/$subdir
658 gdb_test "set language c++" "" ""
659 gdb_test "set width 0" "" ""
662 test_ptype_of_classes
664 gdb_breakpoint test_calls
665 gdb_test "continue" ".*Breakpoint .* test_calls.*" ""