~terry.guo/+junk/xbinutils

« back to all changes in this revision

Viewing changes to src/binutils/gas/testsuite/gas/rx/make-d

  • Committer: Terry Guo
  • Date: 2012-09-05 06:50:40 UTC
  • Revision ID: terry.guo@arm.com-20120905065040-430c6mhm9b11a6r6
Tags: upstream-1.0
ImportĀ upstreamĀ versionĀ 1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/perl
 
2
# -*- perl -*-
 
3
 
 
4
# Utility to create *.d files from *.lst files.  Not normally needed.
 
5
 
 
6
opendir L, "/tmp/lsts";
 
7
for $f (sort readdir L) {
 
8
    next unless $f =~ /\.lst/;
 
9
    $f =~ s@\.lst@@;
 
10
    push (@files, $f);
 
11
}
 
12
closedir L;
 
13
 
 
14
for $f (@files) {
 
15
 
 
16
    open (I, "/tmp/lsts/$f.lst");
 
17
    open (O, ">$f.d");
 
18
 
 
19
    print O "#objdump: -dr\n";
 
20
 
 
21
    while (<I>) {
 
22
        s/$f\.o/dump.o/;
 
23
        s/\\/\\\\/g;
 
24
        s/([\[\]\.\*\?\+])/\\$1/g;
 
25
        s/file format .*/file format \.\*/;
 
26
        print O;
 
27
    }
 
28
 
 
29
    close I;
 
30
    close O;
 
31
}