addr2line from binutils is required for this script to work correctly.
However, it silently fails. Fix this by using `subprocess.run' with
`check=True' instead of `subprocess.getoutput'. That way, an exception
is raised if an error occurs.
Fix the shebang by not assuming where python is installed while at it.
Change-Id: I5157b3dbccf6bfbe08a6b6840b38f5db9010fe96
Signed-off-by: Olivier Dion <odion@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
-#!/usr/bin/python3
+#!/usr/bin/env python3
#
# Copyright (C) 2017 Francis Deslauriers <francis.deslauriers@efficios.com>
#
# Expand inlined functions
cmd += ['--addresses', addr]
- addr2line_output = subprocess.getoutput(' '.join(cmd))
+ status = subprocess.run(cmd, stdout=subprocess.PIPE, check=True)
+
+ addr2line_output = status.stdout.decode("utf-8")
# Omit the last 2 lines as the caller of main can not be determine
fcts = [addr2line_output.split()[-2]]