filter markers by default in explorer

This commit is contained in:
2026-04-21 12:21:15 +02:00
parent 51fb2ef4d4
commit ed0a3b67de

View File

@ -23,8 +23,8 @@ my $local_archive_dir = "$local_root/injections";
# Select experiment to open # Select experiment to open
my @experiments = Util::find_subdirs($local_archive_dir); my @experiments = Util::find_subdirs($local_archive_dir);
my @selected_experiments = my @selected_experiments =
TUI::select_from_list( "Select Archived Experiments to Delete", TUI::select_from_list( "Select Archived Experiment to Open", 0,
0, @experiments ); @experiments );
die "No experiment selected" unless @selected_experiments; die "No experiment selected" unless @selected_experiments;
my $selected_experiment = $selected_experiments[0]; my $selected_experiment = $selected_experiments[0];
@ -60,7 +60,7 @@ my @selected_benchs = @benchs;
my %index_of_benchs; my %index_of_benchs;
@index_of_benchs{@benchs} = 0 .. $#benchs; @index_of_benchs{@benchs} = 0 .. $#benchs;
my @selected_markers = @markers; my @selected_markers = ("FAIL_MARKER");
my %index_of_markers; my %index_of_markers;
@index_of_markers{@markers} = 0 .. $#markers; @index_of_markers{@markers} = 0 .. $#markers;
@ -118,6 +118,7 @@ sub filter_marker_values {
# How much to disassemble around the address / how many lines to show # How much to disassemble around the address / how many lines to show
my $region_size = $cui->height() / 2 - 2; my $region_size = $cui->height() / 2 - 2;
my $asm_region_size = $region_size + 120;
my %assembly_cache; my %assembly_cache;
@ -167,8 +168,8 @@ sub load_assembly_elf {
if ( !exists $assembly_cache{$address} ) { if ( !exists $assembly_cache{$address} ) {
my $file = "$local_archive_dir/$selected_experiment/system.elf"; my $file = "$local_archive_dir/$selected_experiment/system.elf";
my $start = $address - $region_size - 120; my $start = $address - $asm_region_size;
my $end = $address + $region_size + 120; my $end = $address + $asm_region_size;
my $objdump_address = lc substr( $marker->{fault_address}, 2 ); my $objdump_address = lc substr( $marker->{fault_address}, 2 );
@ -261,16 +262,18 @@ sub load_source_c {
my $line = $lines[1]; # Ignore possible further lines my $line = $lines[1]; # Ignore possible further lines
my ( $sourcefile, $lineno ) = split ":", $line; my ( $sourcefile, $lineno ) = split ":", $line;
($lineno) = $lineno =~ /^(\d+)/; ($lineno) = $lineno =~ /^(\d+)/;
$sourcefile = remap_source_path($sourcefile); my $remapped = remap_source_path($sourcefile);
my $source_region = read_source_file( $sourcefile, $lineno ); my $source_region = read_source_file( $remapped, $lineno );
if ( !defined $source_region or length($source_region) == 0 ) { if ( !defined $source_region or length($source_region) == 0 ) {
$source_text = "Failed to Read Source: $sourcefile:$lineno"; $source_text = "Failed to Read Source: $location";
$source_file = "Unknown";
$source_line = "Unknown";
return; return;
} }
$source_cache{$address} = $source_region; $source_cache{$address} = $source_region;
$source_file_cache{$address} = $sourcefile; $source_file_cache{$address} = $remapped;
$source_line_cache{$address} = $lineno; $source_line_cache{$address} = $lineno;
} }
@ -283,7 +286,7 @@ sub load_source_c {
# UI Layout # UI Layout
# ============================================================================= # =============================================================================
my $win = $cui->add( 'root', 'Window' ); my $win = $cui->add( 'explorer', 'Window' );
my $left = $win->add( 'left', 'Container' ); # , -padbottom => 1, my $left = $win->add( 'left', 'Container' ); # , -padbottom => 1,
my $middle = $win->add( 'middle', 'Container' ); # , -padbottom => 1, my $middle = $win->add( 'middle', 'Container' ); # , -padbottom => 1,
@ -345,7 +348,7 @@ $win->add(
'info', 'Label', 'info', 'Label',
-y => -1, -y => -1,
-text => -text =>
"Space = toggle, F = filter markers, O = open source, P = open assembly, R = resize, Q = quit", "Space = toggle, F = filter markers, S = open source, A = open assembly, R = resize, Q = quit",
); );
sub set_geometry { sub set_geometry {
@ -540,7 +543,7 @@ $win->set_binding(
sub { sub {
system( 'neovide', '--fork', $source_file, '--', "+$source_line" ); system( 'neovide', '--fork', $source_file, '--', "+$source_line" );
}, },
'o', 's',
); );
my $objdump_out; my $objdump_out;
@ -581,7 +584,7 @@ $win->set_binding(
system( 'neovide', '--fork', $temp_file ); system( 'neovide', '--fork', $temp_file );
} }
}, },
'p', 'a',
); );
$win->set_binding( $win->set_binding(
@ -603,6 +606,7 @@ $win->set_binding(
# ============================================================================= # =============================================================================
load_faults_csv(); load_faults_csv();
filter_marker_values();
layout_resize(); layout_resize();
$markers_panel->focus(); $markers_panel->focus();
@ -610,4 +614,4 @@ $refresh_panels->();
$cui->mainloop(); $cui->mainloop();
$cui->leave_curses(); $cui->leave_curses();
$cui->delete('root'); $cui->delete('explorer');