undid changes to debugger runtime

This commit is contained in:
n00b87
2026-03-04 02:53:12 -06:00
parent 12d34ec8cc
commit c4573e87f7

View File

@@ -677,21 +677,19 @@ double readDouble()
void dbg_1(uint32_t dbg_fn, uint64_t arg1, uint64_t arg2)
{
#ifdef RCBASIC_DEBUG
//#ifdef RCBASIC_DEBUG
//output_debug_message();
switch(dbg_fn)
{
case 0:
current_src_file = arg1;
current_src_line = arg2;
std::string dfile = dbg_files[current_src_file];
//std::cerr << "file: " << arg1 << " line: " << arg2 << std::endl;
//std::cerr << "file: " << dfile << " -> line: " << current_src_line << std::endl;
//current_src_file = arg1;
//current_src_line = arg2;
std::cout << "file: " << arg1 << " line: " << arg2 << std::endl;
break;
}
#endif // RCBASIC_DEBUG
//#endif // RCBASIC_DEBUG
}
void mov_32(int n1, int n2)
@@ -706,71 +704,40 @@ void mov_33(int n1, double val)
}
void mov_34(int n1, uint64_t nid)
{
#ifdef RCBASIC_DEBUG
uint64_t byref_offset = num_var[nid].byref_offset;
if(byref_offset >= num_var[nid].nref[0].value.size())
{
dbg_error_found = true;
dbg_error_message = DBG_INDEX_EXCEEDS_SIZE;
return;
}
vm_n[n1].value = num_var[nid].nref[0].value[byref_offset];
vm_n[n1].r = num_var[nid].nref;
vm_n[n1].r_index = byref_offset;
if(!num_var[nid].is_debug_var)
return;
rcbasic_debug_access_status tmp_stat;
tmp_stat.type = RCBASIC_DEBUG_ACCESS_GET;
tmp_stat.dimensions = num_var[nid].dimensions;
tmp_stat.dim[0] = byref_offset;
tmp_stat.num_val = vm_n[n1].value;
dbg_vars[num_var[nid].dbg_var_index].usage_data.push_back(tmp_stat);
return;
#else
{
uint64_t byref_offset = num_var[nid].byref_offset;
vm_n[n1].value = num_var[nid].nref[0].value[byref_offset];
vm_n[n1].r = num_var[nid].nref;
vm_n[n1].r_index = byref_offset;
vm_n[n1].r_index = byref_offset;
#ifdef RCBASIC_DEBUG
if(!num_var[nid].is_debug_var)
return;
rcbasic_debug_access_status tmp_stat;
tmp_stat.type = RCBASIC_DEBUG_ACCESS_GET;
tmp_stat.dimensions = num_var[nid].dimensions;
tmp_stat.dim[0] = byref_offset;
tmp_stat.num_val = vm_n[n1].value;
dbg_vars[num_var[nid].dbg_var_index].usage_data.push_back(tmp_stat);
#endif // RCBASIC_DEBUG
//cout << "n" << n1 << " = " << vm_n[n1].value << endl;
}
void mov_35(uint64_t nid, int n1)
{
#ifdef RCBASIC_DEBUG
uint64_t byref_offset = num_var[nid].byref_offset;
if(byref_offset >= num_var[nid].nref[0].value.size())
{
dbg_error_found = true;
dbg_error_message = DBG_INDEX_EXCEEDS_SIZE;
return;
}
num_var[nid].nref[0].value[byref_offset] = vm_n[n1].value;
if(!num_var[nid].is_debug_var)
return;
rcbasic_debug_access_status tmp_stat;
tmp_stat.type = RCBASIC_DEBUG_ACCESS_SET;
tmp_stat.dimensions = num_var[nid].dimensions;
tmp_stat.dim[0] = byref_offset;
tmp_stat.num_val = vm_n[n1].value;
dbg_vars[num_var[nid].dbg_var_index].usage_data.push_back(tmp_stat);
return;
#else
{
uint64_t byref_offset = num_var[nid].byref_offset;
num_var[nid].nref[0].value[byref_offset] = vm_n[n1].value;
num_var[nid].nref[0].value[byref_offset] = vm_n[n1].value;
#ifdef RCBASIC_DEBUG
if(!num_var[nid].is_debug_var)
return;
rcbasic_debug_access_status tmp_stat;
tmp_stat.type = RCBASIC_DEBUG_ACCESS_SET;
tmp_stat.dimensions = num_var[nid].dimensions;
tmp_stat.dim[0] = byref_offset;
tmp_stat.num_val = vm_n[n1].value;
dbg_vars[num_var[nid].dbg_var_index].usage_data.push_back(tmp_stat);
#endif // RCBASIC_DEBUG
//cout << "n" << n1 << " = " << vm_n[n1].value << endl;
@@ -796,70 +763,38 @@ void movS_37(int s1, uint64_t str_addr)
}
void movS_38(int s1, uint64_t sid)
{
#ifdef RCBASIC_DEBUG
uint64_t byref_offset = str_var[sid].byref_offset;
if(byref_offset >= str_var[sid].sref[0].value.size())
{
dbg_error_found = true;
dbg_error_message = DBG_INDEX_EXCEEDS_SIZE;
return;
}
vm_s[s1].value = str_var[sid].sref[0].value[byref_offset];
vm_s[s1].r = str_var[sid].sref;
vm_s[s1].r_index = byref_offset;
if(!str_var[sid].is_debug_var)
return;
rcbasic_debug_access_status tmp_stat;
tmp_stat.type = RCBASIC_DEBUG_ACCESS_GET;
tmp_stat.dimensions = str_var[sid].dimensions;
tmp_stat.dim[0] = byref_offset;
tmp_stat.str_val = vm_s[s1].value;
dbg_vars[str_var[sid].dbg_var_index].usage_data.push_back(tmp_stat);
return;
#else
{
uint64_t byref_offset = str_var[sid].byref_offset;
vm_s[s1].value = str_var[sid].sref[0].value[byref_offset];
vm_s[s1].r = str_var[sid].sref;
vm_s[s1].r_index = byref_offset;
vm_s[s1].r_index = byref_offset;
#ifdef RCBASIC_DEBUG
if(!str_var[sid].is_debug_var)
return;
rcbasic_debug_access_status tmp_stat;
tmp_stat.type = RCBASIC_DEBUG_ACCESS_GET;
tmp_stat.dimensions = str_var[sid].dimensions;
tmp_stat.dim[0] = byref_offset;
tmp_stat.str_val = vm_s[s1].value;
dbg_vars[str_var[sid].dbg_var_index].usage_data.push_back(tmp_stat);
#endif // RCBASIC_DEBUG
}
void movS_39(uint64_t sid, int s1)
{
#ifdef RCBASIC_DEBUG
uint64_t byref_offset = str_var[sid].byref_offset;
if(byref_offset >= str_var[sid].sref[0].value.size())
{
dbg_error_found = true;
dbg_error_message = DBG_INDEX_EXCEEDS_SIZE;
return;
}
str_var[sid].sref[0].value[byref_offset] = vm_s[s1].value;
if(!str_var[sid].is_debug_var)
return;
rcbasic_debug_access_status tmp_stat;
tmp_stat.type = RCBASIC_DEBUG_ACCESS_SET;
tmp_stat.dimensions = str_var[sid].dimensions;
tmp_stat.dim[0] = byref_offset;
tmp_stat.str_val = vm_s[s1].value;
dbg_vars[str_var[sid].dbg_var_index].usage_data.push_back(tmp_stat);
return;
#else
{
uint64_t byref_offset = str_var[sid].byref_offset;
str_var[sid].sref[0].value[byref_offset] = vm_s[s1].value;
str_var[sid].sref[0].value[byref_offset] = vm_s[s1].value;
#ifdef RCBASIC_DEBUG
if(!str_var[sid].is_debug_var)
return;
rcbasic_debug_access_status tmp_stat;
tmp_stat.type = RCBASIC_DEBUG_ACCESS_SET;
tmp_stat.dimensions = str_var[sid].dimensions;
tmp_stat.dim[0] = byref_offset;
tmp_stat.str_val = vm_s[s1].value;
dbg_vars[str_var[sid].dbg_var_index].usage_data.push_back(tmp_stat);
#endif // RCBASIC_DEBUG
}
@@ -867,10 +802,7 @@ void mov_r_40(int n1, int n2)
{
vm_n[n1].r[0].value[ vm_n[n1].r_index ] = vm_n[n2].value;
#ifdef RCBASIC_DEBUG
if(vm_n[n1].dbg_var_index < 0 || vm_n[n1].dbg_var_index >= dbg_vars.size())
return;
#ifdef RCBASIC_DEBUG
for(int i = 0; i < dbg_vars[vm_n[n1].dbg_var_index].usage_data.size(); i++)
{
if(dbg_vars[vm_n[n1].dbg_var_index].usage_data[i].reg==n1)
@@ -887,10 +819,7 @@ void mov_rS_41(int s1, int s2)
{
vm_s[s1].r[0].value[ vm_s[s1].r_index ] = vm_s[s2].value;
#ifdef RCBASIC_DEBUG
if(vm_s[s1].dbg_var_index < 0 || vm_s[s1].dbg_var_index >= dbg_vars.size())
return;
#ifdef RCBASIC_DEBUG
for(int i = 0; i < dbg_vars[vm_s[s1].dbg_var_index].usage_data.size(); i++)
{
if(dbg_vars[vm_s[s1].dbg_var_index].usage_data[i].reg==s1)
@@ -1127,9 +1056,7 @@ void obj_num_73(uint64_t nid)
tmp_stat.is_error = true;
}
else
{
tmp_stat.num_val = num_var[nid].nref[0].value[num_object.index];
}
tmp_stat.num_val = num_var[nid].nid_value[0].value[num_object.index];
dbg_vars[num_var[nid].dbg_var_index].usage_data.push_back(tmp_stat);
#endif // RCBASIC_DEBUG
}
@@ -1169,7 +1096,7 @@ void obj_num1_74(uint64_t nid, int n1)
tmp_stat.is_error = true;
}
else
tmp_stat.num_val = num_var[nid].nref[0].value[num_object.index];
tmp_stat.num_val = num_var[nid].nid_value[0].value[num_object.index];
dbg_vars[num_var[nid].dbg_var_index].usage_data.push_back(tmp_stat);
#endif // RCBASIC_DEBUG
}
@@ -1210,7 +1137,7 @@ void obj_num2_75(uint64_t nid, int n1, int n2)
tmp_stat.is_error = true;
}
else
tmp_stat.num_val = num_var[nid].nref[0].value[num_object.index];
tmp_stat.num_val = num_var[nid].nid_value[0].value[num_object.index];
dbg_vars[num_var[nid].dbg_var_index].usage_data.push_back(tmp_stat);
#endif // RCBASIC_DEBUG
}
@@ -1252,7 +1179,7 @@ void obj_num3_76(uint64_t nid, int n1, int n2, int n3)
tmp_stat.is_error = true;
}
else
tmp_stat.num_val = num_var[nid].nref[0].value[num_object.index];
tmp_stat.num_val = num_var[nid].nid_value[0].value[num_object.index];
dbg_vars[num_var[nid].dbg_var_index].usage_data.push_back(tmp_stat);
#endif // RCBASIC_DEBUG
}
@@ -1290,7 +1217,7 @@ void obj_str_77(uint64_t sid)
tmp_stat.is_error = true;
}
else
tmp_stat.str_val = str_var[sid].sref[0].value[str_object.index];
tmp_stat.str_val = str_var[sid].sid_value[0].value[str_object.index];
dbg_vars[str_var[sid].dbg_var_index].usage_data.push_back(tmp_stat);
#endif // RCBASIC_DEBUG
}
@@ -1327,7 +1254,7 @@ void obj_str1_78(uint64_t sid, int n1)
tmp_stat.is_error = true;
}
else
tmp_stat.str_val = str_var[sid].sref[0].value[str_object.index];
tmp_stat.str_val = str_var[sid].sid_value[0].value[str_object.index];
dbg_vars[str_var[sid].dbg_var_index].usage_data.push_back(tmp_stat);
#endif // RCBASIC_DEBUG
}
@@ -1368,7 +1295,7 @@ void obj_str2_79(uint64_t sid, int n1, int n2)
tmp_stat.is_error = true;
}
else
tmp_stat.str_val = str_var[sid].sref[0].value[str_object.index];
tmp_stat.str_val = str_var[sid].sid_value[0].value[str_object.index];
dbg_vars[str_var[sid].dbg_var_index].usage_data.push_back(tmp_stat);
#endif // RCBASIC_DEBUG
}
@@ -1410,7 +1337,7 @@ void obj_str3_80(uint64_t sid, int n1, int n2, int n3)
tmp_stat.is_error = true;
}
else
tmp_stat.str_val = str_var[sid].sref[0].value[str_object.index];
tmp_stat.str_val = str_var[sid].sid_value[0].value[str_object.index];
dbg_vars[str_var[sid].dbg_var_index].usage_data.push_back(tmp_stat);
#endif // RCBASIC_DEBUG
}
@@ -2092,7 +2019,7 @@ void next_118(uint64_t f_addr)
tmp_stat.dim[1] = loop_stack.top().counter_dim[1];
tmp_stat.dim[2] = loop_stack.top().counter_dim[2];
tmp_stat.type = RCBASIC_DEBUG_ACCESS_SET;
tmp_stat.num_val = loop_stack.top().counter[0].nref[0].value[byref_offset];
tmp_stat.num_val = loop_stack.top().counter[0].nid_value[0].value[byref_offset];
dbg_vars[loop_stack.top().counter[0].dbg_var_index].usage_data.push_back(tmp_stat);
}
#endif // RCBASIC_DEBUG
@@ -2111,7 +2038,7 @@ void next_118(uint64_t f_addr)
tmp_stat.dim[1] = loop_stack.top().counter_dim[1];
tmp_stat.dim[2] = loop_stack.top().counter_dim[2];
tmp_stat.type = RCBASIC_DEBUG_ACCESS_SET;
tmp_stat.num_val = loop_stack.top().counter[0].nref[0].value[byref_offset];
tmp_stat.num_val = loop_stack.top().counter[0].nid_value[0].value[byref_offset];
dbg_vars[loop_stack.top().counter[0].dbg_var_index].usage_data.push_back(tmp_stat);
}
#endif // RCBASIC_DEBUG
@@ -4474,7 +4401,7 @@ int main(int argc, char * argv[])
if(rc_filename.compare("--version")==0)
{
cout << "RCBASIC Runtime v4.9" << endl;
cout << "RCBASIC Runtime v4.8" << endl;
return 0;
}