* config/pa/tm-hppa.h: Define lots register offsets needed by
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / nodebug.exp
1 # Test that things still (sort of) work when compiled without -g.
2
3 if $tracelevel then {
4 strace $tracelevel
5 }
6
7 set prms_id 0
8 set bug_id 0
9
10 set binfile $objdir/$subdir/nodebug
11
12 if ![file exists $binfile] then {
13 perror "$binfile does not exist."
14 return 0
15 } else {
16 gdb_reinitialize_dir $srcdir/$subdir
17 gdb_load $binfile
18
19 if [runto inner] then {
20
21 # Expect to find global/local symbols in each of text/data/bss.
22
23 # The exact format for some of this output is not necessarily
24 # ideal, particularly interpreting "p top" requires a fair bit of
25 # savvy about gdb's workings and the meaning of the "{}"
26 # construct. So the details maybe could be tweaked. But the
27 # basic purpose should be maintained, which is (a) users should be
28 # able to interact with these variables with some care (they have
29 # to know how to interpret them according to their real type,
30 # since gdb doesn't know the type), but (b) users should be able
31 # to detect that gdb does not know the type, rather than just
32 # being told they are ints or functions returning int like old
33 # versions of gdb used to do.
34
35 # On alpha (and other ecoff systems, even stabs in ecoff) GCC
36 # puts out stProc and related symbols which cause GDB to think
37 # it knows the type. GDB probably could be fixed to do
38 # better, but for now xfail these tests. Irix5, even though
39 # it is ELF, counts as "ecoff" because gcc puts out a .mdebug
40 # section even without -g. Personally, I think that is pretty
41 # dubious, but maybe dbx requires it.
42 setup_xfail "alpha*-*-osf*" "mips*-*-irix*" "*-*-ultrix*"
43 gdb_test "p top" \
44 "{<(text variable|function), no debug info>} \[0-9a-fx]* <top>"
45 setup_xfail "alpha*-*-osf*" "mips*-*-irix*" "*-*-ultrix*"
46 gdb_test "whatis top" "<(text variable|function), no debug info>"
47 setup_xfail "alpha*-*-osf*" "mips*-*-irix*" "*-*-ultrix*"
48 gdb_test "ptype top" "int \\((|<non-float parameter>)\\)"
49
50 setup_xfail "alpha*-*-osf*" "mips*-*-irix*" "*-*-ultrix*"
51 gdb_test "p middle" \
52 "{<(text variable|function), no debug info>} \[0-9a-fx]* <middle>"
53 setup_xfail "alpha*-*-osf*" "mips*-*-irix*" "*-*-ultrix*"
54 gdb_test "whatis middle" "<(text variable|function), no debug info>"
55 setup_xfail "alpha*-*-osf*" "mips*-*-irix*" "*-*-ultrix*"
56 gdb_test "ptype middle" "int \\((|<non-float parameter>)\\)"
57
58 gdb_test "p dataglobal" "= 3"
59 setup_xfail "alpha*-*-osf*" "mips*-*-irix*" "*-*-ultrix*"
60 gdb_test "whatis dataglobal" \
61 "<(data variable|variable), no debug info>"
62 setup_xfail "alpha*-*-osf*" "mips*-*-irix*" "*-*-ultrix*"
63 gdb_test "ptype dataglobal" "<(data variable|variable), no debug info>"
64
65 # The only symbol xcoff puts out for statics is for the TOC entry.
66 # Possible, but hairy, for gdb to deal. Right now it doesn't, it
67 # doesn't know the variables exist at all.
68 setup_xfail "rs6000*-*-aix*"
69 gdb_test "p datalocal" "= 4"
70 setup_xfail "rs6000*-*-aix*"
71 setup_xfail "alpha*-*-osf*" "mips*-*-irix*" "*-*-ultrix*"
72 gdb_test "whatis datalocal" "<(data variable|variable), no debug info>"
73 setup_xfail "rs6000*-*-aix*"
74 setup_xfail "alpha*-*-osf*" "mips*-*-irix*" "*-*-ultrix*"
75 gdb_test "ptype datalocal" "<(data variable|variable), no debug info>"
76
77 gdb_test "p bssglobal" "= 0"
78 setup_xfail "alpha*-*-osf*" "mips*-*-irix*" "*-*-ultrix*"
79 gdb_test "whatis bssglobal" "<(data variable|variable), no debug info>"
80 setup_xfail "alpha*-*-osf*" "mips*-*-irix*" "*-*-ultrix*"
81 gdb_test "ptype bssglobal" "<(data variable|variable), no debug info>"
82
83 setup_xfail "rs6000*-*-aix*"
84 gdb_test "p bsslocal" "= 0"
85 setup_xfail "rs6000*-*-aix*"
86 setup_xfail "alpha*-*-osf*" "mips*-*-irix*" "*-*-ultrix*"
87 gdb_test "whatis bsslocal" "<(data variable|variable), no debug info>"
88 setup_xfail "rs6000*-*-aix*"
89 setup_xfail "alpha*-*-osf*" "mips*-*-irix*" "*-*-ultrix*"
90 gdb_test "ptype bsslocal" "<(data variable|variable), no debug info>"
91
92 gdb_test "backtrace" "#0.*inner.*#1.*middle.*#2.*top.*#3.*main.*" \
93 "backtrace in nodebug.exp"
94 # Or if that doesn't work, at least hope for the external symbols
95 # Commented out because if we aren't going to xfail the above test
96 # ever, why bother with a weaker test?
97 #gdb_test "backtrace" "#0.*inner.*#1.*#2.*top.*#3.*main.*" \
98 # "backtrace in nodebug.exp for externals"
99
100 # This test is not as obscure as it might look. `p getenv ("TERM")'
101 # is a real-world example, at least on many systems.
102 gdb_test {p/c array_index("abcdef",2)} " = 99 'c'"
103
104 # Now, try that we can give names of file-local symbols which happen
105 # to be unique, and have it still work
106 if [runto middle] then {
107 gdb_test "backtrace" "#0.*middle.*#1.*top.*#2.*main.*"
108 }
109 }
110 }
This page took 0.031705 seconds and 4 git commands to generate.