mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-03 04:28:12 +00:00
fix empty file edge case in hash store / text cache
This commit is contained in:
@@ -14,10 +14,7 @@ internal U128
|
|||||||
hs_hash_from_data(String8 data)
|
hs_hash_from_data(String8 data)
|
||||||
{
|
{
|
||||||
U128 u128 = {0};
|
U128 u128 = {0};
|
||||||
if(data.size != 0)
|
blake2b((U8 *)&u128.u64[0], sizeof(u128), data.str, data.size, 0, 0);
|
||||||
{
|
|
||||||
blake2b((U8 *)&u128.u64[0], sizeof(u128), data.str, data.size, 0, 0);
|
|
||||||
}
|
|
||||||
return u128;
|
return u128;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,22 +18,27 @@
|
|||||||
// [ ] disasm starting address - need to use debug info for more correct
|
// [ ] disasm starting address - need to use debug info for more correct
|
||||||
// results...
|
// results...
|
||||||
//
|
//
|
||||||
//
|
|
||||||
//
|
|
||||||
// [ ] linked list view rule
|
// [ ] linked list view rule
|
||||||
|
//
|
||||||
// [ ] investigate false exceptions, being reported while stepping through init code
|
// [ ] investigate false exceptions, being reported while stepping through init code
|
||||||
// [ ] output: add option for scroll-to-bottom - ensure this shows up in universal ctx menu
|
// [ ] output: add option for scroll-to-bottom - ensure this shows up in universal ctx menu
|
||||||
// [ ] universal ctx menu address/watch options; e.g. watch -> memory; watch -> add watch
|
//
|
||||||
// [ ] EVAL LOOKUP RULES -> currently going 0 -> rdis_count, but we need
|
// [ ] EVAL LOOKUP RULES -> currently going 0 -> rdis_count, but we need
|
||||||
// to prioritize the primary rdi
|
// to prioritize the primary rdi
|
||||||
|
//
|
||||||
// [ ] (reported by forrest) 'set-next-statement' -> prioritize current
|
// [ ] (reported by forrest) 'set-next-statement' -> prioritize current
|
||||||
// module/symbol, in cases where one line maps to many voffs
|
// module/symbol, in cases where one line maps to many voffs
|
||||||
|
//
|
||||||
// [ ] collapse upstream state for theme/bindings/settings into entities; use cache accelerators if needed to make up difference
|
// [ ] collapse upstream state for theme/bindings/settings into entities; use cache accelerators if needed to make up difference
|
||||||
// [ ] collapse upstream state for windows/panels/tabs into entities; use downstream window/view resource cache to make up the difference
|
// [ ] collapse upstream state for windows/panels/tabs into entities; use downstream window/view resource cache to make up the difference
|
||||||
// [ ] entity <-> mdesk paths
|
// [ ] entity <-> mdesk paths
|
||||||
|
//
|
||||||
|
// [ ] universal ctx menu address/watch options; e.g. watch -> memory; watch -> add watch
|
||||||
// [ ] rich hover coverage; bitmap <-> geo <-> memory <-> disassembly <-> text; etc.
|
// [ ] rich hover coverage; bitmap <-> geo <-> memory <-> disassembly <-> text; etc.
|
||||||
|
//
|
||||||
// [ ] save view column pcts; generalize to being a first-class thing in
|
// [ ] save view column pcts; generalize to being a first-class thing in
|
||||||
// RD_View, e.g. by just having a string -> f32 store
|
// RD_View, e.g. by just having a string -> f32 store
|
||||||
|
//
|
||||||
// [ ] visualize all breakpoints everywhere - source view should show up in
|
// [ ] visualize all breakpoints everywhere - source view should show up in
|
||||||
// disasm, disasm should show up in source view, function should show up in
|
// disasm, disasm should show up in source view, function should show up in
|
||||||
// both, etc.
|
// both, etc.
|
||||||
|
|||||||
@@ -5716,7 +5716,7 @@ RD_VIEW_RULE_UI_FUNCTION_DEF(pending_file)
|
|||||||
{
|
{
|
||||||
HS_Scope *hs_scope = hs_scope_open();
|
HS_Scope *hs_scope = hs_scope_open();
|
||||||
String8 data = hs_data_from_hash(hs_scope, file_hash);
|
String8 data = hs_data_from_hash(hs_scope, file_hash);
|
||||||
if(data.size != 0)
|
if(!u128_match(file_hash, u128_zero()))
|
||||||
{
|
{
|
||||||
U64 num_utf8_bytes = 0;
|
U64 num_utf8_bytes = 0;
|
||||||
U64 num_unknown_bytes = 0;
|
U64 num_unknown_bytes = 0;
|
||||||
@@ -5737,7 +5737,7 @@ RD_VIEW_RULE_UI_FUNCTION_DEF(pending_file)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_is_ready = 1;
|
file_is_ready = 1;
|
||||||
if(num_utf8_bytes > num_unknown_bytes*4)
|
if(num_utf8_bytes > num_unknown_bytes*4 || num_unknown_bytes == 0)
|
||||||
{
|
{
|
||||||
viewer_kind = RD_ViewRuleKind_Text;
|
viewer_kind = RD_ViewRuleKind_Text;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1734,9 +1734,8 @@ rd_code_slice(RD_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe
|
|||||||
mouse_pt = txt_pt(line_num, column);
|
mouse_pt = txt_pt(line_num, column);
|
||||||
|
|
||||||
// rjf: clamp
|
// rjf: clamp
|
||||||
if(dim_1s64(params->line_num_range) > 0)
|
|
||||||
{
|
{
|
||||||
U64 last_line_size = params->line_text[dim_1s64(params->line_num_range)-1].size;
|
U64 last_line_size = params->line_text[dim_1s64(params->line_num_range)].size;
|
||||||
TxtRng legal_pt_rng = txt_rng(txt_pt(params->line_num_range.min, 1),
|
TxtRng legal_pt_rng = txt_rng(txt_pt(params->line_num_range.min, 1),
|
||||||
txt_pt(params->line_num_range.max, last_line_size+1));
|
txt_pt(params->line_num_range.max, last_line_size+1));
|
||||||
if(txt_pt_less_than(mouse_pt, legal_pt_rng.min))
|
if(txt_pt_less_than(mouse_pt, legal_pt_rng.min))
|
||||||
@@ -1748,10 +1747,7 @@ rd_code_slice(RD_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe
|
|||||||
mouse_pt = legal_pt_rng.max;
|
mouse_pt = legal_pt_rng.max;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
mouse_pt = txt_pt(1, 1);
|
|
||||||
}
|
|
||||||
result.mouse_pt = mouse_pt;
|
result.mouse_pt = mouse_pt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2168,7 +2168,7 @@ txt_parse_thread__entry_point(void *p)
|
|||||||
//- rjf: data -> text info
|
//- rjf: data -> text info
|
||||||
Arena *info_arena = 0;
|
Arena *info_arena = 0;
|
||||||
TXT_TextInfo info = {0};
|
TXT_TextInfo info = {0};
|
||||||
if(got_task && data.size != 0)
|
if(got_task && !u128_match(hash, u128_zero()))
|
||||||
{
|
{
|
||||||
info_arena = arena_alloc();
|
info_arena = arena_alloc();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user