keyboard/qmk/lib/chibios/demos/SPC5/RT-SPC564A-EVB/UDE/debug.wsx

276 lines
46 KiB
Plaintext
Raw Normal View History

<?xml version="1.0" encoding="ISO-8859-1"?>
<stg format="2.0">
<OriginalWsp type="string">debug.wsx</OriginalWsp><BackupWspFlag type="flag">0</BackupWspFlag><UseWspCnt type="int">0</UseWspCnt><WspCloseCnt type="int">1</WspCloseCnt><ProdInfo type="bin" size="52">vQTv/gAAAQAXAAIA8QkPAAAABAAAAAAAPwAAAAAAAAAEAAAAAgAAAAAAAAAAAAAAAAAAAA==</ProdInfo><ProdInfoString type="string">4.0</ProdInfoString><CreationDate type="string">18.03.2013 09:20:44:999</CreationDate><MainFrame type="key"><VisibilityGroupsMgr type="key"><Core type="key"><UsePrimaryGroup type="flag">0</UsePrimaryGroup><UseLastUsedGroup type="flag">0</UseLastUsedGroup></Core><VisibilityGroup_1 type="key"><NoOfDebugger type="int">0</NoOfDebugger><DefaultGroupName type="string">WorkspaceManager</DefaultGroupName><GroupName type="string">WorkspaceManager</GroupName><PrimaryGroup type="flag">0</PrimaryGroup><CommonGroup type="flag">1</CommonGroup></VisibilityGroup_1><VisibilityGroup_2 type="key"><Debugger_1 type="string">Core</Debugger_1><NoOfDebugger type="int">1</NoOfDebugger><DefaultGroupName type="string">Target0.Controller0.Core</DefaultGroupName><GroupName type="string">Target0.Controller0.Core</GroupName><PrimaryGroup type="flag">1</PrimaryGroup><CommonGroup type="flag">0</CommonGroup></VisibilityGroup_2><NoOfDefaultVisibilityGroups type="int">2</NoOfDefaultVisibilityGroups><NoOfVisibilityGroups type="int">2</NoOfVisibilityGroups><EnableUserSwitchOfVisibilityGroups type="flag">0</EnableUserSwitchOfVisibilityGroups><EnableDebuggerSwitchOfVisibilityGroups type="flag">0</EnableDebuggerSwitchOfVisibilityGroups><VisibilityGroupsCtrlTBCat type="int">7</VisibilityGroupsCtrlTBCat><EnableVisibilityGroups type="flag">0</EnableVisibilityGroups></VisibilityGroupsMgr><NETPlacementRoot type="key"><FormsData type="innerxml"><FormsData><Bounds><X>205</X><Y>15</Y><Width>1296</Width><Height>871</Height></Bounds><ClientSize><Width>1280</Width><Height>833</Height></ClientSize><State>Normal</State></FormsData></FormsData><DockingManagerControlData type="innerxml"><DockingManagerControlData><MDIActive>false</MDIActive><DocumentDockStyle>Top</DocumentDockStyle><DockingControls><DockingControlData><DockedDimension>1272</DockedDimension><Cancelled>false</Cancelled><DockingType>Bottom</DockingType><FloatingBounds><X>0</X><Y>0</Y><Width>0</Width><Height>0</Height></FloatingBounds><AutoHide>false</AutoHide><AutoHideByContextSwitch>false</AutoHideByContextSwitch><DockingIndex>0</DockingIndex><PanelIndex>0</PanelIndex><ContainerType>DockPanel</ContainerType><Selected>true</Selected></DockingControlData><DockingControlData><DockedDimension>510</DockedDimension><Cancelled>false</Cancelled><DockingType>Left</DockingType><FloatingBounds><X>0</X><Y>0</Y><Width>0</Width><Height>0</Height></FloatingBounds><AutoHide>false</AutoHide><AutoHideByContextSwitch>false</AutoHideByContextSwitch><DockingIndex>0</DockingIndex><PanelIndex>0</PanelIndex><ContainerType>DockPanel</ContainerType><Selected>true</Selected></DockingControlData><DockingControlData><DockedDimension>510</DockedDimension><Cancelled>false</Cancelled><DockingType>Left</DockingType><FloatingBounds><X>0</X><Y>0</Y><Width>0</Width><Height>0</Height></FloatingBounds><AutoHide>false</AutoHide><AutoHideByContextSwitch>false</AutoHideByContextSwitch><DockingIndex>1</DockingIndex><PanelIndex>0</PanelIndex><ContainerType>DockPanel</ContainerType><Selected>false</Selected></DockingControlData><DockingControlData><DockedDimension>0</DockedDimension><Cancelled>false</Cancelled><DockingType>Top</DockingType><FloatingBounds><X>0</X><Y>0</Y><Width>0</Width><Height>0</Height></FloatingBounds><AutoHide>false</AutoHide><AutoHideByContextSwitch>false</AutoHideByContextSwitch><DockingIndex>0</DockingIndex><PanelIndex>-1</PanelIndex><ContainerType>TabbedDocument</ContainerType><Selected>true</Selected></DockingControlData><DockingControlData><DockedDimension>510</DockedDimension><Cancelled>false</Cancelled><DockingType>Left</DockingType><FloatingBounds><X>0</X><Y>0</Y><Width>0</Width><Height>0</Height></FloatingBounds><AutoHide>false</AutoHide><AutoHideByContextSwitch>false</AutoHideByContextSwitch><DockingIndex>2</Dockin
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA</DefParaFormat></ViewSrv><NETFrameMode type="int">90113</NETFrameMode><NETFrameSaveIndex type="int">6</NETFrameSaveIndex><FrameUserTitle type="string"></FrameUserTitle><CommonVisibilityGroup type="flag">1</CommonVisibilityGroup><VisibilityGroup_1 type="string">WorkspaceManager</VisibilityGroup_1><VisibilityGroupsCnt type="int">1</VisibilityGroupsCnt></OPEN_VIEW><SAVED_VIEW type="int">0</SAVED_VIEW></StdUDECmdWin><UDETraceWin2 type="key"><SAVED_VIEW_OBJS type="int">0</SAVED_VIEW_OBJS></UDETraceWin2><StdUDEWspHTMLView type="key"><SAVED_VIEW_OBJS type="int">0</SAVED_VIEW_OBJS></StdUDEWspHTMLView><SelectedPrinter type="string">\\napnt002.nap.st.com\NAPPRT0001</SelectedPrinter><TraceFramework type="key"/></MainFrame><INI_SECTION type="key"><Macro type="key"><MacroLib type="string">..\..\..\..\..\Program Files\pls\UDE 4.0\StdLibrary.mso</MacroLib></Macro><Loader type="key"><LOADER_REGKEY_WSP type="string">{866f82d3-fac5-43cd-8a82-0af01e46e2c5}</LOADER_REGKEY_WSP></Loader></INI_SECTION><AddOns type="key"><UDE.Script type="key"><MacroGuiEntries type="key"><LastScriptFilePath type="string">..\..\..\..\..\Documents and Settings\disiriog\My Documents\pls\UDE 4.0</LastScriptFilePath><Macro_23_04_13_13_50_43_0 type="key"><ScriptDescription type="string">The script contains a collection of macros to save memory content into different file formats
and fill target memory ranges</ScriptDescription><ScriptPath type="string">V:\UDE\AddOns\Macro\MacroLibrary\StdMacros1.dsm</ScriptPath><ScriptSource type="string">'
' $Header: /Ude/AddOns/Macro/MacroLibrary/StdMacros.dsm 3 30.04.04 9:34 Weisses $
'_______________________________________________________
'
' universal debug engine
'
' Standard command line macros - part 1
'
' pls Development Tools 1999-2004
'
' 28.04.04 SW correction for UDE 1.10
' 03.06.03 SW initial version
'_______________________________________________________
'_______________________________________________________
'
' UnAss command line function
'
' generates disassembly file
'
' command line UnAss output-file range1 [range2] [range3] .....
' range description:
' C:&lt;startaddress&gt;,&lt;length&gt; or - code
' DB:&lt;startaddress&gt;,&lt;length&gt; or - data byte
' DW:&lt;startaddress&gt;,&lt;length&gt; or - data word
' DD:&lt;startaddress&gt;,&lt;length&gt; or - data dword
'_______________________________________________________
Sub UnAss(File,ParameterObj)
set debugger = workspace.Coredebugger(0)
set DisASMObj = debugger.DisASMObj
If Not IsObject(ParameterObj) Then
MsgBox "Number of parameters wrong"
Exit Sub
End If
If IsNumeric(File) Then
MsgBox "File parameter wrong - " &amp; File
Exit Sub
End If
DisASMObj.OutputPath = CStr(File)
bRetVal = DisASMObj.CreateStream(True,"UDE Disassembler output of current Program",False)
If bRetVal = True Then
ParmeterCnt = ParameterObj.ParameterCount
If ParmeterCnt = 0 Then
MsgBox "Number of parameters wrong " &amp; ParmeterCnt
Exit Sub
End If
If ( ParmeterCnt Mod 3 ) &lt;&gt; 0 Then
MsgBox "Number of parameters wrong " &amp; ParmeterCnt
Exit Sub
End If
RangeCnt = ParmeterCnt/3
ParamIndex = 0
For Range = 0 To RangeCnt -1
KindOfRange = CStr(ParameterObj.Parameter(ParamIndex))
KindOfRange = UCase(KindOfRange)
Address = CLng(ParameterObj.Parameter(ParamIndex +1))
Length = CLng(ParameterObj.Parameter(ParamIndex +2))
ParamIndex = ParamIndex +3
If IsNumeric(KindOfRange) Then
If KindOfRange = 12 Then
DisASMObj.AddRange Address,Length,1
ElseIf KindOfRange = 219 Then
DisASMObj.AddRange Address,Length,2
ElseIf KindOfRange = 221 Then
DisASMObj.AddRange Address,Length,4
Else
MsgBox "Invalid range type " &amp; KindOfRange &amp; "of range " &amp; Range +1
Exit Sub
End If
Else
If KindOfRange = "C" Then
DisASMObj.AddRange Address,Length,1
ElseIf KindOfRange = "DB" Then
DisASMObj.AddRange Address,Length,2
ElseIf KindOfRange = "DW" Then
DisASMObj.AddRange Address,Length,3
ElseIf KindOfRange = "DD" Then
DisASMObj.AddRange Address,Length,4
Else
MsgBox "Invalid range type " &amp; KindOfRange &amp; "of range " &amp; Range +1
Exit Sub
End If
End If
Next
DisASMObj.HexFileModeFlag = False
DisASMObj.ListModeFlag = False
DisASMObj.WriteAllRanges(False)
End If
End Sub
'_______________________________________________________
'
' SaveHEX command line function
'
' generates intel-HEX file
'
' command line SaveHex output-file range1 [range2] [range3] .....
' range description:
' &lt;startaddress&gt;,&lt;length&gt;
'_______________________________________________________
Sub SaveHEX(File,ParameterObj)
set debugger = workspace.Coredebugger(0)
set DisASMObj = debugger.DisASMObj
If Not IsObject(ParameterObj) Then
MsgBox "Number of parameters wrong"
Exit Sub
End If
If IsNumeric(File) Then
MsgBox "File parameter wrong - " &amp; File
Exit Sub
End If
DisASMObj.OutputPath = CStr(File)
bRetVal = DisASMObj.CreateStream(True,"UDE generated intel-Hex file of current Program",False)
If bRetVal = True Then
ParmeterCnt = ParameterObj.ParameterCount
If ParmeterCnt = 0 Then
MsgBox "Number of parameters wrong " &amp; ParmeterCnt
Exit Sub
End If
If ( ParmeterCnt Mod 2 ) &lt;&gt; 0 Then
MsgBox "Number of parameters wrong " &amp; ParmeterCnt
Exit Sub
End If
RangeCnt = ParmeterCnt/2
ParamIndex = 0
For Range = 0 To RangeCnt -1
Address = CLng(ParameterObj.Parameter(ParamIndex))
Length = CLng(ParameterObj.Parameter(ParamIndex +1))
ParamIndex = ParamIndex +2
DisASMObj.AddRange Address,Length,0
Next
DisASMObj.HexFileModeFlag = True
DisASMObj.WriteAllRanges(False)
End If
End Sub
'_______________________________________________________
'
' FillByte command line function
'
' fills memory range with byte pattern
'
' command line FillByte range1,pattern1 [range2,pattern2] [range3,pattern3] .....
' range description:
' &lt;startaddress&gt;,&lt;length&gt;
'_______________________________________________________
Sub FillByte(ParameterObj)
set debugger = workspace.Coredebugger(0)
set DisASMObj = debugger.DisASMObj
If Not IsObject(ParameterObj) Then
MsgBox "Number of parameters wrong"
Exit Sub
End If
ParmeterCnt = ParameterObj.ParameterCount
If ParmeterCnt = 0 Then
MsgBox "Number of parameters wrong " &amp; ParmeterCnt
Exit Sub
End If
If ( ParmeterCnt Mod 3 ) &lt;&gt; 0 Then
MsgBox "Number of parameters wrong " &amp; ParmeterCnt
Exit Sub
End If
RangeCnt = ParmeterCnt/3
ParamIndex = 0
set udearrayobj = debugger.ByteArrayObj(1)
For Range = 0 To RangeCnt -1
Address = CLng(ParameterObj.Parameter(ParamIndex))
Length = CLng(ParameterObj.Parameter(ParamIndex +1))
Pattern = CLng(ParameterObj.Parameter(ParamIndex +2))
ParamIndex = ParamIndex +3
udearrayobj.Resize(Length)
udearrayobj.Fill(Pattern)
debugger.Write Address,udearrayobj
Next
End Sub
'_______________________________________________________
'
' FillWord command line function
'
' fills memory range with word pattern
'
' command line FillWord range1,pattern1 [range2,pattern2] [range3,pattern3] .....
' range description:
' &lt;startaddress&gt;,&lt;length&gt;
'_______________________________________________________
Sub FillWord(ParameterObj)
set debugger = workspace.Coredebugger(0)
set DisASMObj = debugger.DisASMObj
If Not IsObject(ParameterObj) Then
MsgBox "Number of parameters wrong"
Exit Sub
End If
ParmeterCnt = ParameterObj.ParameterCount
If ParmeterCnt = 0 Then
MsgBox "Number of parameters wrong " &amp; ParmeterCnt
Exit Sub
End If
If ( ParmeterCnt Mod 3 ) &lt;&gt; 0 Then
MsgBox "Number of parameters wrong " &amp; ParmeterCnt
Exit Sub
End If
RangeCnt = ParmeterCnt/3
ParamIndex = 0
set udearrayobj = debugger.WordArrayObj(1)
For Range = 0 To RangeCnt -1
Address = CLng(ParameterObj.Parameter(ParamIndex))
Length = CLng(ParameterObj.Parameter(ParamIndex +1)/2)
Pattern = CLng(ParameterObj.Parameter(ParamIndex +2))
ParamIndex = ParamIndex +3
udearrayobj.Resize(Length)
udearrayobj.Fill(Pattern)
debugger.Write Address,udearrayobj
Next
End Sub
'_______________________________________________________
'
' FillDWord command line function
'
' fills memory range with dword pattern
'
' command line FillDWord range1,pattern1 [range2,pattern2] [range3,pattern3] .....
' range description:
' &lt;startaddress&gt;,&lt;length&gt;
'_______________________________________________________
Sub FillDWord(ParameterObj)
set debugger = workspace.Coredebugger(0)
set DisASMObj = debugger.DisASMObj
If Not IsObject(ParameterObj) Then
MsgBox "Number of parameters wrong"
Exit Sub
End If
ParmeterCnt = ParameterObj.ParameterCount
If ParmeterCnt = 0 Then
MsgBox "Number of parameters wrong " &amp; ParmeterCnt
Exit Sub
End If
If ( ParmeterCnt Mod 3 ) &lt;&gt; 0 Then
MsgBox "Number of parameters wrong " &amp; ParmeterCnt
Exit Sub
End If
RangeCnt = ParmeterCnt/3
ParamIndex = 0
set udearrayobj = debugger.DWordArrayObj(1)
For Range = 0 To RangeCnt -1
Address = CLng(ParameterObj.Parameter(ParamIndex))
Length = CLng(ParameterObj.Parameter(ParamIndex +1)/4)
Pattern = CLng(ParameterObj.Parameter(ParamIndex +2))
ParamIndex = ParamIndex +3
udearrayobj.Resize(Length)
udearrayobj.Fill(Pattern)
debugger.Write Address,udearrayobj
Next
End Sub</ScriptSource><ScriptArchitecture type="int">63</ScriptArchitecture><ScriptEngine type="string">VBScript</ScriptEngine><MacroFileTime type="string">24.11.2006 14:43:20:000</MacroFileTime><ScriptFromStg type="flag">1</ScriptFromStg><LocalComputerName type="string">WS_CORE_DUO</LocalComputerName><ExternalScriptPath type="string"></ExternalScriptPath><NextNodeName type="string">Macro_27_02_14_13_49_07_0</NextNodeName><UnAss type="key"><GUIEntry type="key"><MenuID type="int">10</MenuID><MenuString type="string">Execute UnAss ..</MenuString><ToolTipString type="string">Macro UnAss</ToolTipString><MessageString type="string">Execute macro UnAss</MessageString><DebugFlag type="flag">0</DebugFlag></GUIEntry><FuncParameterCnt type="int">2</FuncParameterCnt><GUIEntryDescription type="string"></GUIEntryDescription></UnAss><SaveHEX type="key"><GUIEntry type="key"><MenuID type="int">10</MenuID><MenuString type="string">Execute SaveHEX ..</MenuString><ToolTipString type="string">Macro SaveHEX</ToolTipString><MessageString type="string">Execute macro SaveHEX</MessageString><DebugFlag type="flag">0</DebugFlag></GUIEntry><FuncParameterCnt type="int">2</FuncParameterCnt><GUIEntryDescription type="string"></GUIEntryDescription></SaveHEX><FillByte type="key"><GUIEntry type="key"><MenuID type="int">10</MenuID><MenuString type="string">Execute FillByte ..</MenuString><ToolTipString type="string">Macro FillByte</ToolTipString><MessageString type="string">Execute macro FillByte</MessageString><DebugFlag type="flag">0</DebugFlag></GUIEntry><FuncParameterCnt type="int">1</FuncParameterCnt><GUIEntryDescription type="string"></GUIEntryDescription></FillByte><FillWord type="key"><GUIEntry type="key"><MenuID type="int">10</MenuID><MenuString type="string">Execute FillWord ..</MenuString><ToolTipString type="string">Macro FillWord</ToolTipString><MessageString type="string">Execute macro FillWord</MessageString><DebugFlag type="flag">0</DebugFlag></GUIEntry><FuncParameterCnt type="int">1</FuncParameterCnt><GUIEntryDescription type="string"></GUIEntryDescription></FillWord><FillDWord type="key"><GUIEntry type="key"><MenuID type="int">10</MenuID><MenuString type="string">Execute FillDWord ..</MenuString><ToolTipString type="string">Macro FillDWord</ToolTipString><MessageString type="string">Execute macro FillDWord</MessageString><DebugFlag type="flag">0</DebugFlag></GUIEntry><FuncParameterCnt type="int">1</FuncParameterCnt><GUIEntryDescription type="string"></GUIEntryDescription></FillDWord><NoOfFunctions type="int">5</NoOfFunctions></Macro_23_04_13_13_50_43_0></MacroGuiEntries><LastSelectedMacro type="string"></LastSelectedMacro></UDE.Script></AddOns><MultiCoreRunControl type="key"><NoOfRunCtrlGroups type="int">0</NoOfRunCtrlGroups></MultiCoreRunControl><Core type="key"><ViewSrv type="key"><PowerPcCpuWin type="key"><SAVED_VIEW_OBJS type="int">1</SAVED_VIEW_OBJS><OPEN_VIEW type="key"><FrameCreated type="string">23.04.2013 11:22:41:993</FrameCreated><ViewSrv type="key"/><NETFrameMode type="int">77827</NETFrameMode><NETFrameSaveIndex type="int">5</NETFrameSaveIndex><FrameUserTitle type="string"></FrameUserTitle><CommonVisibilityGroup type="flag">0</CommonVisibilityGroup><VisibilityGroup_1 type="string">Target0.Controller0.Core</VisibilityGroup_1><VisibilityGroupsCnt type="int">1</VisibilityGroupsCnt></OPEN_VIEW><SAVED_VIEW type="int">0</SAVED_VIEW></PowerPcCpuWin><StdUDESymbolExplWin type="key"><OPEN_VIEW type="key"><FrameCreated type="string">23.04.2013 11:22:37:665</FrameCreated><ViewSrv type="key"/><NETFrameMode type="int">77826</NETFrameMode><NETFrameSaveIndex type="int">4</NETFrameSaveIndex><FrameUserTitle type="string"></FrameUserTitle><CommonVisibilityGroup type="flag">0</CommonVisibilityGroup><VisibilityGroup_1 type="string">Target0.Controller0.Core</VisibilityGroup_1><VisibilityGroupsCnt type="int">1</VisibilityGroupsCnt></OPEN_VIEW><SAVED_VIEW_OBJS type="int">1</SAVED_VIEW_OBJS><SAVED_VIEW type="int">0</SAVED_VIEW></StdUDESymbolExplWin><StdUDEProgWin type="key"><SAVED_VIEW_OBJS type="int">1</SAVED_VIEW_OBJS><OPEN_VIEW00 type="key"><Fram