From 1e57a46299244793beb27e74be171d1540606999 Mon Sep 17 00:00:00 2001 From: oliviermartin Date: Fri, 25 Jan 2013 11:28:06 +0000 Subject: ARM Packages: Fixed line endings This large code change only modifies the line endings to be CRLF to be compliant with the EDK2 coding convention document. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14088 6f19259b-4bc3-4df7-8a09-765794883524 --- ArmPlatformPkg/Scripts/Ds5/edk2_debugger.py | 434 ++++++++++++++-------------- 1 file changed, 217 insertions(+), 217 deletions(-) (limited to 'ArmPlatformPkg/Scripts/Ds5/edk2_debugger.py') diff --git a/ArmPlatformPkg/Scripts/Ds5/edk2_debugger.py b/ArmPlatformPkg/Scripts/Ds5/edk2_debugger.py index 71e5a3ccd5..87e82b68d6 100644 --- a/ArmPlatformPkg/Scripts/Ds5/edk2_debugger.py +++ b/ArmPlatformPkg/Scripts/Ds5/edk2_debugger.py @@ -1,217 +1,217 @@ -# -# Copyright (c) 2011-2012, ARM Limited. All rights reserved. -# -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# - -import os - -import firmware_volume -import build_report -import system_table - -# Reload external classes -reload(firmware_volume) -reload(build_report) -reload(system_table) - -def readMem32(executionContext, address): - bytes = executionContext.getMemoryService().read(address, 4, 32) - return struct.unpack('= debug_info[0]) and (pc < debug_info[0] + debug_info[1]): - found = True - if found == False: - info = self.firmware_volumes[fv_base].load_symbols_at(pc) - debug_infos.append(info) - - #self.firmware_volumes[fv_base].load_symbols_at(pc) - elif self.in_sysmem(pc): - debug_infos = [] - - if self.system_table is None: - # Find the System Table - self.system_table = system_table.SystemTable(self.ec, self.platform.sysmembase, self.platform.sysmemsize) - - # Find the Debug Info Table - debug_info_table_base = self.system_table.get_configuration_table(system_table.DebugInfoTable.CONST_DEBUG_INFO_TABLE_GUID) - self.debug_info_table = system_table.DebugInfoTable(self.ec, debug_info_table_base) - - stack_frame = self.ec.getTopLevelStackFrame() - info = self.debug_info_table.load_symbols_at(int(stack_frame.getRegisterService().getValue('PC')) & 0xFFFFFFFF) - debug_infos.append(info) - while stack_frame.next() is not None: - stack_frame = stack_frame.next() - - # Stack frame attached to 'PC' - pc = int(stack_frame.getRegisterService().getValue('PC')) & 0xFFFFFFFF - - # Check if the symbols for this stack frame have already been loaded - found = False - for debug_info in debug_infos: - if (pc >= debug_info[0]) and (pc < debug_info[0] + debug_info[1]): - found = True - if found == False: - info = self.debug_info_table.load_symbols_at(pc) - debug_infos.append(info) - - #self.debug_info_table.load_symbols_at(pc) - else: - raise Exception('ArmPlatformDebugger', "Not supported region") - - def load_all_symbols(self): - # Load all the XIP symbols attached to the Firmware Volume - for (fv_base, fv_size) in self.platform.fvs: - if self.firmware_volumes.has_key(fv_base) == False: - self.firmware_volumes[fv_base] = firmware_volume.FirmwareVolume(self.ec, fv_base, fv_size) - self.firmware_volumes[fv_base].load_all_symbols() - - try: - # Load all symbols of module loaded into System Memory - if self.system_table is None: - # Find the System Table - self.system_table = system_table.SystemTable(self.ec, self.platform.sysmembase, self.platform.sysmemsize) - - - # Find the Debug Info Table - debug_info_table_base = self.system_table.get_configuration_table(system_table.DebugInfoTable.CONST_DEBUG_INFO_TABLE_GUID) - self.debug_info_table = system_table.DebugInfoTable(self.ec, debug_info_table_base) - - self.debug_info_table.load_all_symbols() - except: - # Debugger exception could be excepted if DRAM has not been initialized or if we have not started to run from DRAM yet - print "Note: no symbols have been found in System Memory (possible cause: the UEFI permanent memory has been installed yet)" - pass +# +# Copyright (c) 2011-2012, ARM Limited. All rights reserved. +# +# This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# + +import os + +import firmware_volume +import build_report +import system_table + +# Reload external classes +reload(firmware_volume) +reload(build_report) +reload(system_table) + +def readMem32(executionContext, address): + bytes = executionContext.getMemoryService().read(address, 4, 32) + return struct.unpack('= debug_info[0]) and (pc < debug_info[0] + debug_info[1]): + found = True + if found == False: + info = self.firmware_volumes[fv_base].load_symbols_at(pc) + debug_infos.append(info) + + #self.firmware_volumes[fv_base].load_symbols_at(pc) + elif self.in_sysmem(pc): + debug_infos = [] + + if self.system_table is None: + # Find the System Table + self.system_table = system_table.SystemTable(self.ec, self.platform.sysmembase, self.platform.sysmemsize) + + # Find the Debug Info Table + debug_info_table_base = self.system_table.get_configuration_table(system_table.DebugInfoTable.CONST_DEBUG_INFO_TABLE_GUID) + self.debug_info_table = system_table.DebugInfoTable(self.ec, debug_info_table_base) + + stack_frame = self.ec.getTopLevelStackFrame() + info = self.debug_info_table.load_symbols_at(int(stack_frame.getRegisterService().getValue('PC')) & 0xFFFFFFFF) + debug_infos.append(info) + while stack_frame.next() is not None: + stack_frame = stack_frame.next() + + # Stack frame attached to 'PC' + pc = int(stack_frame.getRegisterService().getValue('PC')) & 0xFFFFFFFF + + # Check if the symbols for this stack frame have already been loaded + found = False + for debug_info in debug_infos: + if (pc >= debug_info[0]) and (pc < debug_info[0] + debug_info[1]): + found = True + if found == False: + info = self.debug_info_table.load_symbols_at(pc) + debug_infos.append(info) + + #self.debug_info_table.load_symbols_at(pc) + else: + raise Exception('ArmPlatformDebugger', "Not supported region") + + def load_all_symbols(self): + # Load all the XIP symbols attached to the Firmware Volume + for (fv_base, fv_size) in self.platform.fvs: + if self.firmware_volumes.has_key(fv_base) == False: + self.firmware_volumes[fv_base] = firmware_volume.FirmwareVolume(self.ec, fv_base, fv_size) + self.firmware_volumes[fv_base].load_all_symbols() + + try: + # Load all symbols of module loaded into System Memory + if self.system_table is None: + # Find the System Table + self.system_table = system_table.SystemTable(self.ec, self.platform.sysmembase, self.platform.sysmemsize) + + + # Find the Debug Info Table + debug_info_table_base = self.system_table.get_configuration_table(system_table.DebugInfoTable.CONST_DEBUG_INFO_TABLE_GUID) + self.debug_info_table = system_table.DebugInfoTable(self.ec, debug_info_table_base) + + self.debug_info_table.load_all_symbols() + except: + # Debugger exception could be excepted if DRAM has not been initialized or if we have not started to run from DRAM yet + print "Note: no symbols have been found in System Memory (possible cause: the UEFI permanent memory has been installed yet)" + pass -- cgit v1.2.3