Skip to content
Snippets Groups Projects
Commit f95604c9 authored by Kai Liu's avatar Kai Liu
Browse files

lrdp_v2: Remove parameter --32-bit and --64-bit

Use elf header to decide vmlinux is 32 or 64 bits instead of parameter

Change-Id: Id2f68fc58160e259a011247b6cbfd4efa9dab5e4
parent 625b4cc8
No related branches found
No related tags found
No related merge requests found
#!/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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment