Skip to content

Commit

Permalink
버그 수정 및 prj3 구현 완료
Browse files Browse the repository at this point in the history
  • Loading branch information
limdongjin committed May 3, 2019
1 parent 6dca552 commit b8b3815
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 103 deletions.
14 changes: 6 additions & 8 deletions command_execute.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ shell_status execute_progaddr(Command *user_command, State *state_store) {

state_store->debugger_state->start_address = addr;
fprintf(stdout, "Program starting address set to 0x%04X.\n", addr);
state_store->debugger_state->is_loaded = false;
return EXECUTE_SUCCESS;
}

Expand All @@ -295,15 +296,11 @@ shell_status execute_progaddr(Command *user_command, State *state_store) {
* [TODO] run 명령어 실행 구현 하기!
*/
shell_status execute_run(State *state_store){
printf("====DEBUG=========\n");
printf("start: %04X\n", state_store->debugger_state->start_address); // 디버깅용
execute_bp_list(state_store); // 디버깅용
printf("bp_count: %d\n", state_store->debugger_state->bp_count);
printf("run_count: %d\n",state_store->debugger_state->run_count);
printf("previous_bp: %04X\n", state_store->debugger_state->previous_bp);
printf("====DEBUG=========\n");
bool status;

if(!state_store->debugger_state->is_loaded){
fprintf(stderr, "[ERROR] Not Loaded\n");
return EXECUTE_FAIL;
}
if(!state_store->debugger_state->is_running){
state_store->debugger_state->registers->PC = state_store->debugger_state->start_address;
}
Expand Down Expand Up @@ -370,6 +367,7 @@ shell_status execute_loader(Command *user_command, State *state_store) {
state_store->debugger_state->previous_bp = -1;
// state_store->debugger_state->end_address 설정 해주기.
state_store->debugger_state->end_address = MAX_BP_NUM - 1;
state_store->debugger_state->is_loaded = true;

return EXECUTE_SUCCESS;
}
Expand Down
3 changes: 3 additions & 0 deletions copy.obj
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ T00001D130F20160100030F200D4B10105D3E2003454F46
T0010361DB410B400B44075101000E32019332FFADB2013A00433200857C003B850
T0010531D3B2FEA1340004F0000F1B410774000E32011332FFA53C003DF2008B850
T001070073B2FEF4F000005
M00000705
M00001405
M00002705
E000000
Loading

0 comments on commit b8b3815

Please sign in to comment.