Re: [RFC] add 'save-breakpoints' command

Klee Dienes
2001-12-18T09:42:06Z

On Fri, Dec 14, 2001 at 03:44:03PM -0500, Klee Dienes wrote:
>> We've been using a variant of this patch at Apple for a little over a
>> year; it seems to be working. The test suite shows four additional
>> unexpected successes when I run it with this patch, but I figure
>> that's probably OK.
>
> That's odd; the testsuite is mostly (entirely?) compiled with debug
> information. Which are they?

Ah, you caught me. The 4 XPASSES were the result of mild version skew
between the times I did the 'cvs update' on the two source trees; they
were unrelated to the code changes.

In fact, when I ran the test suite correctly I discovered a number of
failed tests due to output changes (since now GDB is less aggressive
about guessing the type about symbols without debugging information).

After applying the following patch, I now get identical output from
the test suite before- and after-patch.

Index: gdb/testsuite/gdb.asm/asm-source.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.asm/asm-source.exp,v
retrieving revision 1.14
diff -u -r1.14 asm-source.exp
--- asm-source.exp 2001/12/13 13:42:19 1.14
+++ asm-source.exp 2001/12/18 09:19:04
@@ -206,10 +206,12 @@
"Make selected stack frame return now\?.*" "y"

# See if we can look at a global variable
-gdb_test "print globalvar" ".* = 11" "look at global variable"
+gdb_test "print globalvar" ".* = (11|<unknown type>)" "look at global variable"
+gdb_test "print (int) globalvar" ".* = 11" "look at global variable"

# See if we can look at a static variable
-gdb_test "print staticvar" ".* = 5" "look at static variable"
+gdb_test "print staticvar" ".* = (5|<unknown type>)" "look at static variable"
+gdb_test "print (int) staticvar" ".* = 5" "look at static variable"

# See if we can look at a static function
gdb_test "disassem foostatic" ".*<foostatic>:.*End of assembler dump." \
Index: gdb/testsuite/gdb.base/nodebug.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/nodebug.exp,v
retrieving revision 1.2
diff -u -r1.2 nodebug.exp
--- nodebug.exp 2001/03/06 08:21:50 1.2
+++ nodebug.exp 2001/12/18 09:19:04
@@ -77,23 +77,24 @@
gdb_test "whatis top" \
"(<(text variable|function), no debug info>|short \\(int\\)|short \\(\\))"
if {!$gcc_compiled} then { setup_xfail "mips-sgi-irix6*" }
- gdb_test "ptype top" "(short|int) \\((|void|int|<non-float parameter>|<non-float parameter>, <non-float parameter>)\\)"
+ gdb_test "ptype top" "(short|int|<unknown type>) \\((|void|int|<non-float parameter>|<non-float parameter>, <non-float parameter>)\\)"

if {!$gcc_compiled} then { setup_xfail "mips-sgi-irix5*" }
setup_xfail "mips-sgi-irix6*"
gdb_test "p middle" \
- "\{(<(text variable|function), no debug info>|short \\(int\\)|short \\(\\))\} \[0-9a-fx]* <middle(\\(int\\)|)>"
+ "\{(<(text variable|function), no debug info>|<unknown type>|short \\(int\\)|short \\(\\))\} \[0-9a-fx]* <middle(\\(int\\)|)>"
if {!$gcc_compiled} then { setup_xfail "mips-sgi-irix5*" }
setup_xfail "mips-sgi-irix6*"
gdb_test "whatis middle" \
- "(<(text variable|function), no debug info>|short \\(int\\)|short \\(\\))"
+ "(<(text variable|function), no debug info>|<unknown type>|short \\(int\\)|short \\(\\))"
setup_xfail "mips-sgi-irix6*"
- gdb_test "ptype middle" "(short|int) \\((|void|int|<non-float parameter>|<non-float parameter>, <non-float parameter>)\\)"
+ gdb_test "ptype middle" "(short|int|<unknown type>) \\((|void|int|<non-float parameter>|<non-float parameter>, <non-float parameter>)\\)"

- gdb_test "p dataglobal" "= 3"
+ gdb_test "p dataglobal" "(= 3|<unknown type>)"
+ gdb_test "p (int) dataglobal" "= 3"
gdb_test "whatis dataglobal" \
- "<(data variable|variable), no debug info>|int"
- gdb_test "ptype dataglobal" "<(data variable|variable), no debug info>|int"
+ "<(data variable|variable), no debug info>|<unknown type>|int"
+ gdb_test "ptype dataglobal" "<(data variable|variable), no debug info>|<unknown type>|int"

