Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(234)

Side by Side Diff: gdb/testsuite/gdb.base/run.c

Issue 11969036: Merge GDB 7.5.1 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@master
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gdb/testsuite/gdb.base/return2.exp ('k') | gdb/testsuite/gdb.base/save-bp.exp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This simple classical example of recursion is useful for 2 * This simple classical example of recursion is useful for
3 * testing stack backtraces and such. 3 * testing stack backtraces and such.
4 */ 4 */
5 5
6 #ifdef vxworks 6 #ifdef vxworks
7 7
8 # include <stdio.h> 8 # include <stdio.h>
9 9
10 /* VxWorks does not supply atoi. */ 10 /* VxWorks does not supply atoi. */
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 int 43 int
44 main (int argc, char **argv, char **envp) 44 main (int argc, char **argv, char **envp)
45 #else 45 #else
46 int 46 int
47 main (argc, argv, envp) 47 main (argc, argv, envp)
48 int argc; 48 int argc;
49 char *argv[], **envp; 49 char *argv[], **envp;
50 #endif 50 #endif
51 { 51 {
52 #ifdef usestubs
53 set_debug_traps();
54 breakpoint();
55 #endif
56 #ifdef FAKEARGV 52 #ifdef FAKEARGV
57 printf ("%d\n", factorial (1)); 53 printf ("%d\n", factorial (1));
58 #else 54 #else
59 if (argc != 2) { 55 if (argc != 2) {
60 printf ("usage: factorial <number>\n"); 56 printf ("usage: factorial <number>\n");
61 return 1; 57 return 1;
62 } else { 58 } else {
63 printf ("%d\n", factorial (atoi (argv[1]))); 59 printf ("%d\n", factorial (atoi (argv[1])));
64 } 60 }
65 #endif 61 #endif
66 return 0; 62 return 0;
67 } 63 }
68 64
69 #ifdef PROTOTYPES 65 #ifdef PROTOTYPES
70 int factorial (int value) 66 int factorial (int value)
71 #else 67 #else
72 int factorial (value) int value; 68 int factorial (value) int value;
73 #endif 69 #endif
74 { 70 {
75 int local_var; 71 int local_var;
76 72
77 if (value > 1) { 73 if (value > 1) {
78 value *= factorial (value - 1); 74 value *= factorial (value - 1);
79 } 75 }
80 local_var = value; 76 local_var = value;
81 return (value); 77 return (value);
82 } 78 }
OLDNEW
« no previous file with comments | « gdb/testsuite/gdb.base/return2.exp ('k') | gdb/testsuite/gdb.base/save-bp.exp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698