blob: f11f40a23c95f8b224f6e05ff0f4d4a16ae06817 [file] [log] [blame]
yu.dongc33b3072024-08-21 23:14:49 -07001#!/usr/bin/perl
2
3$lisfile = $ARGV[0];
4$output = $ARGV[1];
5
6open (FILE_HANDLE, "<$lisfile") or die "Cannot open $lisfile\n";
7 $backup = $/; undef $/;
8 $reading = <FILE_HANDLE>;
9 $/ = $backup;
10close FILE_HANDLE;
11
12open (W,">$output") or die "Cannot open output file $output:$!\n";
13
14if ($reading =~ /Memory Map of the image/) {
15 $reading = $';
16 if ($reading =~ /==============/) {
17 print W $`;
18 } else {
19 print W $reading;
20 }
21}
22close W;
23