diff options
author | dim <dim@FreeBSD.org> | 2011-10-20 21:10:27 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2011-10-20 21:10:27 +0000 |
commit | 7b3392326c40c3c20697816acae597ba7b3144eb (patch) | |
tree | 2cbcf22585e99f8a87d12d5ff94f392c0d266819 /test/Scripts/common_dump.py | |
parent | 1176aa52646fe641a4243a246aa7f960c708a274 (diff) | |
download | FreeBSD-src-7b3392326c40c3c20697816acae597ba7b3144eb.zip FreeBSD-src-7b3392326c40c3c20697816acae597ba7b3144eb.tar.gz |
Vendor import of llvm release_30 branch r142614:
http://llvm.org/svn/llvm-project/llvm/branches/release_30@142614
Diffstat (limited to 'test/Scripts/common_dump.py')
-rw-r--r-- | test/Scripts/common_dump.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/Scripts/common_dump.py b/test/Scripts/common_dump.py index 3d69c3f..fd58993 100644 --- a/test/Scripts/common_dump.py +++ b/test/Scripts/common_dump.py @@ -31,7 +31,7 @@ def dataToHexUnified(d): return ''.join(bytes).strip() -def HexDump(val, numBits=32): +def HexDump(valPair): """ 1. do not print 'L' 2. Handle negatives and large numbers by mod (2^numBits) @@ -40,7 +40,9 @@ def HexDump(val, numBits=32): 4. Do print 0x Why? so that they can be easily distinguished using sed/rx """ + val, numBits = valPair + assert 0 <= val < (1 << numBits) + val = val & (( 1 << numBits) - 1) newFmt = "0x%0" + "%d" % (numBits / 4) + "x" return newFmt % val - |