Skip to content

Commit

Permalink
start_addr type 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
limdongjin committed May 3, 2019
1 parent ad81d74 commit a3003c0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion command_execute.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ shell_status execute_symbol(State *state_store) {
shell_status execute_progaddr(Command *user_command, State *state_store) {
int addr = (int)strtol(user_command->tokens[1], NULL, 16);

state_store->debugger_state->start_address = addr;
state_store->debugger_state->start_address = (uint32_t)addr;
fprintf(stdout, "Program starting address set to 0x%04X.\n", addr);
state_store->debugger_state->is_loaded = false;
return EXECUTE_SUCCESS;
Expand Down
6 changes: 3 additions & 3 deletions debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ bool run(Debugger *debugger, Memories *memories){
is_continue = false;
}

registers->PC = debugger->start_address + debugger->load_infos->list[0].length;
registers->PC = debugger->start_address + (uint32_t)debugger->load_infos->list[0].length;
print_registers(registers);

debugger->previous_bp = -1;
Expand All @@ -300,7 +300,7 @@ static bool loader_linker_pass1(Debugger *debugger) {
debugger->estab = construct_symbol_table();
debugger->load_infos = construct_load_info_list();

int csaddr = debugger->start_address;
int csaddr = (int)debugger->start_address;

for(int i = 0; i < debugger->file_count; i++){
int status;
Expand Down Expand Up @@ -391,7 +391,7 @@ static bool loader_linker_pass1_one(Debugger *debugger, int file_num, int *csadd
}

static bool loader_linker_pass2(Debugger *debugger, Memories *memories){
int csaddr = debugger->start_address;
int csaddr = (int)debugger->start_address;

for(int i = 0; i < debugger->file_count; i++){
int status;
Expand Down
2 changes: 1 addition & 1 deletion debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ typedef struct load_info_list {

// load, run, bp, 레지스터 관리 등의 역활을함.
typedef struct debugger {
int start_address; // 10 진수로 변환하여 저장함.
uint32_t start_address; // 10 진수로 변환하여 저장함.
int end_address;
bool break_points[MAX_BP_NUM]; // 해당 셀에 브레이크포인트가 걸렸는지 안걸렸는지 여부 저장
int bp_count; // 브레이크 포인트 개수
Expand Down

0 comments on commit a3003c0

Please sign in to comment.