ArmPlatformPkg/Scripts: Infer dll load address from console output
cmd_load_symbols.py can only load symbols from FV. Add the possibility to use UEFI console output to calculate dll load address and send add-symbol-file commands directly to ArmDS debugger dll load address can't be used directly from UEFI output, see comment in DebugPeCoffExtraActionLib: "This may not work correctly if you generate PE/COFF directly as then the Offset would not be required". 1) Use objdump -S module.dll | grep <_ModuleEntryPoint> to get offset in dll (offset) 2) Use Entrypoint=<address> from UEFI console output (entrypoint) 3) dll load address is (entrypoint)-(offset) Signed-off-by: Artem Kopotev <artem.kopotev@arm.com> Tested-by: Pierre Gondois <Pierre.Gondois@arm.com>
This commit is contained in:
committed by
mergify[bot]
parent
4bac086e8e
commit
fddb8d24ec
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011-2013, ARM Limited. All rights reserved.
|
||||
# Copyright (c) 2011-2021, Arm Limited. All rights reserved.
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
#
|
||||
@ -7,6 +7,8 @@
|
||||
from arm_ds.debugger_v1 import Debugger
|
||||
from arm_ds.debugger_v1 import DebugException
|
||||
|
||||
from console_loader import load_symbol_from_console
|
||||
|
||||
import re, sys, getopt
|
||||
|
||||
import edk2_debugger
|
||||
@ -21,12 +23,16 @@ def usage():
|
||||
print "-m,--sysmem=(base,size): System Memory region"
|
||||
print "-f,--fv=(base,size): Firmware region"
|
||||
print "-r,--rom=(base,size): ROM region"
|
||||
print "-i,--input=: Filename for the EDK2 console output"
|
||||
print "-o,--objdump=: Path to the objdump tool"
|
||||
|
||||
verbose = False
|
||||
load_all = False
|
||||
report_file = None
|
||||
input_file = None
|
||||
objdump = None
|
||||
regions = []
|
||||
opts,args = getopt.getopt(sys.argv[1:], "hvar:vm:vr:vf:v", ["help","verbose","all","report=","sysmem=","rom=","fv="])
|
||||
opts,args = getopt.getopt(sys.argv[1:], "hvar:i:o:vm:vr:vf:v", ["help","verbose","all","report=","sysmem=","rom=","fv=","input=","objdump="])
|
||||
if (opts is None) or (not opts):
|
||||
report_file = '../../../report.log'
|
||||
else:
|
||||
@ -55,6 +61,10 @@ else:
|
||||
elif o in ("-r","--rom"):
|
||||
region_type = edk2_debugger.ArmPlatformDebugger.REGION_TYPE_ROM
|
||||
regex = region_reg
|
||||
elif o in ("-i","--input"):
|
||||
input_file = a
|
||||
elif o in ("-o", "--objdump"):
|
||||
objdump = a
|
||||
else:
|
||||
assert False, "Unhandled option (%s)" % o
|
||||
|
||||
@ -94,3 +104,6 @@ except Exception, (ErrorClass, ErrorMessage):
|
||||
print "Error(%s): %s" % (ErrorClass, ErrorMessage)
|
||||
except DebugException, de:
|
||||
print "DebugError: %s" % (de.getMessage())
|
||||
|
||||
if input_file:
|
||||
load_symbol_from_console(ec, input_file, objdump, verbose)
|
||||
|
Reference in New Issue
Block a user