Xamarin Public Jenkins (auto-signing) 6bdd276d05 Imported Upstream version 5.0.0.42
Former-commit-id: fd56571888259555122d8a0f58c68838229cea2b
2017-04-10 11:41:01 +00:00

38 lines
954 B
C#

using System;
using Mono.Cecil;
using Mono.Cecil.Cil;
using Mono.Cecil.Mdb;
public class Driver
{
public static void Main (String[] args) {
//
// The assembly itself needs to be changed to add some data needed to
// find the matching .pdb file.
//
if (args.Length != 2) {
Console.Error.WriteLine ("Usage: mdb2pdb <input assembly> <output assembly>");
Environment.Exit (1);
}
string infile = args [0];
string outfile = args [1];
if (infile == outfile) {
Console.Error.WriteLine ("Input and output file names needs to be different.");
Environment.Exit (1);
}
var reader_parameters = new ReaderParameters {
SymbolReaderProvider = new MdbReaderProvider (),
};
using (var module = ModuleDefinition.ReadModule (infile, reader_parameters)) {
var writer_parameters = new WriterParameters {
SymbolWriterProvider = new PortablePdbWriterProvider (),
};
module.Write (outfile, writer_parameters);
}
}
}