def get_debug_info()

in ArmPlatformPkg/Scripts/Ds5/system_table.py [0:0]


    def get_debug_info(self):
        # Get the information from EFI_DEBUG_IMAGE_INFO_TABLE_HEADER
        count = self.ec.getMemoryService().readMemory32(self.base + 0x4)
        if edk2_debugger.is_aarch64(self.ec):
            debug_info_table_base = self.ec.getMemoryService().readMemory64(self.base + 0x8)
        else:
            debug_info_table_base = self.ec.getMemoryService().readMemory32(self.base + 0x8)

        self.DebugInfos = []

        for i in range(0, count):
            # Get the address of the structure EFI_DEBUG_IMAGE_INFO
            if edk2_debugger.is_aarch64(self.ec):
                debug_info = self.ec.getMemoryService().readMemory64(debug_info_table_base + (i * 8))
            else:
                debug_info = self.ec.getMemoryService().readMemory32(debug_info_table_base + (i * 4))

            if debug_info:
                debug_info_type = self.ec.getMemoryService().readMemory32(debug_info)
                # Normal Debug Info Type
                if debug_info_type == 1:
                    if edk2_debugger.is_aarch64(self.ec):
                        # Get the base address of the structure EFI_LOADED_IMAGE_PROTOCOL
                        loaded_image_protocol = self.ec.getMemoryService().readMemory64(debug_info + 0x8)

                        image_base = self.ec.getMemoryService().readMemory64(loaded_image_protocol + 0x40)
                        image_size = self.ec.getMemoryService().readMemory32(loaded_image_protocol + 0x48)
                    else:
                        # Get the base address of the structure EFI_LOADED_IMAGE_PROTOCOL
                        loaded_image_protocol = self.ec.getMemoryService().readMemory32(debug_info + 0x4)

                        image_base = self.ec.getMemoryService().readMemory32(loaded_image_protocol + 0x20)
                        image_size = self.ec.getMemoryService().readMemory32(loaded_image_protocol + 0x28)

                    self.DebugInfos.append((image_base,image_size))