From 76fb9ae78b0e93c675d0507923f40b57120306a7 Mon Sep 17 00:00:00 2001 From: Joshua Saxby <joshua.a.saxby@gmail.com> Date: Sat, 30 Nov 2019 11:51:47 +0000 Subject: [PATCH] Remove debugging code --- userprog/parse_arguments.c | 3 --- userprog/process.c | 5 ----- 2 files changed, 8 deletions(-) diff --git a/userprog/parse_arguments.c b/userprog/parse_arguments.c index 785058f..a78d203 100644 --- a/userprog/parse_arguments.c +++ b/userprog/parse_arguments.c @@ -5,19 +5,16 @@ int parse_arguments(const char* command_line, char**argv) { - printf("parse_arguments(command_line) = '%s'\n", command_line); int argc = 0; // the state pointer required by strtok_r() for use between calls char* state_pointer; // first call to strtok_r() is the only one where string to parse is passed argv[0] = strtok_r(command_line, " ", &state_pointer); - printf("parse_arguments(): argv[0] = '%s'\n", argv[0]); argc++; // now, parse token-by-token for any additional arguments char* token = strtok_r(NULL, " ", &state_pointer); while (token != NULL) { argv[argc] = token; - printf("parse_arguments(): argv[%d] = '%s'\n", argc, argv[argc]); argc++; token = strtok_r(NULL, " ", &state_pointer); } diff --git a/userprog/process.c b/userprog/process.c index 34c5aa6..5dfa0a2 100644 --- a/userprog/process.c +++ b/userprog/process.c @@ -234,16 +234,11 @@ load (const char *command, void (**eip) (void), void **esp) // extract arguments (including file name) // NOTE: decide how many arguments we want --is 255 the standard number? char* argv[255]; - printf("load(command) = '%s'\n", command); // copy the command string so we have a separate copy to manipulate // generous length limit based on 255 arguments that are 15 chars long each char command_copy[255]; strlcpy(command_copy, command, 255); - printf("load(): command_copy = '%s'\n", command_copy); int argc = parse_arguments(command_copy, argv); - for (int i = 0; i < argc; i++) { - printf("load(): argv[%d] = '%s'\n", i, argv[i]); - } char* file_name = argv[0]; // file name is always argument 0 /* Allocate and activate page directory. */ -- GitLab