OLD | NEW |
1 /* Support program for testing gdb's ability to call functions | 1 /* Support program for testing gdb's ability to call functions |
2 in an inferior which doesn't itself call malloc, pass appropriate | 2 in an inferior which doesn't itself call malloc, pass appropriate |
3 arguments to those functions, and get the returned result. */ | 3 arguments to those functions, and get the returned result. */ |
4 | 4 |
5 #ifdef NO_PROTOTYPES | 5 #ifdef NO_PROTOTYPES |
6 #define PARAMS(paramlist) () | 6 #define PARAMS(paramlist) () |
7 #else | 7 #else |
8 #define PARAMS(paramlist) paramlist | 8 #define PARAMS(paramlist) paramlist |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 | 173 |
174 /* Gotta have a main to be able to generate a linked, runnable | 174 /* Gotta have a main to be able to generate a linked, runnable |
175 executable, and also provide a useful place to set a breakpoint. */ | 175 executable, and also provide a useful place to set a breakpoint. */ |
176 | 176 |
177 #ifdef PROTOTYPES | 177 #ifdef PROTOTYPES |
178 int main() | 178 int main() |
179 #else | 179 #else |
180 main () | 180 main () |
181 #endif | 181 #endif |
182 { | 182 { |
183 #ifdef usestubs | |
184 set_debug_traps(); | |
185 breakpoint(); | |
186 #endif | |
187 t_structs_c(struct_val1); | 183 t_structs_c(struct_val1); |
188 return 0; | 184 return 0; |
189 | 185 |
190 } | 186 } |
191 | 187 |
192 /* Functions that expect specific values to be passed and return | 188 /* Functions that expect specific values to be passed and return |
193 either 0 or 1, depending upon whether the values were | 189 either 0 or 1, depending upon whether the values were |
194 passed incorrectly or correctly, respectively. */ | 190 passed incorrectly or correctly, respectively. */ |
195 | 191 |
196 #ifdef PROTOTYPES | 192 #ifdef PROTOTYPES |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 #ifdef PROTOTYPES | 349 #ifdef PROTOTYPES |
354 int t_call_add (int (*func_arg1)(int, int), int a, int b) | 350 int t_call_add (int (*func_arg1)(int, int), int a, int b) |
355 #else | 351 #else |
356 int t_call_add (func_arg1, a, b) | 352 int t_call_add (func_arg1, a, b) |
357 int (*func_arg1) PARAMS ((int, int)); | 353 int (*func_arg1) PARAMS ((int, int)); |
358 int a, b; | 354 int a, b; |
359 #endif | 355 #endif |
360 { | 356 { |
361 return ((*func_arg1)(a, b)); | 357 return ((*func_arg1)(a, b)); |
362 } | 358 } |
OLD | NEW |