mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-14 17:28:07 +00:00
normalize paths with inconsistent slashes
This commit is contained in:
@@ -771,7 +771,7 @@ d_lines_array_from_dbgi_key_file_path_line_range(Arena *arena, DI_Key dbgi_key,
|
|||||||
override_n = override_n->next)
|
override_n = override_n->next)
|
||||||
{
|
{
|
||||||
String8 file_path = override_n->string;
|
String8 file_path = override_n->string;
|
||||||
String8 file_path_normalized = lower_from_str8(scratch.arena, path_normalized_from_string(scratch.arena, file_path));
|
String8 file_path_normalized = rdim_normalize_path_str8(scratch.arena, file_path);
|
||||||
|
|
||||||
// rjf: binary -> rdi
|
// rjf: binary -> rdi
|
||||||
RDI_Parsed *rdi = di_rdi_from_key(access, dbgi_key, 0, 0);
|
RDI_Parsed *rdi = di_rdi_from_key(access, dbgi_key, 0, 0);
|
||||||
@@ -864,7 +864,7 @@ d_lines_array_from_file_path_line_range(Arena *arena, String8 file_path, Rng1S64
|
|||||||
override_n = override_n->next)
|
override_n = override_n->next)
|
||||||
{
|
{
|
||||||
String8 file_path = override_n->string;
|
String8 file_path = override_n->string;
|
||||||
String8 file_path_normalized = lower_from_str8(scratch.arena, file_path);
|
String8 file_path_normalized = rdim_normalize_path_str8(scratch.arena, file_path);
|
||||||
for EachIndex(idx, dbgi_keys.count)
|
for EachIndex(idx, dbgi_keys.count)
|
||||||
{
|
{
|
||||||
Access *access = access_open();
|
Access *access = access_open();
|
||||||
|
|||||||
@@ -255,6 +255,20 @@ rdim_lower_from_str8(RDIM_Arena *arena, RDIM_String8 string)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RDI_PROC RDIM_String8
|
||||||
|
rdim_normalize_path_str8(RDIM_Arena *arena, RDIM_String8 path)
|
||||||
|
{
|
||||||
|
RDIM_String8 result = rdim_lower_from_str8(arena, path);
|
||||||
|
for(RDI_U64 i = 0; i < result.RDIM_String8_SizeMember; i += 1)
|
||||||
|
{
|
||||||
|
if(result.RDIM_String8_BaseMember[i] == '\\')
|
||||||
|
{
|
||||||
|
result.RDIM_String8_BaseMember[i] = '/';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
//- rjf: string lists
|
//- rjf: string lists
|
||||||
|
|
||||||
RDI_PROC void
|
RDI_PROC void
|
||||||
|
|||||||
@@ -1570,6 +1570,7 @@ RDI_PROC RDI_S32 rdim_str8_match(RDIM_String8 a, RDIM_String8 b, RDIM_StringMatc
|
|||||||
#define rdim_str8_struct(S) rdim_str8((RDI_U8*)(S), sizeof(*(S)))
|
#define rdim_str8_struct(S) rdim_str8((RDI_U8*)(S), sizeof(*(S)))
|
||||||
#define rdim_str8_struct_array(S, C) rdim_str8((RDI_U8*)(S), sizeof(*(S)) * (C))
|
#define rdim_str8_struct_array(S, C) rdim_str8((RDI_U8*)(S), sizeof(*(S)) * (C))
|
||||||
RDI_PROC RDIM_String8 rdim_lower_from_str8(RDIM_Arena *arena, RDIM_String8 string);
|
RDI_PROC RDIM_String8 rdim_lower_from_str8(RDIM_Arena *arena, RDIM_String8 string);
|
||||||
|
RDI_PROC RDIM_String8 rdim_normalize_path_str8(RDIM_Arena *arena, RDIM_String8 path);
|
||||||
|
|
||||||
//- rjf: string lists
|
//- rjf: string lists
|
||||||
RDI_PROC void rdim_str8_list_push(RDIM_Arena *arena, RDIM_String8List *list, RDIM_String8 string);
|
RDI_PROC void rdim_str8_list_push(RDIM_Arena *arena, RDIM_String8List *list, RDIM_String8 string);
|
||||||
|
|||||||
@@ -2248,7 +2248,7 @@ RD_VIEW_UI_FUNCTION_DEF(text)
|
|||||||
for EachNode(override_n, String8Node, overrides.first)
|
for EachNode(override_n, String8Node, overrides.first)
|
||||||
{
|
{
|
||||||
String8 file_path = override_n->string;
|
String8 file_path = override_n->string;
|
||||||
String8 file_path_normalized = lower_from_str8(scratch.arena, path_normalized_from_string(scratch.arena, file_path));
|
String8 file_path_normalized = rdim_normalize_path_str8(scratch.arena, file_path);
|
||||||
B32 good_src_id = 0;
|
B32 good_src_id = 0;
|
||||||
U32 src_id = 0;
|
U32 src_id = 0;
|
||||||
if(rdi != &rdi_parsed_nil)
|
if(rdi != &rdi_parsed_nil)
|
||||||
|
|||||||
@@ -855,7 +855,7 @@ rdim_bake(Arena *arena, RDIM_BakeParams *params)
|
|||||||
Rng1U64 range = lane_range(n->count);
|
Rng1U64 range = lane_range(n->count);
|
||||||
for EachInRange(n_idx, range)
|
for EachInRange(n_idx, range)
|
||||||
{
|
{
|
||||||
RDIM_String8 normalized_path = rdim_lower_from_str8(arena, n->v[n_idx].path);
|
RDIM_String8 normalized_path = rdim_normalize_path_str8(arena, n->v[n_idx].path);
|
||||||
rdim_bake_string_map_loose_insert(arena, top, lane_map, 1, normalized_path);
|
rdim_bake_string_map_loose_insert(arena, top, lane_map, 1, normalized_path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1141,7 +1141,7 @@ rdim_bake(Arena *arena, RDIM_BakeParams *params)
|
|||||||
for EachInRange(n_idx, n_range)
|
for EachInRange(n_idx, n_range)
|
||||||
{
|
{
|
||||||
RDIM_SrcFile *src_file = &n->v[n_idx];
|
RDIM_SrcFile *src_file = &n->v[n_idx];
|
||||||
RDIM_String8 normalized_path = rdim_lower_from_str8(arena, src_file->path);
|
RDIM_String8 normalized_path = rdim_normalize_path_str8(arena, src_file->path);
|
||||||
rdim_bake_name_map_insert(scratch.arena, top, map, 4, normalized_path, rdim_idx_from_src_file(src_file));
|
rdim_bake_name_map_insert(scratch.arena, top, map, 4, normalized_path, rdim_idx_from_src_file(src_file));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1990,7 +1990,7 @@ rdim_bake(Arena *arena, RDIM_BakeParams *params)
|
|||||||
|
|
||||||
//- rjf: fill file info
|
//- rjf: fill file info
|
||||||
Temp scratch = scratch_begin(&arena, 1);
|
Temp scratch = scratch_begin(&arena, 1);
|
||||||
String8 normalized_path = rdim_lower_from_str8(scratch.arena, src->path);
|
String8 normalized_path = rdim_normalize_path_str8(scratch.arena, src->path);
|
||||||
B32 has_checksum = (RDI_ChecksumKind_NULL < src->checksum_kind && src->checksum_kind < RDI_ChecksumKind_COUNT && src->checksum.size != 0);
|
B32 has_checksum = (RDI_ChecksumKind_NULL < src->checksum_kind && src->checksum_kind < RDI_ChecksumKind_COUNT && src->checksum.size != 0);
|
||||||
dst->file_path_node_idx = rdim_bake_path_node_idx_from_string(path_tree, src->path);
|
dst->file_path_node_idx = rdim_bake_path_node_idx_from_string(path_tree, src->path);
|
||||||
dst->normal_full_path_string_idx = rdim_bake_idx_from_string(bake_strings, normalized_path);
|
dst->normal_full_path_string_idx = rdim_bake_idx_from_string(bake_strings, normalized_path);
|
||||||
|
|||||||
Reference in New Issue
Block a user