summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2010-08-17 17:48:32 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2010-08-17 17:50:28 +0200
commitf188bb9f375dc34491bd944677d92c5184017cca (patch)
tree48a5f1814e9c511aac01295536cf3c9ccd29e635 /test
parentff4679178975cede4a4173bcf03447f1c0058d73 (diff)
downloadconnman-f188bb9f375dc34491bd944677d92c5184017cca.tar.gz
connman-f188bb9f375dc34491bd944677d92c5184017cca.tar.bz2
connman-f188bb9f375dc34491bd944677d92c5184017cca.zip
Fix backtrace script formatting and mode bits
Diffstat (limited to 'test')
-rwxr-xr-x[-rw-r--r--]test/backtrace22
1 files changed, 12 insertions, 10 deletions
diff --git a/test/backtrace b/test/backtrace
index d33bcb18..2e64e4b4 100644..100755
--- a/test/backtrace
+++ b/test/backtrace
@@ -18,18 +18,19 @@ log_file = open(sys.argv[2], 'r')
# Extract addresses
for line in log_file:
- matchobj = re.compile(r'\[(0x[0-9a-f]+)\]$').search(line)
- if matchobj:
- addrs.append(matchobj.group(1))
+ matchobj = re.compile(r'\[(0x[0-9a-f]+)\]$').search(line)
+ if matchobj:
+ addrs.append(matchobj.group(1))
log_file.close()
# Feed into addr2line
-command = ['addr2line', '--demangle', '--functions', '--basename', '-e', binary]
+command = ['addr2line', '--demangle', '--functions', '--basename',
+ '-e', binary]
command.extend(addrs)
p = subprocess.Popen(command, shell=False, bufsize=0,
- stdin=subprocess.PIPE, stdout=subprocess.PIPE, close_fds=True)
+ stdin=subprocess.PIPE, stdout=subprocess.PIPE, close_fds=True)
(child_stdin, child_stdout) = (p.stdin, p.stdout)
child_stdin.close()
@@ -37,11 +38,12 @@ child_stdin.close()
# Backtrace display
for line in child_stdout:
- if line.startswith("??"): continue
+ if line.startswith("??"):
+ continue
- line = line.strip()
+ line = line.strip()
- frames.append(line)
+ frames.append(line)
child_stdout.close()
@@ -50,6 +52,6 @@ frame_count = len(frames);
count = 0
print "-------- ConnMan backtrace --------"
while count < frame_count:
- print "[%d]: %s() [%s]" % (count/2, frames[count], frames[count + 1])
- count = count + 2
+ print "[%d]: %s() [%s]" % (count/2, frames[count], frames[count + 1])
+ count = count + 2
print "-----------------------------------"