SourcePoint AMD Help
Table of Contents
- Using Help
- Contacting ASSET InterTech
- Introduction to SourcePoint
- SourcePoint Environment
- SourcePoint Overview
- SourcePoint Parent Window Introduction
- SourcePoint Icon Toolbar
- File Menu
- File Menu - Project Menu Item
- File Menu - Layout Menu Item
- File Menu - Program Menu Item
- File Menu - Macro Menu Item
- File Menu - Print Menu Items
- File Menu - Update Emulator Flash Menu Item
- File Menu - Program Target Device Menu Item
- File Menu - Other Menu Items
- Edit Menu
- View Menu
- Processor Menu
- Options Menu
- Options Menu - Preferences Menu Item
- Options Menu - Target Configuration Menu Item
- Options Menu - Load Target Configuration File Menu Item
- Options Menu - Save Target Configuration File Menu Item
- Options Menu - Emulator Configuration Menu Item
- Options Menu - Emulator Connection Menu Item
- Options Menu - Emulator Reset Menu Item
- Options Menu - Confidence Tests Menu Item
- Window Menu
- Help Menu
- How To -- SourcePoint Environment
- Add Emulator Connections
- Configure Custom Macro Icons
- Configure Autoloading Macros
- Display Text on the Icon Toolbar
- Edit Icon Groups to Customize Your Toolbars
- Modify a Defined Memory Region
- Refresh SourcePoint Windows
- Save a Program
- Start SourcePoint With Command Line Arguments
- Use the New Project Wizard
- Verify Emulator Network Connections
- SourcePoint Overview
- Breakpoints Window
- Breakpoints Window Overview
- How To - Breakpoints
- Code Window
- Command Window
- Command Window Overview
- Confidence Tests Window
- Confidence Tests Window Overview
- Descriptors Tables Window
- Descriptors Tables Window Overview
- How To - Descriptors
- Devices Window
- Devices Window Overview
- How To - Devices Window
- Log Window
- Log Window Overview
- Memory Window
- Memory Window Overview
- How To - Memory Window
- Page Translation Window
- Page Translation Windows Overview
- PCI Devices Window
- PCI Devices Window Overview
- How To - PCI Devices Window
- Registers Window
- Registers Window Overview
- How To - Registers
- Symbols Windows
- Symbols Window Overview
- How To - Symbols Window
- Viewpoint Window
- Viewpoint Window Overview
- Watch Window
- Watch Window Overview
- How To - Watch Window
- Technical Notes
- SourcePoint Command Language
- Overview
- Commands and Control Variables
- aadump
- abort
- abs
- acos
- advanced
- asin
- asm
- asmmode
- atan
- atan2
- autoconfigure
- base
- bell (beep)
- bits
- break
- breakall
- cachememory
- cause
- Character Functions
- clock
- continue
- cos
- cpubreak commands
- cpuid_eax
- cpuid_ebx
- cpuid_ecx
- cpuid_edx
- createprocess
- ctime
- cwd
- dbgbreak commands
- defaultpath
- #define
- define
- definemacro
- deviceconfigure
- devicescan
- disconnect
- displayflag
- do while
- dos
- dport
- drscan
- edit
- editor
- emulatorstate
- encrypt
- error
- eval
- evalprogramsymbol
- execution point ($)
- exit
- exp
- fc
- fclose
- feof
- fgetc
- fgets
- first_jtag_device
- flist
- flush
- fopen
- for
- forward
- fprintf
- fputc
- fputs
- fread
- fseek
- ftell
- fwrite
- getc
- getchar
- getnearestprogramsymbol
- getprogramsymboladdress
- gets
- globalsourcepath
- go
- halt
- help
- homepath
- idcode
- if
- include
- invd
- irscan
- isdebugsymbol
- isem64t
- isprogramsymbol
- isrunning
- issleeping
- issmm
- jtagchain
- jtagconfigure
- jtagdeviceadd
- jtagdeviceclear
- jtagdevices
- jtagscan
- jtagtest
- keys
- last
- last_jtag_device
- left
- license
- linear
- list, nolist
- load
- loadbreakpoints
- loadlayout
- loadproject
- loadtarget
- loadwatches
- log, nolog
- log10
- loge
- logmessage
- macropath
- Memory Access
- messagebox
- mid
- msgclose
- msgdata
- msgdelete
- msgdr
- msgdump
- msgir
- msgopen
- msgreturndatasize
- msgscan
- msr
- num_activeprocessors
- num_all_devices
- num_devices
- num_jtag_chains
- num_jtag_devices
- num_processors
- pause
- physical
- port
- pow
- print cycles
- printf
- proc
- processorcontrol
- processorfamily
- processormode
- processors
- processortype
- projectpath
- putchar
- puts
- rand
- readsetting
- reconnect
- Register Access
- reload
- reloadproject
- remove
- reset
- restart
- return
- right
- runcontroltype
- safemode
- save
- savebreakpoints
- savelayout
- savewatches
- selectdirectory
- selectfile
- shell
- show
- sin
- sizeof
- sleep
- softbreak, softremove, softdisable, softenable
- sprintf
- sqrt
- srand
- step
- stop
- strcat
- strchr
- strcmp
- strcpy
- _strdate
- string [ ] (index into string)
- strlen
- _strlwr
- strncat
- strncmp
- strncpy
- strpos
- strstr
- _strtime
- strtod
- strtol
- strtoul
- _strupr
- swbreak
- switch
- swremove
- tabs
- tan
- tapdatashift
- tapstateset
- targpower
- targstatus
- taskattach
- taskbreak, taskremove, taskdisable, taskenable
- taskend
- taskgetpid
- taskstart
- tck
- time
- #undef
- unload
- unloadproject
- upload
- unlock
- use
- verify
- verifydeviceconfiguration
- verifyjtagconfiguration
- version
- viewpoint
- vpalias
- wait
- wbinvd
- while
- windowrefresh
- wport
- writesetting
- yield
- yieldflag
UEFI Framework Debugging
Overview
The Intelยฎ Platform Innovation Framework for Unified Extensible Firmware Interface (UEFI), commonly known as the UEFI Framework, is a new firmware architecture standard that defines a set of software interfaces and replaces the legacy BIOS found on traditional PC computers. This framework provides the kind of modularity, flexibility, and extensibility that were formerly unavailable with traditional BIOS. With UEFI, BIOS developers can now write all their code in โCโ, rather than assembly language. See Intelโs web site at http://www.intel.com/technology/framework ย or http://www.tianocore.org for more information on UEFI Framework.
Along with this new firmware architecture and the โCโ code that implements it comes the need for source-level debugging. Arium's debugger, SourcePointโข (versions 7.0 and later) for Intel and AMD processors offers native debug support for UEFI Framework platforms. Users can set breakpoints, single step, view variables, see the call stack, and access all of the feature-rich functionality SourcePoint normally provides. This includes source-level debugging during the PEI, DXE, and OS Boot phases of UEFI. Below is a set of instructions for setting up SourcePoint to debug the UEFI Framework. ย
UEFI Macros
Note: The macros described below are installed in the Macro\UEFI sub-folder of the SourcePoint install path. Several of the UEFI macro files contain directory paths to other macro files. If you move the macro files or change the current working directory in SourcePoint (via the โcwdโ command), you will need to update the macros files with the new locations.
EFI.mac
After installing SourcePoint, run the EFI.mac macro file located in the Macro\UEFI directory. This creates six custom ย toolbar buttons and associates each with a corresponding UEFI proc.
โข The StartPEI icon resets the target, then runs to PeiMain and loads the PEI symbols.
โข The PEIMs (Pre-UEFI Initialization Modules) icon loads the symbol files for the PEI modules found in target memory.
โข The DXEs (Driver Execution Environments) icon loads the symbol files for the DXE modules found in target memory.
โข The HOBs (Hand-Off Blocks) icon displays a list of UEFI HOBs found in target memory.
โข The SysConfigTable icon displays the contents of the UEFI system configuration table.
โข The DumpMemMap icon displays the UEFI Memory Map.
ย
ย
EFI.mac toolbar buttons
ย
PEI Debugging
The PEI environment requires a specialized configuration of SourcePoint. PEI gets control shortly after target reset. PEI modules are dispatched and executed after cache RAM is mapped into system memory and the stack is initialized. Having a stack this early allows โCโ language code to execute, but a special memory map must be configured to take advantage of it.
ย To configure SourcePoint for source-level debugging of PEI code, follow these steps.
-
Optional: Select Options|Target Configuration|Memory Map from the menu, and set it similar to the following (your system may vary depending on your memory map):
Start |
End |
Type |
00000000P |
000FFFFFP |
DRAM |
FEF00000P |
FFEFFFFFP |
SRAM |
FFF00000P |
FFFFFFFFP |
FLASH |
The first entry in the table designates the first 1MB of system memory. The middle entry designates the location of the cache RAM mapped into system memory. The third entry designates the firmware ROM.
-
The StartPEI button will reset the target and step one instruction at a time until the processor enters protected mode. It then will load the PEI module symbols and run until PeiMain.
-
Alternatively, you can use the PEIs macro button at any time when the processor is in protected mode.
ย
Command window after running PEIMs macro function
ย
Symbols window after loading PEIM modules
ย
Code window after loading PEIM modules
DXE Debugging
Once system RAM is initialized and the PEI phase completes, the DXE environment is entered. This is less specialized than PEI; nevertheless, it requires a few SourcePoint parameters to be set.
To configure SourcePoint for source-level debugging of DXE code, follow these steps:
-
Run the target to the UEFI shell, or as far as it will go in DXE.
-
Stop the target.
-
Click the DXEs toolbar icon to load the DXE symbols.
-
Browse the source code files using the Symbols window and set breakpoints in your code.
-
Reset the target and go until you hit a breakpoint.
DXE Code window
HOBs
Open the Command window, and then click the HOBs toolbar icon to display the hand-off blocks on the target.
ย
Example of HOB display
System Configuration Table
Open the Command window, and then click the SysConfigTable toolbar icon to display the contents of the UEFI system configuration table on the target.
ย
Example of System Configuration Table
Notes
-
DXE Debugging Tip
To stop the target and load symbols just before a DXE module is dispatched, open the Symbols window, choose the Globals tab, and drill down to:
program: ย ย DXEMAIN.efi
module: ย ย ย image (image.c)
function: ย ย CoreStartImage()
Right click on CoreStartImage and select Open Code Window from the pop-up menu.
Set a processor breakpoint in CoreStartImage( ) where Image->EntryPoint( ) is called. This hits before each DXE module is dispatched, but afterwards its entry is placed in tables. Each time you hit this breakpoint, click the DXEs toolbar icon to load the DXE symbols.
Now you can load symbols just before your DXE module runs instead of running to the UEFI shell, then loading symbols, then resetting the target, then running to your breakpoint.
-
Watchdog Timer on Intel Platforms
Some motherboards with Intel processors have a TCO timer that will assert RESET independent of the emulator. See the Arium application note titled, "Disabling the TCO Timer in an Intel I/O Controller Hub" for details. Resetting the target from SourcePoint can cause a Target state undefined error message to appear because the timer asserts RESET and confuses the emulator. The solution to this problem is to configure the ICH_TCO_Timer_Disable.mac macro to run at every target reset.
-
The UEFI firmware on the target contains strings that hold the paths to the program symbol files on your hard drive. SourcePoint macros read target memory, find these strings, then load the symbol files specified in these paths. The symbol files must be located in the path specified in the UEFI firmware.
For example, one path might look like this:
"Z:\Platform\IntelSsg\D845GRG\Build\IA32\DxeMain.efi"
This architecture, defined by Intel, presents a requirement for UEFI debugging. You must have the UEFI symbol files on the host computer in the same directories as specified in the firmware on the target. This should not be a problem if you build the UEFI firmware on the same host from which you run SourcePoint.
If the drive letter or path doesnโt match exactly, you can use the โsubstโ command from the Windows command prompt to map a drive letter to a desired path (example: 'subst d: c:\working\EFI').
ย