mirror of
https://github.com/apache/nuttx.git
synced 2026-05-24 16:11:56 +08:00
tools/gdb: use os.system to call readelf
Some version of gdb does not support subprocess Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
This commit is contained in:
+1
-14
@@ -39,7 +39,6 @@
|
||||
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
import time
|
||||
|
||||
PUNCTUATORS = [
|
||||
@@ -131,19 +130,7 @@ def fetch_macro_info(file):
|
||||
cache = os.path.splitext(file)[0] + ".macro"
|
||||
if not os.path.isfile(cache):
|
||||
start = time.time()
|
||||
with open(cache, "w") as f:
|
||||
# # os.system(f"readelf -wm {file} > {output}")
|
||||
process = subprocess.Popen(
|
||||
f"readelf -wm {file}", shell=True, stdout=f, stderr=subprocess.STDOUT
|
||||
)
|
||||
|
||||
process.communicate()
|
||||
errcode = process.returncode
|
||||
|
||||
f.close()
|
||||
|
||||
if errcode != 0:
|
||||
return {}
|
||||
os.system(f"readelf -wm {file} > {cache}")
|
||||
print(f"readelf took {time.time() - start:.1f} seconds")
|
||||
|
||||
p = re.compile(".*macro[ ]*:[ ]*([\S]+\(.*?\)|[\w]+)[ ]*(.*)")
|
||||
|
||||
Reference in New Issue
Block a user