File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,6 @@ from __future__ import print_function
26
26
27
27
import argparse
28
28
import subprocess
29
- import sys
30
29
31
30
import lldb
32
31
@@ -127,14 +126,11 @@ def main():
127
126
parser .add_argument (
128
127
"binary" , help = "Executable which produced the log file" )
129
128
parser .add_argument (
130
- "log" , help = "Log file containing the stack trace to symbolicate" )
129
+ "log" , type = argparse .FileType ("rU" ),
130
+ help = "Log file containing the stack trace to symbolicate" )
131
131
args = parser .parse_args ()
132
132
133
133
binary = args .binary
134
- if args .log == "-" :
135
- logfile = sys .stdin
136
- else :
137
- logfile = open (args .log , 'rU' )
138
134
139
135
lddoutput = subprocess .check_output (
140
136
['ldd' , binary ], stderr = subprocess .STDOUT )
@@ -143,7 +139,7 @@ def main():
143
139
instack = False
144
140
stackidx = 0
145
141
stack = []
146
- for line in logfile :
142
+ for line in args . log :
147
143
if instack and line .startswith (str (stackidx )):
148
144
stack .append (line )
149
145
stackidx = stackidx + 1
You can’t perform that action at this time.
0 commit comments