SourcePoint Intel 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
- Trace Window
- Trace Window Overview
- How To - Trace Window
- Advanced
- Viewpoint Window
- Viewpoint Window Overview
- Watch Window
- Watch Window Overview
- How To - Watch Window
- Technical Notes
- Descriptor Cache: Revealing Hidden Registers
- UEFI Framework Debugging
- Memory Casting
- Microsoft PE Format Support in SourcePoint
- Multi-Clustering
- Python/CScripts
- OpenIPC Integration, Installation and Usage
- Registers Keyword Table
- SourcePoint Licensing
- Stepping
- Symbols Textsym Format
- Target Configuration
- Using Bookmarks
- Which Processor Is Which
- Getting Started with DbC
- 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
- cscfg, local_cscfg
- csr
- ctime
- cwd
- dbgbreak commands
- defaultpath
- #define
- define
- definemacro
- deviceconfigure
- devicelist
- devicescan
- disconnect
- displayflag
- do while
- dos
- dport
- drscan
- edit
- editor
- emubreak, emuremove, emudisable, emuenable
- 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
- itpcompatible
- jtagchain
- jtagconfigure
- jtagdeviceadd
- jtagdeviceclear
- jtagdevices
- jtagscan
- jtagtest
- keys
- last
- last_jtag_device
- left
- libcall
- 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
- num_uncore_devices
- openipc
- 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
- uncoreconfigure
- uncorescan
- #undef
- unload
- unloadproject
- upload
- use
- verify
- verifydeviceconfiguration
- verifyjtagconfiguration
- version
- viewpoint
- vpalias
- wait
- wbinvd
- while
- windowrefresh
- wport
- writesetting
- yield
- yieldflag
libcall
Define a function interface to a DLL library.
Syntax
libcall(lib, func,[name], ret-type[,{[byref] arg-type}[,...]][, ...])
Where:
lib |
is a string expression indicating the library containing the function to import into SourcePoint. |
func |
is a string expression specifying the function within the library. |
name |
is a string expression defining the keyword to be used by SourcePoint when accessing the function. This name must not be the same as SourcePoint keywords or previously defined user functions. If not specified the keyword will be the same as strInterface. |
ret-type |
is the return type of function: {void | string | data-type} |
arg-type |
is the type of an argument passed to the function {string | data-type | data-type[ ]} |
data-type |
is a parameter type specification. |
void |
specifies there is no return type. |
byref |
indicates that the following parameter is to be passed in as a reference. |
string |
is a string parameter. |
data-type[ ] |
is an array parameter. |
... |
(ellipsis) indicates a variable type/length parameter list. If specified, it must be last. |
Discussion
Use the libcall command to create an interface to an exported function in a DLL that can then be called from the SourcePoint command line as a user defined function.
The first parameter specified is the library in which the exported function resides.
The second parameter specified is the case-sensitive interface name of the exported function within the external library.
The third parameter is the case-sensitive alias within SourcePoint with which the exported function may be accessed. This alias may be omitted (though the trailing comma still must be present) in which case the same name as the exported function is used.
Note: ย ย If the function defined already exists in SourcePoint (e.g., printf), then the internal function in SourcePoint will be used.
After specifying the user-defined function's name and where to access it in a DLL, the return type and parameter list must be specified in a manner which will match the exported function within the DLL.
The return type of a user-defined function may either be a ord, int, real, void, or a string. ย Return types cannot be specified as references, arrays, structures, etc.
A parameter defined with the byref keyword is an out or in/out parameter. ย Without the byref keyword, the parameter is an in parameter.
Parameter types of byref, string, and array are passed as pointers to the external library call.
An ellipsis as a parameter list or at the end of a parameter list indicates the user-defined function has a variable number and type of parameters.
Libcall determines whether a function is declared in a dll as either _cdecl or _stdcall.
Arrays are not currently supported.
Example 1
To call some functions in the Microsoft run-time library MSVCRTD.DLL:
Command input:
libcall("msvcrt.dll", "atof",,double,string)
define double pi
pi=atof("3.14159")
ย
libcall("msvcrtd","rand",,ord2)
define ord4 result
result=rand()
Example 2
To call the MessageBox() function in the Microsoft library USER32.DLL:
Command input:
libcall("user32.dll","MessageBoxA",,ord4 ord4, string, string, ord4)
define ord4 result
result=MessageBoxA(0, "Test Text","Caption",3)
Example 3
To call the sscanf() function in the Microsoft run-time library and rename it to _sscanf:
Command input:
libcall("msvcrt.dll","sscanf",_sscanf,ord4,string,string,...)
define string _str = "1/2/2008"
define ord4 mon, day, yr, result
result = _sscanf(_str,"%d/%d/%d",byref mon,byref day,byref yr)
Example 4
To call the TestCall1() function in a user-created dll called testdll.dll which returns a value in the byref parameter:
Command input:
libcall("testdll.dll","TestCall1",,ord4, byref ord4)
define ord4 outvalue
TestCall1(byref outvalue)
Related Topics:
ย
ย