commit bf4aee52e77072ad318be6d0404b5111786ce6ba parent 47d11bd06daf8c80161e4d03ab36dc58faae82c3 Author: Kyle Milz <kyle@0x30.net> Date: Fri, 13 Jan 2017 23:05:18 -0700 tt: sync tu writer with mem.pm changes Diffstat:
M | tt/write_tus.pl | | | 20 | +++++++++++--------- |
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/tt/write_tus.pl b/tt/write_tus.pl @@ -1,18 +1,20 @@ +#!/usr/bin/perl # -# A little frontend for t::shm that prints the list of translation units. +# A little frontend for t::mem that prints the list of translation units. +# +# Usage: write_tus.pl output_file memory_file # use strict; use warnings; -use t::utils; -open(my $out, '>', 'tu_list.out') or die $!; -my $shm = t::shm->new($ARGV[0]); +use t::mem; -select $out; +open( my $out, '>', $ARGV[0] ) or die $!; +my $shm = t::mem->new( $ARGV[1] ); -my $transl_units = $shm->{translation_units}; -for (@$transl_units) { - my %tu = %$_; +my $tus = $shm->{trans_units}; +for (sort keys %$tus) { + my $tu = $tus->{$_}; - print "$tu{comp_file_name} $tu{size}\n"; + print $out "$tu->{comp_file_name} $tu->{size}\n"; }