Commit | Line | Data |
---|---|---|
32d0add0 | 1 | # Copyright 2010-2015 Free Software Foundation, Inc. |
3b11a015 SS |
2 | # |
3 | # This program is free software; you can redistribute it and/or modify | |
4 | # it under the terms of the GNU General Public License as published by | |
5 | # the Free Software Foundation; either version 3 of the License, or | |
6 | # (at your option) any later version. | |
7 | # | |
8 | # This program is distributed in the hope that it will be useful, | |
9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
11 | # GNU General Public License for more details. | |
12 | # | |
13 | # You should have received a copy of the GNU General Public License | |
14 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
15 | ||
16 | # Tests of agent expression handling. | |
17 | ||
18 | # The tests that use the maintenance command do not need tracepoint | |
19 | # support on the target, but they do want a live program. | |
20 | ||
4ec70201 | 21 | load_lib "trace-support.exp" |
3b11a015 | 22 | |
3b11a015 SS |
23 | |
24 | gdb_exit | |
25 | gdb_start | |
497a5eb0 | 26 | standard_testfile actions.c |
3b11a015 SS |
27 | if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \ |
28 | executable {debug nowarnings}] != "" } { | |
29 | untested ax.exp | |
30 | return -1 | |
31 | } | |
32 | ||
33 | gdb_load $binfile | |
34 | runto_main | |
35 | gdb_reinitialize_dir $srcdir/$subdir | |
36 | ||
37 | gdb_test "maint agent 12" ".*const8 12.*pop.*end.*" "maint agent 12" | |
38 | ||
39 | gdb_test "maint agent gdb_char_test" "" "maint agent gdb_char_test" | |
40 | ||
41 | gdb_test "maint agent gdb_arr_test\[12\]" "" "maint agent gdb_arr_test\[12\]" | |
42 | ||
43 | gdb_test "maint agent gdb_arr_test\[gdb_short_test\]" "" "maint agent gdb_arr_test\[gdb_short_test\]" | |
44 | ||
45 | gdb_test "maint agent gdb_struct1_test" "" "maint agent gdb_struct1_test" | |
46 | ||
47 | gdb_test "maint agent gdb_struct1_test.s" "" "maint agent gdb_struct1_test.s" | |
48 | ||
49 | gdb_test "maint agent gdb_struct1_test.arr\[gdb_struct1_test.c\]" "" "maint agent gdb_struct1_test.arr\[gdb_struct1_test.c\]" | |
50 | ||
51 | gdb_test "maint agent gdb_structp_test" "" "maint agent gdb_structp_test" | |
52 | ||
53 | gdb_test "maint agent gdb_structp_test->l" "" "maint agent gdb_structp_test->l" | |
54 | ||
55 | gdb_test "maint agent gdb_structp_test->bfield" "" "maint agent gdb_structp_test->bfield" | |
56 | ||
57 | gdb_test "maint agent gdb_long_test + gdb_short_test" "" "maint agent gdb_long_test + gdb_short_test" | |
58 | ||
59 | gdb_test "maint agent gdb_long_test - gdb_short_test" "" "maint agent gdb_long_test - gdb_short_test" | |
60 | ||
61 | gdb_test "maint agent gdb_long_test * gdb_short_test" "" "maint agent gdb_long_test * gdb_short_test" | |
62 | ||
63 | gdb_test "maint agent gdb_long_test / gdb_short_test" "" "maint agent gdb_long_test / gdb_short_test" | |
64 | ||
65 | gdb_test "maint agent gdb_structp_test + 1" "" "maint agent gdb_structp_test + 1" | |
66 | ||
67 | gdb_test "maint agent gdb_long_test == gdb_short_test" "" "maint agent gdb_long_test == gdb_short_test" | |
68 | ||
69 | gdb_test "maint agent gdb_long_test != gdb_short_test" "" "maint agent gdb_long_test != gdb_short_test" | |
70 | ||
71 | gdb_test "maint agent gdb_long_test < gdb_short_test" "" "maint agent gdb_long_test < gdb_short_test" | |
72 | ||
73 | gdb_test "maint agent gdb_long_test <= gdb_short_test" "" "maint agent gdb_long_test <= gdb_short_test" | |
74 | ||
75 | gdb_test "maint agent gdb_long_test > gdb_short_test" "" "maint agent gdb_long_test > gdb_short_test" | |
76 | ||
77 | gdb_test "maint agent gdb_long_test >= gdb_short_test" "" "maint agent gdb_long_test >= gdb_short_test" | |
78 | ||
79 | gdb_test "maint agent &gdb_long_test == &gdb_short_test" "" "maint agent &gdb_long_test == &gdb_short_test" | |
80 | ||
81 | gdb_test "maint agent &gdb_long_test < &gdb_short_test" "" "maint agent &gdb_long_test < &gdb_short_test" | |
82 | ||
83 | # Now test eval version of agent expressions. | |
84 | ||
85 | gdb_test "maint agent-eval 12" ".*const8 12.*end.*" "maint agent-eval 12" | |
86 | ||
87 | gdb_test "maint agent-eval gdb_char_test" "" "maint agent-eval gdb_char_test" | |
88 | ||
89 | gdb_test "maint agent-eval gdb_arr_test\[12\]" "" "maint agent-eval gdb_arr_test\[12\]" | |
90 | ||
91 | gdb_test "maint agent-eval gdb_arr_test\[gdb_short_test\]" "" "maint agent-eval gdb_arr_test\[gdb_short_test\]" | |
92 | ||
93 | gdb_test "maint agent-eval gdb_struct1_test" "" "maint agent-eval gdb_struct1_test" | |
94 | ||
95 | gdb_test "maint agent-eval gdb_struct1_test.s" "" "maint agent-eval gdb_struct1_test.s" | |
96 | ||
97 | gdb_test "maint agent-eval gdb_struct1_test.arr\[gdb_struct1_test.c\]" "" "maint agent-eval gdb_struct1_test.arr\[gdb_struct1_test.c\]" | |
98 | ||
99 | gdb_test "maint agent-eval gdb_structp_test" "" "maint agent-eval gdb_structp_test" | |
100 | ||
101 | gdb_test "maint agent-eval gdb_structp_test->l" "" "maint agent-eval gdb_structp_test->l" | |
102 | ||
103 | gdb_test "maint agent-eval gdb_structp_test->bfield" "" "maint agent-eval gdb_structp_test->bfield" | |
104 | ||
105 | gdb_test "maint agent-eval gdb_long_test + gdb_short_test" "" "maint agent-eval gdb_long_test + gdb_short_test" | |
106 | ||
107 | gdb_test "maint agent-eval gdb_long_test - gdb_short_test" "" "maint agent-eval gdb_long_test - gdb_short_test" | |
108 | ||
109 | gdb_test "maint agent-eval gdb_long_test * gdb_short_test" "" "maint agent-eval gdb_long_test * gdb_short_test" | |
110 | ||
111 | gdb_test "maint agent-eval gdb_long_test / gdb_short_test" "" "maint agent-eval gdb_long_test / gdb_short_test" | |
112 | ||
113 | gdb_test "maint agent-eval gdb_structp_test + 1" "" "maint agent-eval gdb_structp_test + 1" | |
114 | ||
115 | gdb_test "maint agent-eval gdb_long_test == gdb_short_test" "" "maint agent-eval gdb_long_test == gdb_short_test" | |
116 | ||
117 | gdb_test "maint agent-eval gdb_long_test != gdb_short_test" "" "maint agent-eval gdb_long_test != gdb_short_test" | |
118 | ||
119 | gdb_test "maint agent-eval gdb_long_test < gdb_short_test" "" "maint agent-eval gdb_long_test < gdb_short_test" | |
120 | ||
121 | gdb_test "maint agent-eval gdb_long_test <= gdb_short_test" "" "maint agent-eval gdb_long_test <= gdb_short_test" | |
122 | ||
123 | gdb_test "maint agent-eval gdb_long_test > gdb_short_test" "" "maint agent-eval gdb_long_test > gdb_short_test" | |
124 | ||
125 | gdb_test "maint agent-eval gdb_long_test >= gdb_short_test" "" "maint agent-eval gdb_long_test >= gdb_short_test" | |
126 | ||
127 | gdb_test "maint agent-eval &gdb_long_test == &gdb_short_test" ".*equal.*end.*" "maint agent-eval &gdb_long_test == &gdb_short_test" | |
128 | ||
129 | gdb_test "maint agent-eval &gdb_long_test < &gdb_short_test" "" "maint agent-eval &gdb_long_test < &gdb_short_test" | |
130 |