projects
/
b43-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
debug: Fix ordering of HF bits
[b43-tools.git]
/
debug
/
b43-fwdump
diff --git
a/debug/b43-fwdump
b/debug/b43-fwdump
index b698887a3992824bdc799cb6f3f25a12f0ad9e24..a24c61466d83195c590e3ca0ad74b72da0697ee0 100755
(executable)
--- a/
debug/b43-fwdump
+++ b/
debug/b43-fwdump
@@
-2,7
+2,7
@@
"""
# b43 firmware state dumper
#
"""
# b43 firmware state dumper
#
-# Copyright (C) 2008 Michael Buesch <m
b@bu3sch.de
>
+# Copyright (C) 2008 Michael Buesch <m
@bues.ch
>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3
@@
-21,18
+21,20
@@
import getopt
from libb43 import *
from sys import stdout
from tempfile import *
from libb43 import *
from sys import stdout
from tempfile import *
+import re
def usage():
print "b43 firmware state dumper"
print ""
def usage():
print "b43 firmware state dumper"
print ""
- print "Copyright (C) 2008 Michael Buesch <m
b@bu3sch.de
>"
+ print "Copyright (C) 2008 Michael Buesch <m
@bues.ch
>"
print "Licensed under the GNU/GPL version 3"
print ""
print "Usage: b43-fwdump [OPTIONS]"
print ""
print "-h|--help Print this help text"
print "Licensed under the GNU/GPL version 3"
print ""
print "Usage: b43-fwdump [OPTIONS]"
print ""
print "-h|--help Print this help text"
- print "-p|--phy PHY The PHY to use. For example phy0"
+ print "-p|--phy WIPHY The WIPHY to use. For example phy0."
+ print " Can be omitted, if there is only one device in the system."
print "-b|--binary BIN The firmware binary. This is required for"
print " an instruction dump."
print "-d|--dasmopt OPT Additional options to the disassembler."
print "-b|--binary BIN The firmware binary. This is required for"
print " an instruction dump."
print "-d|--dasmopt OPT Additional options to the disassembler."
@@
-90,21
+92,28
@@
def dump_regs(prefix, regs):
stdout.write("\n")
return
stdout.write("\n")
return
+def dasmLineIsPC(line, pc):
+ m = re.match(r'.*/\*\s+([0-9a-fA-F]+)\s+\*/.*', line, re.DOTALL)
+ if not m:
+ return False
+ linePC = int(m.group(1), 16)
+ return pc == linePC
+
def makeShortDump(dasm, pc):
dasm = dasm.splitlines()
i = 0
for line in dasm:
def makeShortDump(dasm, pc):
dasm = dasm.splitlines()
i = 0
for line in dasm:
- if
"/* %03X */" % pc in line
:
+ if
dasmLineIsPC(line, pc)
:
break
i += 1
break
i += 1
-
if i >= len(dasm)
:
+
else
:
return "<Could not find PC in the binary>"
ret = ""
pos = max(i - 8, 0)
end = min(i + 8, len(dasm) - 1)
while pos != end:
ret += dasm[pos]
return "<Could not find PC in the binary>"
ret = ""
pos = max(i - 8, 0)
end = min(i + 8, len(dasm) - 1)
while pos != end:
ret += dasm[pos]
- if
"/* %03X */" % pc in dasm[pos]
:
+ if
dasmLineIsPC(dasm[pos], pc)
:
ret += "\t\t<<<<<<<<<<<"
ret += "\n"
pos += 1
ret += "\t\t<<<<<<<<<<<"
ret += "\n"
pos += 1