# HG changeset patch # User Christian Urban # Date 1412637341 -3600 # Node ID bc1f7c82e1a87c036c9eeaf70d4cae8ca4ffbd6f # Parent 8ddf4fe6bf3195253219ff607a5a3de14c39a010 updated diff -r 8ddf4fe6bf31 -r bc1f7c82e1a8 handouts/ho03.pdf Binary file handouts/ho03.pdf has changed diff -r 8ddf4fe6bf31 -r bc1f7c82e1a8 handouts/ho03.tex --- a/handouts/ho03.tex Tue Oct 07 00:12:29 2014 +0100 +++ b/handouts/ho03.tex Tue Oct 07 00:15:41 2014 +0100 @@ -154,7 +154,8 @@ \item \texttt{(l)ist n} -- listing the source file from line \texttt{n} \item \texttt{disassemble fun-name} -\item \texttt{run} -- starts the program +\item \texttt{run args} -- starts the program, potential +arguments can be given \item \texttt{(b)reak line-number} -- set break point \item \texttt{(c)ontinue} -- continue execution until next breakpoint in a line number diff -r 8ddf4fe6bf31 -r bc1f7c82e1a8 progs/C1.c --- a/progs/C1.c Tue Oct 07 00:12:29 2014 +0100 +++ b/progs/C1.c Tue Oct 07 00:15:41 2014 +0100 @@ -1,17 +1,20 @@ #include #include +#include void dead () { printf("I will never be printed!\n"); exit(1); } +void foo(char *bar) { + char buffer[8]; + strcpy(buffer, bar); +} int main(int argc, char **argv) { - char buffer[8]; - dead(); - strcpy(buffer, argv[1]); + foo(argv[1]); return 1; }