new world
[rubydium.git] / baby / memfilter.rb
blobb172ad6495feb5a00627df81394ee897ab96d1cf
1 #!/usr/bin/env ruby
2 mem_addrs = {}
3 mem_addrs = {"0" => "NULL"}
4 STDIN.each_line {
5    |line|
6    line.scan(/((.*?)MEM:(\d+)|(.*$))/) {
7       |part|
8       if part[3]
9          print part[3]
10       else
11          addr = part[2]
12          print part[1]
13          if not (mem_addrs.has_key? addr)
14             mem_addrs[addr] = "ADDR##{mem_addrs.keys.size.to_s * 4}"
15          end
16          print mem_addrs[addr]
17       end
18    }
19    puts