Compare commits

..

2 Commits

Author SHA1 Message Date
beadbae5bf disable trace pruning 2026-05-11 15:52:15 +02:00
40b8ba078a show experiment info when importing into ghidra 2026-05-11 15:52:07 +02:00
2 changed files with 34 additions and 20 deletions

View File

@ -110,7 +110,7 @@ my %handlers = (
my @existing = Util::find_files($local_ghidra_projects);
# Determine if an experiment was already imported
my $is_old = sub {
my $project_exists = sub {
my ($name) = @_;
$name =~ s/:/-/g;
@ -119,23 +119,37 @@ my %handlers = (
# Import archived experiments into ghidra
my @dirs =
grep { !$is_old->($_) } Util::find_subdirs($local_archive_dir);
grep { !$project_exists->($_) }
Util::find_subdirs($local_archive_dir);
my @dirs_with_notes;
foreach my $dir (@dirs) {
my $info = Util::read_experiment_info($dir);
push @dirs_with_notes,
( defined $info && length($info) > 0 )
? sprintf( "%-50s (%s)", $dir, $info )
: $dir;
}
my @selected_dirs =
TUI::select_from_list( "Select Experiments to Import into Ghidra",
1, @dirs );
1, @dirs_with_notes );
foreach (@selected_dirs) {
say "Creating Ghidra project for $_...";
my $experiment = $_ =~ s/(.*?)\s+\(.+\)$/$1/r;
say "Creating Ghidra project for $experiment...";
system(
'ghidra-analyzeHeadless',
$local_ghidra_projects, $_ =~ s/:/-/gr,
'-import', "$local_archive_dir/$_/system.elf",
'-scriptPath', $local_ghidra_scripts,
'-postScript', 'DWARFLineInfoSourceMapScript',
'-postScript', 'DWARFLineInfoCommentScript',
'-postScript', 'ImportMarkersAsBookmarks',
"$local_archive_dir/$_/faults.csv"
$local_ghidra_projects, $experiment =~ s/:/-/gr,
'-import', "$local_archive_dir/$experiment/system.elf",
'-scriptPath', $local_ghidra_scripts,
'-postScript', 'DWARFLineInfoSourceMapScript',
'-postScript', 'DWARFLineInfoCommentScript',
'-postScript', 'ImportMarkersAsBookmarks',
"$local_archive_dir/$experiment/faults.csv"
);
}
},

View File

@ -176,15 +176,15 @@ sub import_trace {
# )
# );
my $prune_command = join " ",
(
"$fail_prune", "--database-option-file $remote_db_conf",
"-v $experiment", "-b %%",
"--overwrite", ">$remote_builds_dir/$experiment/2_prune.log"
);
say "Prune command: $prune_command";
system($prune_command);
# my $prune_command = join " ",
# (
# "$fail_prune", "--database-option-file $remote_db_conf",
# "-v $experiment", "-b %%",
# "--overwrite", ">$remote_builds_dir/$experiment/2_prune.log"
# );
# say "Prune command: $prune_command";
#
# system($prune_command);
}
sub inject {