# The only symbol xcoff puts out for statics is for the TOC entry.
# Possible, but hairy, for gdb to deal. Right now it doesn't, it
@@ -102,37 +103,40 @@
setup_xfail "powerpc*-*-aix*"
if {!$gcc_compiled} then { setup_xfail "hppa*-*-hpux*" }
if {$gcc_compiled} then { setup_xfail "mips-sgi-irix6*" }
- gdb_test "p datalocal" "= 4"
+ gdb_test "p datalocal" "(= 4|<unknown type>)"
+ gdb_test "p (int) datalocal" "4"
setup_xfail "rs6000*-*-aix*"
setup_xfail "powerpc*-*-aix*"
if {!$gcc_compiled} then { setup_xfail "hppa*-*-hpux*" }
if {$gcc_compiled} then { setup_xfail "mips-sgi-irix6*" }
- gdb_test "whatis datalocal" "<(data variable|variable), no debug info>"
+ gdb_test "whatis datalocal" "<(data variable|variable), no debug info>|<unknown type>"
setup_xfail "rs6000*-*-aix*"
setup_xfail "powerpc*-*-aix*"
if {!$gcc_compiled} then { setup_xfail "hppa*-*-hpux*" }
if {$gcc_compiled} then { setup_xfail "mips-sgi-irix6*" }
- gdb_test "ptype datalocal" "<(data variable|variable), no debug info>"
+ gdb_test "ptype datalocal" "<(data variable|variable), no debug info>|<unknown type>"

- gdb_test "p bssglobal" "= 0"
- gdb_test "whatis bssglobal" "<(data variable|variable), no debug info>|int"
- gdb_test "ptype bssglobal" "<(data variable|variable), no debug info>|int"
+ gdb_test "p bssglobal" "(= 0|<unknown type>)"
+ gdb_test "p (int) bssglobal" "= 0"
+ gdb_test "whatis bssglobal" "<(data variable|variable), no debug info>|<unknown type>|int"
+ gdb_test "ptype bssglobal" "<(data variable|variable), no debug info>|<unknown type>|int"

setup_xfail "rs6000*-*-aix*"
setup_xfail "powerpc*-*-aix*"
if {!$gcc_compiled} then { setup_xfail "hppa*-*-hpux*" }
if {$gcc_compiled} then { setup_xfail "mips-sgi-irix6*" }
- gdb_test "p bsslocal" "= 0"
+ gdb_test "p bsslocal" "(= 0|<unknown type>)"
+ gdb_test "p (int) bsslocal" "= 0"
setup_xfail "rs6000*-*-aix*"
setup_xfail "powerpc*-*-aix*"
if {!$gcc_compiled} then { setup_xfail "hppa*-*-hpux*" }
if {$gcc_compiled} then { setup_xfail "mips-sgi-irix6*" }
- gdb_test "whatis bsslocal" "<(data variable|variable), no debug info>"
+ gdb_test "whatis bsslocal" "<(data variable|variable), no debug info>|<unknown type>"
setup_xfail "rs6000*-*-aix*"
setup_xfail "powerpc*-*-aix*"
if {!$gcc_compiled} then { setup_xfail "hppa*-*-hpux*" }
if {$gcc_compiled} then { setup_xfail "mips-sgi-irix6*" }
- gdb_test "ptype bsslocal" "<(data variable|variable), no debug info>"
+ gdb_test "ptype bsslocal" "<(data variable|variable), no debug info>|<unknown type>"

if {$gcc_compiled} then { setup_xfail "mips-sgi-irix6*" }
gdb_test "backtrace 10" "#0.*inner.*#1.*middle.*#2.*top.*#3.*main.*" \
@@ -167,7 +171,9 @@
# We need to up this because this can be really slow on some boards.
# (malloc() is called as part of the test).
set timeout 60;
- gdb_test {p/c array_index("abcdef",2)} " = 99 'c'"
+ gdb_test {p/c (int) array_index("abcdef",2)} " = 99 'c'"
+ gdb_test {p/c array_index("abcdef",2)} \
+ "Unable to call function .* no return type information available.*"
}
}