Skip to content

Commit

Permalink
add breakpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
4shub committed Apr 3, 2018
1 parent a52f939 commit 5df1b57
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions userprog/UserProcess.java
Original file line number Diff line number Diff line change
Expand Up @@ -607,21 +607,22 @@ private int handleJoin(int childProcessId, int status) {

// join thread
childProcess.thread.join();
Lib.debug(dbgProcess, Type + "Break 1");
// unregister the child
UserKernel.unregisterProcess(childProcessId);
Lib.debug(dbgProcess, Type + "Break 2");
// store exit status
byte temp[] = new byte[4];
temp = Lib.bytesFromInt(childProcess.exitStatus);
int cntBytes = writeVirtualMemory(status, temp);
Lib.debug(dbgProcess, Type + "Break 3");
if (cntBytes != 4) {
return 1;
}

Lib.debug(dbgProcess, Type + "Break 4");
return 0;

// unregister the child
// UserKernel.unregisterProcess(childProcessId);
//
// // store exit status
// byte temp[] = new byte[4];
// temp = Lib.bytesFromInt(childProcess.exitStatus);
// int cntBytes = writeVirtualMemory(status, temp);
//
// if (cntBytes != 4) {
// return 1;
// }
//
// return 0;
}
private int handleExit(int exitStatus) {
Lib.debug(dbgProcess, "handleExit()");
Expand Down

0 comments on commit 5df1b57

Please sign in to comment.