@@ -31,12 +31,15 @@ public DisassemblyResult Disassemble(DiagnoserActionParameters parameters)
31
31
{
32
32
string resultsPath = Path . GetTempFileName ( ) ;
33
33
34
- string errors = ProcessHelper . RunAndReadOutput (
35
- GetDisassemblerPath ( parameters . Process , parameters . BenchmarkCase . Job . Environment . Platform ) ,
36
- BuildArguments ( parameters , resultsPath ) ) ;
34
+ string disassemblerPath = GetDisassemblerPath ( parameters . Process , parameters . BenchmarkCase . Job . Environment . Platform ) ;
35
+ string arguments = BuildArguments ( parameters , resultsPath ) ;
36
+ string errors = ProcessHelper . RunAndReadOutput ( disassemblerPath , arguments ) ;
37
37
38
38
if ( ! string . IsNullOrEmpty ( errors ) )
39
+ {
39
40
parameters . Config . GetCompositeLogger ( ) . WriteError ( errors ) ;
41
+ return new DisassemblyResult { Errors = new [ ] { errors } } ;
42
+ }
40
43
41
44
try
42
45
{
@@ -48,6 +51,10 @@ public DisassemblyResult Disassemble(DiagnoserActionParameters parameters)
48
51
return ( DisassemblyResult ) serializer . Deserialize ( reader ) ;
49
52
}
50
53
}
54
+ catch ( Exception e )
55
+ {
56
+ throw new Exception ( $ "Can't read disassembly diagnostic file (DisassemblerPath = '{ disassemblerPath } ', Arguments = '{ arguments } ')", e ) ;
57
+ }
51
58
finally
52
59
{
53
60
File . Delete ( resultsPath ) ;
@@ -80,9 +87,9 @@ private static string GetDisassemblerPath(string architectureName)
80
87
81
88
var dir = new FileInfo ( assemblyWithDisassemblersInResources . Location ) . Directory ?? throw new DirectoryNotFoundException ( ) ;
82
89
string disassemblerPath = Path . Combine (
83
- dir . FullName ,
84
- FolderNameHelper . ToFolderName ( BenchmarkDotNetInfo . FullVersion ) , // possible update
85
- exeName ) ; // separate process per architecture!!
90
+ dir . FullName ,
91
+ FolderNameHelper . ToFolderName ( BenchmarkDotNetInfo . FullVersion ) , // possible update
92
+ exeName ) ; // separate process per architecture!!
86
93
87
94
Path . GetDirectoryName ( disassemblerPath ) . CreateIfNotExists ( ) ;
88
95
0 commit comments