diff --git a/linux-ramdump-parser-v2/ramparse.py b/linux-ramdump-parser-v2/ramparse.py index ef9f967a628fd7fb7b4120e749759221ac4646e0..786450218bd7ef1767f2b5c9327a624753f8802e 100644 --- a/linux-ramdump-parser-v2/ramparse.py +++ b/linux-ramdump-parser-v2/ramparse.py @@ -1,6 +1,6 @@ #!/usr/bin/env python2 -# Copyright (c) 2012-2017, The Linux Foundation. All rights reserved. +# Copyright (c) 2012-2018, The Linux Foundation. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 and @@ -122,10 +122,6 @@ if __name__ == '__main__': help='Force the hardware detection to a specific hardware version') parser.add_option('', '--parse-qdss', action='store_true', dest='qdss', help='Parse QDSS (deprecated)') - parser.add_option('', '--64-bit', action='store_true', dest='arm64', - help='Parse dumps as 64-bit dumps (default)') - parser.add_option('', '--32-bit', action='store_true', dest='arm32', - help='Parse dumps as 32-bit dumps') parser.add_option('', '--shell', action='store_true', help='Run an interactive python interpreter with the ramdump loaded') parser.add_option('', '--classic-shell', action='store_true', @@ -248,6 +244,14 @@ if __name__ == '__main__': 'Ram file {0} does not exist. Exiting...'.format(a[0])) sys.exit(1) + # offset 4 of vmlinux indcates it's 32 or 64 bits + # for 64 bits it is 0x2, for 32 bits it is 0x1 + vm_file = open(options.vmlinux) + vm_file.seek(4, 0) + bin_bits = vm_file.read(1) + vm_file.close() + options.arm64 = ord(bin_bits) == 0x02 + if options.wlan is None: options.wlan = "INTEGRATED" else: @@ -260,12 +264,6 @@ if __name__ == '__main__': nm_path = options.nm objdump_path = options.objdump - if options.arm64: - print_out_str('--64-bit is deprecated. Dumps are assumed to be 64-bit by default.') - print_out_str('For 32-bit dumps, use --32-bit.') - else: - options.arm64 = not options.arm32 - try: import local_settings try: