This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
PATCH: make caller0 in gdb/testsuite/gdb.base/restore.c match comment
- To: gdb-patches at sources dot redhat dot com
- Subject: PATCH: make caller0 in gdb/testsuite/gdb.base/restore.c match comment
- From: Jim Blandy <jimb at zwingli dot cygnus dot com>
- Date: Sun, 6 May 2001 19:08:02 -0500 (EST)
I've checked this in, since it seems like an obvious fix.
2001-05-06 Jim Blandy <jimb@redhat.com>
* restore.c: Make the code of caller0 correspond to its comment.
Index: gdb/testsuite/gdb.base/restore.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/testsuite/gdb.base/restore.c,v
retrieving revision 1.3
diff -c -r1.3 restore.c
*** gdb/testsuite/gdb.base/restore.c 1999/09/08 01:44:26 1.3
--- gdb/testsuite/gdb.base/restore.c 2001/05/07 00:02:31
***************
*** 14,24 ****
(defun caller (n) (format "caller%d" n))
(defun local (n) (format "l%d" n))
(defun local-sum (n)
! (let ((j 1))
! (while (<= j n)
! (insert (local j))
! (if (< j n) (insert "+"))
! (setq j (1+ j)))))
(defun local-chain (n previous first-end)
(let ((j 1))
(while (<= j n)
--- 14,25 ----
(defun caller (n) (format "caller%d" n))
(defun local (n) (format "l%d" n))
(defun local-sum (n)
! (if (zerop n) (insert "0")
! (let ((j 1))
! (while (<= j n)
! (insert (local j))
! (if (< j n) (insert "+"))
! (setq j (1+ j))))))
(defun local-chain (n previous first-end)
(let ((j 1))
(while (<= j n)
***************
*** 53,60 ****
(insert "{\n")
(local-chain i "n" (callee i))
(insert " return ")
! (if (<= i 0) (insert "n")
! (local-sum i))
(insert ";\n")
(insert "}\n\n")
(setq i (1+ i))))
--- 54,60 ----
(insert "{\n")
(local-chain i "n" (callee i))
(insert " return ")
! (local-sum i)
(insert ";\n")
(insert "}\n\n")
(setq i (1+ i))))
***************
*** 103,109 ****
int
callee0 (int n)
{
! return n;
}
/* Returns n * 1 + 1 */
--- 103,109 ----
int
callee0 (int n)
{
! return 0;
}
/* Returns n * 1 + 1 */