original files of m241
This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
/* dll.h - doubly linked list library */
|
||||
|
||||
/* Copyright 1984-2002 Wind River Systems, Inc. */
|
||||
|
||||
/*
|
||||
modification history
|
||||
--------------------
|
||||
01e,19apr06,tbu Added dll_insert_tail and dll_insert_head
|
||||
01d,25apr02,jhw Added C++ support (SPR 76304).
|
||||
01c,11oct95,ms removed "static __inline__" (SPR #4500)
|
||||
01b,05apr95,ms cleanup + fixes for when !define(__GNUC__).
|
||||
01a,10oct94,rrr written.
|
||||
*/
|
||||
|
||||
#ifndef _INCdllh
|
||||
#define _INCdllh
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct __dll
|
||||
{
|
||||
struct __dll *__dll_next;
|
||||
struct __dll *__dll_prev;
|
||||
} dll_t;
|
||||
|
||||
#define __dll_init(d) ((d)->__dll_next = (d)->__dll_prev = (d))
|
||||
#define __dll_remove(d) ((d)->__dll_prev->__dll_next = (d)->__dll_next, \
|
||||
(d)->__dll_next->__dll_prev = (d)->__dll_prev)
|
||||
#define __dll_head(d) ((d)->__dll_next)
|
||||
#define __dll_tail(d) ((d)->__dll_prev)
|
||||
#define __dll_next(d) ((d)->__dll_next)
|
||||
#define __dll_prev(d) ((d)->__dll_prev)
|
||||
#define __dll_end(d) (d)
|
||||
#define __dll_empty(d) ((d)->__dll_next == (d))
|
||||
#define __dll_insert(pNode, pPrev) { \
|
||||
__dll_next(pNode) = __dll_next(pPrev); \
|
||||
__dll_prev(pNode) = (pPrev); \
|
||||
__dll_next(pPrev) = (pNode); \
|
||||
__dll_prev(__dll_next(pNode)) = (pNode); \
|
||||
}
|
||||
|
||||
#define __dll_insert_tail(pNode, pPrev) { \
|
||||
__dll_next(pNode) = (pPrev); \
|
||||
__dll_prev(pNode) = __dll_prev(pPrev); \
|
||||
__dll_next(dll_prev(pPrev)) = (pNode); \
|
||||
__dll_prev(pPrev) = (pNode); \
|
||||
}
|
||||
|
||||
#define dll_empty(pList) __dll_empty(pList)
|
||||
#define dll_insert(pNode, pPrev) __dll_insert(pNode, pPrev)
|
||||
#define dll_init(pNode) __dll_init(pNode)
|
||||
#define dll_remove(pNode) __dll_remove(pNode)
|
||||
#define dll_head(pNode) __dll_head(pNode)
|
||||
#define dll_tail(pNode) __dll_tail(pNode)
|
||||
#define dll_next(pNode) __dll_next(pNode)
|
||||
#define dll_prev(pNode) __dll_prev(pNode)
|
||||
#define dll_end(pNode) __dll_end(pNode)
|
||||
|
||||
#define dll_insert_head(pNode,pPrev) dll_insert(pNode,pPrev)
|
||||
#define dll_insert_tail(pNode,pPrev) __dll_insert_tail(pNode,pPrev)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _INCdllh */
|
||||
@@ -0,0 +1,163 @@
|
||||
/* dwarfExprLib.h - dwarf expressions evaluator */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2008-2010 Wind River Systems, Inc.
|
||||
*
|
||||
* The right to copy, distribute, modify or otherwise make use
|
||||
* of this software may be licensed only pursuant to the terms
|
||||
* of an applicable Wind River license agreement.
|
||||
*/
|
||||
|
||||
/*
|
||||
modification history
|
||||
--------------------
|
||||
01i,24feb10,rlp Added the DWARF_ERR_STACK_TOO_SMALL error code.
|
||||
01h,16sep09,bpn Added comments. Reviewed piece type management.
|
||||
01g,18jun09,bpn Fixed build error on solaris host.
|
||||
01f,11jun09,bpn Fixed piece max size definition.
|
||||
01e,28may09,bpn Added support of pieces. Added new errors.
|
||||
01d,07may08,bpn Moved type defines from dwarExprLib.c.
|
||||
01c,18apr07,dbt Updated APIs + cleanup
|
||||
01b,02apr08,bpn Fixed target and host build.
|
||||
+cad
|
||||
01a,16jan08,tbu created
|
||||
*/
|
||||
|
||||
#ifndef __INCdwarfExprLibh
|
||||
#define __INCdwarfExprLibh
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* defines */
|
||||
|
||||
/* dwarf program header offsets */
|
||||
|
||||
#define DWARF_HDR_PROG_VERSION 0 /* program version */
|
||||
#define DWARF_HDR_PROG_ENDIAN 1 /* program endianness (1 = BE) */
|
||||
#define DWARF_HDR_PROG_HDR_SIZE 2 /* progam header size */
|
||||
#define DWARF_HDR_PROG_PTR_SIZE 3 /* pointer size */
|
||||
#define DWARF_HDR_PROG_SIZE_HI 4 /* high order byte of program size */
|
||||
#define DWARF_HDR_PROG_SIZE_LO 5 /* low order byte of program size */
|
||||
|
||||
/* dwarf types */
|
||||
|
||||
#define DWARF_U_CHAR_TYPE unsigned char
|
||||
#define DWARF_U_SHORT_TYPE unsigned short
|
||||
#define DWARF_U_INT_TYPE unsigned int
|
||||
#define DWARF_U_LONG_TYPE unsigned long
|
||||
#ifdef WIN32
|
||||
#define DWARF_U_LLONG_TYPE unsigned __int64
|
||||
#else /* !WIN32 */
|
||||
#define DWARF_U_LLONG_TYPE unsigned long long
|
||||
#endif /* WIN32 */
|
||||
#define DWARF_U_FLOAT_TYPE float
|
||||
#define DWARF_U_DOUBLE_TYPE double
|
||||
|
||||
#define DWARF_S_CHAR_TYPE char
|
||||
#define DWARF_S_SHORT_TYPE short
|
||||
#define DWARF_S_INT_TYPE int
|
||||
#define DWARF_S_LONG_TYPE long
|
||||
#ifdef WIN32
|
||||
#define DWARF_S_LLONG_TYPE __int64
|
||||
#else /* !WIN32 */
|
||||
#define DWARF_S_LLONG_TYPE long long
|
||||
#endif
|
||||
#define DWARF_S_FLOAT_TYPE float
|
||||
#define DWARF_S_DOUBLE_TYPE double
|
||||
|
||||
#ifndef DWARF_PIECE_MAX_SIZE /* Max size of a reconstructed piece value */
|
||||
#define DWARF_PIECE_MAX_SIZE (sizeof (DWARF_U_LLONG_TYPE))
|
||||
#endif
|
||||
|
||||
#ifndef DWARF_BYTE_ORDER
|
||||
/*
|
||||
* Define the byte order of the machine that runs the evaluator. We can't use
|
||||
* _BYTE_ORDER, _BIG_ENDIAN and _LITTLE_ENDIAN directly because SPARC machine
|
||||
* defines differently _BIG_ENDIAN and _LITTLE_ENDIAN macros, without a value.
|
||||
* So use a specific way to specify byte ordering for internal use of the
|
||||
* DWARF evaluator
|
||||
*/
|
||||
#define DWARF_BYTE_ORDER _BYTE_ORDER
|
||||
#define DWARF_BIG_ENDIAN _BIG_ENDIAN
|
||||
#define DWARF_LITTLE_ENDIAN _LITTLE_ENDIAN
|
||||
#endif
|
||||
|
||||
/* dwarf element types */
|
||||
|
||||
typedef enum
|
||||
{
|
||||
DWARF_UNKNOWN_VAL = 0,
|
||||
DWARF_CHAR_VAL = 1,
|
||||
DWARF_SHORT_VAL = 2,
|
||||
DWARF_INT_VAL = 3,
|
||||
DWARF_LONG_VAL = 4,
|
||||
DWARF_LLONG_VAL = 5,
|
||||
DWARF_FLOAT_VAL = 6,
|
||||
DWARF_DOUBLE_VAL = 7,
|
||||
DWARF_PIECE_VAL = 8
|
||||
} DWARF_ELT_TYPE;
|
||||
|
||||
/* dwarf evaluator status values */
|
||||
|
||||
typedef enum dwarf_status
|
||||
{
|
||||
DWARF_OK = 0, /* OK status */
|
||||
DWARF_ERR_INVALID_PARAMS = 1, /* params invalid */
|
||||
DWARF_ERR_INVALID_MEM_ACCESS = 2, /* memory fault */
|
||||
DWARF_ERR_INVALID_CTX = 3, /* bad context */
|
||||
DWARF_ERR_INVALID_REG = 4, /* invalid register */
|
||||
DWARF_ERR_INVALID_OPCODE = 5, /* invalid opcode */
|
||||
DWARF_ERR_TLS_NOT_SUPPORTED = 6, /* no TLS support */
|
||||
DWARF_ERR_INVALID_PROG = 7, /* invalid dwarf program */
|
||||
DWARF_ERR_UNSUPPORTED_PIECE_SIZE = 8, /* generated piece value size */
|
||||
/* is not supported */
|
||||
DWARF_ERR_PIECE_SIZE_TO_BIG = 9, /* piece value size if greater */
|
||||
/* than piece buffer size */
|
||||
DWARF_ERR_STACK_TOO_SMALL = 10 /* DWARF stack too small */
|
||||
} DWARF_STATUS;
|
||||
|
||||
/* an element of the stack */
|
||||
|
||||
typedef struct /* dwarf element */
|
||||
{
|
||||
DWARF_ELT_TYPE type; /* element type */
|
||||
BOOL signedVal; /* TRUE=signed, FALSE=unsigned */
|
||||
UINT32 pieceBitSize; /* current piece bit size */
|
||||
union
|
||||
{
|
||||
DWARF_S_CHAR_TYPE charVal;
|
||||
DWARF_U_CHAR_TYPE u_charVal;
|
||||
DWARF_S_SHORT_TYPE shortVal;
|
||||
DWARF_U_SHORT_TYPE u_shortVal;
|
||||
DWARF_S_INT_TYPE intVal;
|
||||
DWARF_U_INT_TYPE u_intVal;
|
||||
DWARF_S_LONG_TYPE longVal;
|
||||
DWARF_U_LONG_TYPE u_longVal;
|
||||
DWARF_S_LLONG_TYPE llongVal;
|
||||
DWARF_U_LLONG_TYPE u_llongVal;
|
||||
#ifdef DWARF_FLOAT_SUPPORT
|
||||
DWARF_S_FLOAT_TYPE floatVal;
|
||||
DWARF_S_DOUBLE_TYPE doubleVal;
|
||||
#endif /* DWARF_FLOAT_SUPPORT */
|
||||
DWARF_U_CHAR_TYPE pieceVal[DWARF_PIECE_MAX_SIZE];
|
||||
} val; /* element value */
|
||||
} DWARF_ELT;
|
||||
|
||||
/* extern declarations */
|
||||
|
||||
extern DWARF_STATUS dwarfExprEval (const void * dwarfProg,
|
||||
void * ctxId, void * pRegs,
|
||||
BOOL dryRun, int * pExitVal,
|
||||
DWARF_ELT * pValue);
|
||||
extern DWARF_STATUS dwarfExprOpSearch (const void * dwarfProg,
|
||||
UCHAR opcode, char * pattern,
|
||||
size_t patternSize, void ** pPos);
|
||||
extern UINT32 dwarfExprSizeGet (DWARF_ELT * pElement);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __INCdwarfExprLibh */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,177 @@
|
||||
/* wdbBpLib.h - wdb break point library */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994-1999,2002-2010 Wind River Systems, Inc.
|
||||
*
|
||||
* The right to copy, distribute, modify or otherwise make use of this
|
||||
* software may be licensed only pursuant to the terms of an applicable Wind
|
||||
* River license agreement.
|
||||
*/
|
||||
|
||||
/*
|
||||
modification history
|
||||
--------------------
|
||||
02f,22sep10,rlp Modified WDB_BP_ADD_HOOK_FUNCPTR typedef (WIND00186557).
|
||||
02e,29apr10,pad Moved extern C statement after include statements.
|
||||
02d,10dec09,rlp Adapted to LP64 model.
|
||||
02c,27aug08,jpb Renamed VSB header file
|
||||
02b,24jun08,jpb Added include path for kernel configurations options set in
|
||||
vsb. Renamed _WRS_VX_SMP to _WRS_CONFIG_SMP.
|
||||
02a,18jun08,dbt Added wdbBpAddHookAdd() routine.
|
||||
01z,11jul07,rlp Added SMP support.
|
||||
01y,06jul07,p_b Added 64bits support
|
||||
01x,18oct06,rlp Used debug library (REQ00007655).
|
||||
01w,14nov05,dbt Removed wdbRegs.h inclusiong.
|
||||
01v,08mar04,elg Change WDB_CTX structure.
|
||||
01u,13nov03,elg Change WDB_BP_CTX_BP_ADD() prototype.
|
||||
01t,10oct03,elg Remove debug handler function pointers.
|
||||
01s,29sep03,tbu go back
|
||||
01r,15sep03,tbu Added wdbSysBpLibInit prototype
|
||||
01q,27feb03,elg Merge file with BSD and define new interface.
|
||||
01p,25apr02,jhw Added C++ support (SPR 76304).
|
||||
01o,28oct99,elg Add support for all-tasks breakpoints.
|
||||
01n,07oct99,elg Remove _wdbPdStop() and _wdbPdCont() declarations.
|
||||
01m,04aug99,elg Fix WDB dependencies problem.
|
||||
01l,26may99,elg Add new debug facilities for protection domains.
|
||||
01k,21apr98,dbt removed useless defines for ARM.
|
||||
01j,04feb98,dbt moved wdbSysBpLibInit() and wdbTaskBpLibInit() to wdbLib.h
|
||||
01i,12jan98,dbt modified for new debugger scheme
|
||||
01h,17apr97,cdp added Thumb (ARM7TDMI_T) support.
|
||||
01g,28nov96,cdp added ARM support.
|
||||
01f,22jul96,jmb merged mem's (ease) patch for HPSIM.
|
||||
01e,20may96,ms imported prototypes and macros from wdb[Task]BpLib.h.
|
||||
01d,25feb96,tam added single step support for PPC403.
|
||||
01d,04apr96,ism added simsolaris support
|
||||
01c,23jan96,tpr added PowerPC support.
|
||||
01c,28nov95,mem added MIPS support, added macros WDB_CTX_{LOAD,SAVE}.
|
||||
01b,08jun95,ms change CPU==SPARC to CPU_FAMILY==SPARC
|
||||
01a,20nov94,rrr written.
|
||||
*/
|
||||
|
||||
#ifndef __INCwdbBpLibh
|
||||
#define __INCwdbBpLibh
|
||||
|
||||
/* includes */
|
||||
|
||||
#include <vsbConfig.h>
|
||||
#include <private/vxdbgLibP.h>
|
||||
#include <wdb/dll.h>
|
||||
#ifdef _WRS_CONFIG_SMP
|
||||
#include <cpuset.h>
|
||||
#endif /* _WRS_CONFIG_SMP */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef _ASMLANGUAGE
|
||||
|
||||
/* defines */
|
||||
|
||||
/* Breakpoint macros */
|
||||
|
||||
#define BP_INSTALLED 0x80 /* breakpoint installed */
|
||||
|
||||
#define BP_BASE(p) ((struct wdb_brkpt *) (p))
|
||||
|
||||
/* Breakpoint context macros */
|
||||
|
||||
#define WDB_BP_CTX(pCtx) (pWdbCtxBpIf [(pCtx)->contextType])
|
||||
#define WDB_BP_ENTRY(pCtx) (pWdbCtxBpIf [(pCtx)->context.contextType])
|
||||
|
||||
#define WDB_BP_CTX_BP_ADD(pCtx, pAction, addr, count, type, pId) \
|
||||
(WDB_BP_CTX (pCtx) == NULL ? \
|
||||
WDB_ERR_NO_RT_CTX : \
|
||||
((WDB_BP_CTX (pCtx))->bpAdd == NULL ? \
|
||||
WDB_ERR_NO_RT_PROC : \
|
||||
(WDB_BP_CTX (pCtx))->bpAdd ((pCtx), (pAction), (addr), \
|
||||
(count), (type), (pId))))
|
||||
|
||||
#define WDB_BP_CTX_STEP(pCtx) \
|
||||
(WDB_BP_ENTRY (pCtx) == NULL ? \
|
||||
WDB_ERR_NO_RT_CTX : \
|
||||
(WDB_BP_ENTRY (pCtx))->step == NULL ? \
|
||||
WDB_ERR_NO_RT_PROC : \
|
||||
(WDB_BP_ENTRY (pCtx))->step (WDB_CTX_ID_GET (&(pCtx)->context),\
|
||||
(pCtx)->startAddr, \
|
||||
(pCtx)->endAddr))
|
||||
|
||||
#define WDB_BP_CTX_STOP(pCtx) \
|
||||
(WDB_BP_CTX (pCtx) == NULL ? \
|
||||
WDB_ERR_NO_RT_CTX : \
|
||||
(WDB_BP_CTX (pCtx))->stop == NULL ? \
|
||||
WDB_ERR_NO_RT_PROC : \
|
||||
(WDB_BP_CTX (pCtx))->stop (WDB_CTX_ID_GET (pCtx)))
|
||||
|
||||
#define WDB_BP_CTX_CONT(pCtx) \
|
||||
(WDB_BP_CTX (pCtx) == NULL ? \
|
||||
WDB_ERR_NO_RT_CTX : \
|
||||
(WDB_BP_CTX (pCtx))->cont == NULL ? \
|
||||
WDB_ERR_NO_RT_PROC : \
|
||||
(WDB_BP_CTX (pCtx))->cont (WDB_CTX_ID_GET (pCtx)))
|
||||
|
||||
/* typedefs */
|
||||
|
||||
typedef struct wdb_ctx_bp_if
|
||||
{
|
||||
UINT32 (*bpAdd) (WDB_CTX * pCtx, WDB_ACTION * pAction, void * addr,
|
||||
UINT32 count, UINT32 type, ULONG * pId);
|
||||
UINT32 (*step) (ULONG contextId, INSTR * startAddr, INSTR * endAddr);
|
||||
UINT32 (*stop) (ULONG contextId);
|
||||
UINT32 (*cont) (ULONG contextId);
|
||||
} WDB_CTX_BP_IF;
|
||||
|
||||
typedef struct wdb_brkpt /* breakpoint structure */
|
||||
{
|
||||
dll_t chain; /* breakpoint chain */
|
||||
void * addr; /* breakpoint address */
|
||||
void (*callRtn)(_Vx_usr_arg_t callArg, REG_SET * pRegSet);
|
||||
/* routine to call (if any) */
|
||||
_Vx_usr_arg_t callArg; /* called routine argument */
|
||||
UINT32 id; /* breakpoint ID */
|
||||
UINT32 count; /* breakpoint count */
|
||||
UINT32 action; /* action associated with breakpoint */
|
||||
INSTR instr; /* instruction at breakpoint address */
|
||||
UINT16 type; /* breakpoint type (software or hardware) */
|
||||
UINT8 flags; /* breapoint flags */
|
||||
#ifdef _WRS_CONFIG_SMP
|
||||
cpuset_t cpus; /* processors number where */
|
||||
/* hardware BP is installed */
|
||||
#endif /* _WRS_CONFIG_SMP */
|
||||
} WDB_BRKPT;
|
||||
|
||||
typedef UINT32 (*WDB_BP_ADD_HOOK_FUNCPTR) (WDB_EVTPT_ADD_DESC * pBp);
|
||||
|
||||
/* externs */
|
||||
|
||||
/* context specific debug interface */
|
||||
|
||||
extern WDB_CTX_BP_IF * pWdbCtxBpIf [WDB_CTX_TYPE_NUM];
|
||||
|
||||
extern void (*wdbBpSysEnterHook) (void);
|
||||
extern void (*wdbBpSysExitHook) (void);
|
||||
|
||||
#ifdef _WRS_BP_ACTION_SYS_STOP
|
||||
/*
|
||||
* We no longer support task-mode breakpoints with WDB_ACTION_SYS_STOP
|
||||
* action. We keep the code for now, in case this type of action will
|
||||
* be needed again.
|
||||
*/
|
||||
|
||||
extern void (*_func_wdbSystemStop) (WDB_IU_REGS * pRegisters,
|
||||
void * addr, BOOL notify);
|
||||
#endif /* _WRS_BP_ACTION_SYS_STOP */
|
||||
|
||||
/* function declarations */
|
||||
|
||||
extern void wdbSysBpEnableAll (void);
|
||||
extern void wdbSysBpDisableAll (void);
|
||||
extern STATUS wdbBpAddHookAdd (WDB_BP_ADD_HOOK_FUNCPTR hook);
|
||||
|
||||
#endif /* _ASMLANGUAGE */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __INCwdbBpLibh */
|
||||
@@ -0,0 +1,106 @@
|
||||
/* wdbCommIfLib.h - header file for the WDB agents communication interface */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994,1995,2002,2005,2010,2011 Wind River Systems, Inc.
|
||||
*
|
||||
* The right to copy, distribute, modify or otherwise make use of this
|
||||
* software may be licensed only pursuant to the terms of an applicable Wind
|
||||
* River license agreement.
|
||||
*/
|
||||
|
||||
/*
|
||||
modification history
|
||||
--------------------
|
||||
01j,08apr11,rlp Added ioctl method to WDB_COMM_IF structure.
|
||||
01i,04mar11,jmp Fixed foundation/wdbagent-ptrace build.
|
||||
01h,31jan11,rlp Fully qualified all function pointers of wdb_comm_if structure.
|
||||
01g,29jul10,pad Moved extern C statement after include statements.
|
||||
01f,06dec05,dbt Remove references to sockaddr_in.
|
||||
01e,01dec05,dbt Removed references to timeval structure.
|
||||
01d,25apr02,jhw Added C++ support (SPR 76304).
|
||||
01c,03jun95,ms changed read/write to sendto/rcvfrom
|
||||
01b,05apr95,ms new data types.
|
||||
01a,23sep94,ms written.
|
||||
*/
|
||||
|
||||
#ifndef __INCwdbCommIfLibh
|
||||
#define __INCwdbCommIfLibh
|
||||
|
||||
/* includes */
|
||||
|
||||
#ifndef LINUX_TARGET
|
||||
#include <vxWorks.h>
|
||||
#include <netBufLib.h>
|
||||
#endif /* !LINUX_TARGET */
|
||||
#include <wdb/wdb.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* definitions */
|
||||
|
||||
#define WDB_COMM_MODE_POLL 1
|
||||
#define WDB_COMM_MODE_INT 2
|
||||
|
||||
/* data types */
|
||||
|
||||
/*
|
||||
* WDB_COMM_IF - interface used by the agent to talk to the host.
|
||||
*/
|
||||
|
||||
typedef void * WDB_COMM_ID;
|
||||
|
||||
typedef struct wdb_comm_if
|
||||
{
|
||||
WDB_COMM_ID commId;
|
||||
int (*rcvfrom) (WDB_COMM_ID commId, char * addr, UINT32 len,
|
||||
void * pAddr, UINT32 addrLength, INT32 timeout);
|
||||
int (*sendto) (WDB_COMM_ID commId, char * addr, UINT32 len,
|
||||
void * pAddr, UINT32 addrLength);
|
||||
int (*modeSet) (WDB_COMM_ID commId, UINT32 newMode);
|
||||
int (*cancel) (WDB_COMM_ID commId);
|
||||
int (*hookAdd) (WDB_COMM_ID commId, void (*rout)(UINT32 arg),UINT32 arg);
|
||||
int (*notifyHost) (WDB_COMM_ID commId);
|
||||
int (*ioctl) (WDB_COMM_ID commId, int function, long arg);
|
||||
} WDB_COMM_IF;
|
||||
|
||||
#ifndef LINUX_TARGET
|
||||
/*
|
||||
* WDB_DRV_IF - interface between a driver and the agents pseudo-UDP/IP stack
|
||||
*
|
||||
* The default agent configuration uses the native VxWorks UDP/IP stack which
|
||||
* has its own interface to a driver (a net_if structure).
|
||||
* The agent can also be configured to use a pseudo-UDP/IP stack that
|
||||
* is independant of the OS. The pseudo-UDP/IP stack is used for
|
||||
* communication with the system mode agent.
|
||||
* The WDB_DRV_IF structure allows new drivers to be installed in the
|
||||
* pseudo-UDP/IP stack.
|
||||
*/
|
||||
|
||||
typedef struct wdb_drv_if
|
||||
{
|
||||
UINT32 mode; /* available device modes */
|
||||
UINT32 mtu; /* maximum transmit packet size */
|
||||
/* callback when pkt arrives */
|
||||
void (*stackRcv)(struct mbuf * pMbuf);
|
||||
|
||||
/* driver routines */
|
||||
|
||||
void * devId; /* device ID */
|
||||
/* poll device for data */
|
||||
STATUS (*pollRtn)(void * pDev);
|
||||
/* transmit a packet */
|
||||
STATUS (*pktTxRtn)(void * pDev, struct mbuf * pMbuf);
|
||||
/* toggle driver mode */
|
||||
STATUS (*modeSetRtn)(void * pDev, uint_t mode);
|
||||
int (*ioctlRtn)(void * pDev, int function, _Vx_usr_arg_t arg); /* misc */
|
||||
} WDB_DRV_IF;
|
||||
#endif /* !LINUX_TARGET */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __INCwdbCommIfLibh */
|
||||
|
||||
@@ -0,0 +1,157 @@
|
||||
/* wdbCtxIfLib.h - header file for the WDB agent context runtime interface */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2003-2006, 2009-2010 Wind River Systems, Inc.
|
||||
*
|
||||
* The right to copy, distribute, modify or otherwise make use of this
|
||||
* software may be licensed only pursuant to the terms of an applicable Wind
|
||||
* River license agreement.
|
||||
*/
|
||||
|
||||
/*
|
||||
modification history
|
||||
--------------------
|
||||
01l,29jul10,pad Moved extern C statement after include statements.
|
||||
01k,14sep09,rlp Adapted to LP64 model.
|
||||
01j,11sep06,vhe Fix CQ:WIND00061957, use of reserved word
|
||||
01i,21dec05,dbt Added WDB_CTX_ID_GET() definition.
|
||||
01h,28nov05,dbt Removed unused context stop() and continue() APIs.
|
||||
01g,14nov05,dbt Removed useless information.
|
||||
01f,13apr04,elg Remove obsolete type WDB_REG_SET_TYPE.
|
||||
01e,23mar04,elg Move macros to get information on context in wdbOsLib.h
|
||||
01d,08mar04,elg Change WDB_CTX structure.
|
||||
01c,12sep03,tbu Moved inclusion of netinet/in_systm.h to wdbOsLib.h
|
||||
01b,22may03,elg Modify context creation hook add API to add action type.
|
||||
01a,11mar03,elg Written.
|
||||
*/
|
||||
|
||||
#ifndef __INCwdbCtxIfLibh
|
||||
#define __INCwdbCtxIfLibh
|
||||
|
||||
/* includes */
|
||||
|
||||
#include <wdb/wdb.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* data types */
|
||||
|
||||
typedef struct wdb_ctx_if
|
||||
{
|
||||
UINT32 (*ctxCreate) (WDB_CTX_CREATE_DESC * pCtx, ULONG * pRetVal);
|
||||
UINT32 (*ctxDelete) (WDB_CTX_KILL_DESC * pCtx);
|
||||
UINT32 (*suspend) (ULONG ctxId);
|
||||
UINT32 (*resume) (ULONG ctxId);
|
||||
UINT32 (*attach) (WDB_CTX * pCtx);
|
||||
UINT32 (*detach) (WDB_CTX * pCtx);
|
||||
UINT32 (*regsGet) (WDB_CTX * pCtx, UINT32 type, char ** ppRegs);
|
||||
UINT32 (*regsSet) (WDB_CTX * pCtx, UINT32 type, char * pRegs);
|
||||
UINT32 (*createHookAdd) (VOIDFUNCPTR hook, WDB_ACTION_TYPE actionType);
|
||||
UINT32 (*deleteHookAdd) (ULONG pCtx, VOIDFUNCPTR hook);
|
||||
UINT32 (*statusGet) (WDB_CTX * pCtx, UINT32 * pStatus);
|
||||
UINT32 (*idVerify) (ULONG ctxId);
|
||||
} WDB_CTX_IF;
|
||||
|
||||
/* context specific macros */
|
||||
|
||||
#define WDB_RT_CTX(pCtx) pWdbRtIf->pWdbCtxIf [(pCtx)->contextType]
|
||||
|
||||
#define WDB_RT_ENTRY(pEntry) \
|
||||
pWdbRtIf->pWdbCtxIf [(pCtx)->context.contextType]
|
||||
|
||||
#define WDB_CTX_ID_GET(pCtx) ((pCtx)->numArgs > 0 ? (pCtx)->args [0] : 0)
|
||||
|
||||
#define WDB_RT_CTX_CREATE(pCtxCreate, pCid) \
|
||||
(WDB_RT_CTX (pCtxCreate) == NULL ? \
|
||||
WDB_ERR_NO_RT_CTX : \
|
||||
((WDB_RT_CTX (pCtxCreate))->ctxCreate == NULL ? \
|
||||
WDB_ERR_NO_RT_PROC : \
|
||||
(WDB_RT_CTX (pCtxCreate))->ctxCreate ((pCtxCreate), (pCid))))
|
||||
|
||||
#define WDB_RT_CTX_DELETE(pCtx) \
|
||||
(WDB_RT_ENTRY (pCtx) == NULL ? \
|
||||
WDB_ERR_NO_RT_CTX : \
|
||||
((WDB_RT_ENTRY (pCtx))->ctxDelete == NULL ? \
|
||||
WDB_ERR_NO_RT_PROC : \
|
||||
(WDB_RT_ENTRY (pCtx))->ctxDelete (pCtx)))
|
||||
|
||||
#define WDB_RT_CTX_SUSPEND(pCtx) \
|
||||
(WDB_RT_CTX (pCtx) == NULL ? \
|
||||
WDB_ERR_NO_RT_CTX : \
|
||||
((WDB_RT_CTX (pCtx))->suspend == NULL ? \
|
||||
WDB_ERR_NO_RT_PROC : \
|
||||
((WDB_RT_CTX (pCtx))->suspend (WDB_CTX_ID_GET (pCtx)) == OK ? \
|
||||
WDB_OK : WDB_ERR_RT_ERROR)))
|
||||
|
||||
#define WDB_RT_CTX_RESUME(pCtx) \
|
||||
(WDB_RT_CTX (pCtx) == NULL ? \
|
||||
WDB_ERR_NO_RT_CTX : \
|
||||
((WDB_RT_CTX (pCtx))->resume == NULL ? \
|
||||
WDB_ERR_NO_RT_PROC : \
|
||||
((WDB_RT_CTX (pCtx))->resume (WDB_CTX_ID_GET (pCtx)) == OK ? \
|
||||
WDB_OK : WDB_ERR_RT_ERROR)))
|
||||
|
||||
#define WDB_RT_CTX_ATTACH(pCtx) \
|
||||
(WDB_RT_CTX (pCtx) == NULL ? \
|
||||
WDB_ERR_NO_RT_CTX : \
|
||||
((WDB_RT_CTX (pCtx))->attach == NULL ? \
|
||||
WDB_ERR_NO_RT_PROC : \
|
||||
(WDB_RT_CTX (pCtx))->attach (pCtx)))
|
||||
|
||||
#define WDB_RT_CTX_DETACH(pCtx) \
|
||||
(WDB_RT_CTX (pCtx) == NULL ? \
|
||||
WDB_ERR_NO_RT_CTX : \
|
||||
((WDB_RT_CTX (pCtx))->detach == NULL ? \
|
||||
WDB_ERR_NO_RT_PROC : \
|
||||
(WDB_RT_CTX (pCtx))->detach (pCtx)))
|
||||
|
||||
#define WDB_RT_CTX_REGS_GET(pCtx, regType, pRegs) \
|
||||
(WDB_RT_CTX (pCtx) == NULL ? \
|
||||
WDB_ERR_NO_RT_CTX : \
|
||||
((WDB_RT_CTX (pCtx))->regsGet == NULL ? \
|
||||
WDB_ERR_NO_RT_PROC : \
|
||||
(WDB_RT_CTX (pCtx))->regsGet ((pCtx), (regType), (pRegs))))
|
||||
|
||||
#define WDB_RT_CTX_REGS_SET(pCtx, regType, pRegs) \
|
||||
(WDB_RT_CTX (pCtx) == NULL ? \
|
||||
WDB_ERR_NO_RT_CTX : \
|
||||
((WDB_RT_CTX (pCtx))->regsSet == NULL ? \
|
||||
WDB_ERR_NO_RT_PROC : \
|
||||
(WDB_RT_CTX (pCtx))->regsSet ((pCtx), (regType), (pRegs))))
|
||||
|
||||
#define WDB_RT_CTX_CREATE_HOOK_ADD(pCtx, hook, actionType) \
|
||||
(WDB_RT_CTX (pCtx) == NULL ? \
|
||||
WDB_ERR_NO_RT_CTX : \
|
||||
((WDB_RT_CTX (pCtx))->createHookAdd == NULL ? \
|
||||
WDB_ERR_NO_RT_PROC : \
|
||||
(WDB_RT_CTX (pCtx))->createHookAdd ((hook), (actionType))))
|
||||
|
||||
#define WDB_RT_CTX_DELETE_HOOK_ADD(pCtx, hook) \
|
||||
(WDB_RT_CTX (pCtx) == NULL ? \
|
||||
WDB_ERR_NO_RT_CTX : \
|
||||
((WDB_RT_CTX (pCtx))->deleteHookAdd == NULL ? \
|
||||
WDB_ERR_NO_RT_PROC : \
|
||||
(WDB_RT_CTX (pCtx))->deleteHookAdd (WDB_CTX_ID_GET (pCtx), \
|
||||
(hook))))
|
||||
|
||||
#define WDB_RT_CTX_STATUS_GET(pCtx, pStatus) \
|
||||
(WDB_RT_CTX (pCtx) == NULL ? \
|
||||
WDB_ERR_NO_RT_CTX : \
|
||||
((WDB_RT_CTX (pCtx))->statusGet == NULL ? \
|
||||
WDB_ERR_NO_RT_PROC : \
|
||||
(WDB_RT_CTX (pCtx))->statusGet ((pCtx), (pStatus))))
|
||||
|
||||
#define WDB_RT_CTX_ID_VERIFY(pCtx) \
|
||||
(WDB_RT_CTX (pCtx) == NULL ? \
|
||||
WDB_ERR_NO_RT_CTX : \
|
||||
((WDB_RT_CTX (pCtx))->idVerify == NULL ? \
|
||||
WDB_ERR_NO_RT_PROC : \
|
||||
(WDB_RT_CTX (pCtx))->idVerify (WDB_CTX_ID_GET (pCtx))))
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __INCwdbCtxIfLibh */
|
||||
@@ -0,0 +1,41 @@
|
||||
/* wdbDynPrintfLib.h - WDB dynamic printf support library */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2008 Wind River Systems, Inc.
|
||||
*
|
||||
* The right to copy, distribute, modify or otherwise make use
|
||||
* of this software may be licensed only pursuant to the terms
|
||||
* of an applicable Wind River license agreement.
|
||||
*/
|
||||
|
||||
/*
|
||||
modification history
|
||||
--------------------
|
||||
01a,18jul08,dbt created
|
||||
*/
|
||||
|
||||
#ifndef __INCwdbDynPrintfLibh
|
||||
#define __INCwdbDynPrintfLibh
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* defines */
|
||||
|
||||
/* dynamic printf output option */
|
||||
|
||||
#define WDB_DPRINTF_VERBOSE 1
|
||||
|
||||
/* function declarations */
|
||||
|
||||
extern STATUS wdbDynPrintfBpValidate (long arg);
|
||||
extern STATUS wdbDynPrintfExprEval (long arg, char * buffer, size_t size,
|
||||
void * pRegisters,
|
||||
long pid, int * pOptions);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __INCwdbDynPrintfLibh */
|
||||
@@ -0,0 +1,70 @@
|
||||
/* wdbEvtLib.h - header file for remote debug events */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2003-2005, 2009-2010 Wind River Systems, Inc.
|
||||
*
|
||||
* The right to copy, distribute, modify or otherwise make use of this
|
||||
* software may be licensed only pursuant to the terms of an applicable Wind
|
||||
* River license agreement.
|
||||
*/
|
||||
|
||||
/*
|
||||
modification history
|
||||
--------------------
|
||||
01j,29jul10,pad Moved extern C statement after include statements.
|
||||
01i,29sep09,rlp Removed obsolete structure definition.
|
||||
01h,06dec05,dbt Removed IMPORT references.
|
||||
01g,28feb03,elg Merge file from BSD/OS.
|
||||
01f,25apr02,jhw Added C++ support (SPR 76304).
|
||||
01e,12feb99,dbt use wdb/ prefix to include wdb.h header file.
|
||||
01d,04feb98,dbt moved eventpoint handling to wdbEvtptLib.h
|
||||
01c,07jun95,ms added prototype for wdbEvtptDeleteAll
|
||||
01b,05apr95,ms new data types.
|
||||
01a,20sep94,ms written.
|
||||
*/
|
||||
|
||||
#ifndef __INCwdbEvtLibh
|
||||
#define __INCwdbEvtLibh
|
||||
|
||||
/* includes */
|
||||
|
||||
#include <wdb/dll.h>
|
||||
#include <wdb/wdb.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* defines */
|
||||
|
||||
#define wdbEventListIsEmpty() (__wdbEventListIsEmpty == NULL ? TRUE : \
|
||||
(*__wdbEventListIsEmpty)())
|
||||
|
||||
/* data types */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
dll_t node;
|
||||
void (*getEvent) (void *arg, WDB_EVT_DATA *pEvtData);
|
||||
void (*deq) (void *arg);
|
||||
void * arg;
|
||||
BOOL onQueue;
|
||||
} WDB_EVT_NODE;
|
||||
|
||||
/* function prototypes */
|
||||
|
||||
extern void wdbEventNodeInit (WDB_EVT_NODE * pEvtNode,
|
||||
void (*getEvent) (void *arg,
|
||||
WDB_EVT_DATA *pEvtData),
|
||||
void (*deq) (void *arg),
|
||||
void *arg);
|
||||
extern void wdbEventPost (WDB_EVT_NODE * pEvtNode);
|
||||
extern STATUS wdbEventDeq (WDB_EVT_NODE * pEvtNode);
|
||||
extern BOOL (*__wdbEventListIsEmpty) (void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __INCwdbEvtLibh */
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
/* wdbEvtptLib.h - header file for remote debug eventpoints */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998-2000,2002-2003,2005,2007, 2010 Wind River Systems, Inc.
|
||||
*
|
||||
* The right to copy, distribute, modify or otherwise make use of this
|
||||
* software may be licensed only pursuant to the terms of an applicable Wind
|
||||
* River license agreement.
|
||||
*/
|
||||
|
||||
/*
|
||||
modification history
|
||||
--------------------
|
||||
01h,29jul10,pad Moved extern C statement after include statements.
|
||||
01g,26jun07,tbu Added 64 bit support
|
||||
+ p_b completed support
|
||||
01f,07nov05,dbt Removed wdbEvtptDeleteAll() macro.
|
||||
Replaced IMPORT with extern.
|
||||
01e,28feb03,elg Merge file from BSD/OS.
|
||||
01d,25apr02,jhw Added C++ support (SPR 76304).
|
||||
01c,25jan00,elg Add WDB_CORE in evtptAdd().
|
||||
01b,12feb99,dbt use wdb/ prefix to include wdb.h header file.
|
||||
01a,12feb98,dbt written.
|
||||
*/
|
||||
|
||||
#ifndef __INCwdbEvtptLibh
|
||||
#define __INCwdbEvtptLibh
|
||||
|
||||
/* includes */
|
||||
|
||||
#include <wdb/dll.h>
|
||||
#include <wdb/wdb.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* data types */
|
||||
|
||||
typedef struct /* hidden */
|
||||
{
|
||||
dll_t evtptList;
|
||||
WDB_EVT_TYPE evtptType;
|
||||
UINT32 (*evtptAdd) (WDB_CORE * pWdbCore,
|
||||
WDB_EVTPT_ADD_DESC * pEvtpt,
|
||||
TGT_LONG_T * pId);
|
||||
UINT32 (*evtptDel) (TGT_LONG_T * pId);
|
||||
} WDB_EVTPT_CLASS;
|
||||
|
||||
/* function prototypes */
|
||||
|
||||
extern void wdbEvtptClassConnect (WDB_EVTPT_CLASS * pEvtList);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __INCwdbEvtptLibh */
|
||||
@@ -0,0 +1,71 @@
|
||||
/* wdbGopherLib.h - info gathering interpreter header for the agent */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2003-2007 Wind River Systems, Inc.
|
||||
*
|
||||
* The right to copy, distribute, modify or otherwise make use of this
|
||||
* software may be licensed only pursuant to the terms of an applicable Wind
|
||||
* River license agreement.
|
||||
*/
|
||||
|
||||
/*
|
||||
modification history
|
||||
--------------------
|
||||
01i,26jun07,tbu Added 64 bit support
|
||||
+ p_b completed support
|
||||
01h,24jan06,tbu Added the OS-specific hook for special commands
|
||||
01g,04jan06,dbt Made several routines private. Added
|
||||
gopherWriteChar() prototype.
|
||||
01f,08dec05,dbt Replaced IMPORT with extern.
|
||||
01e,22nov05,dbt Updated gopher function prototypes.
|
||||
01d,16jun05,jmp moved to share/src/agents/wdb.
|
||||
01c,28may04,elg Fix compiler warning.
|
||||
01b,29mar04,elg Add information to reorder numbers following endianness if
|
||||
necessary.
|
||||
01a,19feb03,elg Written from wdbGopherLib.c.
|
||||
*/
|
||||
|
||||
/*
|
||||
DESCRIPTION
|
||||
*/
|
||||
|
||||
#ifndef __INCwdbGopherLibh
|
||||
#define __INCwdbGopherLibh
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* typedef */
|
||||
|
||||
enum byte_reorder
|
||||
{
|
||||
NO_REORDER, /* no byte reordering */
|
||||
NTOH_REORDER, /* perform a hton() before writing to tape */
|
||||
HTON_REORDER /* perform a ntoh() before writing to tape */
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char * program; /* where to start executing */
|
||||
TGT_ADDR_T p; /* initial value of pointer */
|
||||
WDB_POINTER_SIZE pointerSize; /* actual size of pointer */
|
||||
char * pTape; /* tape array */
|
||||
int tapeIx; /* index in tape to write next cell */
|
||||
int tapeLen; /* total length of tape */
|
||||
int execute; /* whether to execute, or just parse */
|
||||
unsigned int status; /* error code */
|
||||
enum byte_reorder byteReorder; /* do we have to reorder numbers ? */
|
||||
} wdbGopherCtx_t;
|
||||
|
||||
/* externals */
|
||||
|
||||
extern UINT32 gopherWriteChar (wdbGopherCtx_t * gc, char value);
|
||||
extern UINT32 gopherWriteScalar (wdbGopherCtx_t * gc, UINT8 * src, int type);
|
||||
extern void gopherHookAdd (UINT32 (*gopherHook) (wdbGopherCtx_t * gc));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __INCwdbGopherLibh */
|
||||
@@ -0,0 +1,101 @@
|
||||
/* wdbLib.h - header file for remote debug server */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994-1995,1998-2000,2002-2005,2007, 2010 Wind River Systems, Inc.
|
||||
*
|
||||
* The right to copy, distribute, modify or otherwise make use of this
|
||||
* software may be licensed only pursuant to the terms of an applicable Wind
|
||||
* River license agreement.
|
||||
*/
|
||||
|
||||
/*
|
||||
modification history
|
||||
--------------------
|
||||
02b,29jul10,pad Moved extern C statement after include statements.
|
||||
02a,26jun07,tbu Added 64 bit support
|
||||
+p_b completed support
|
||||
01z,20dec05,dbt Moved OS specific routines to wdbOsLib.h.
|
||||
01y,08dec05,dbt Updated wdbInstallCommIf() prototype to add MTU parameter.
|
||||
01x,06dec05,dbt Removed wdbBpLib.h inclusion.
|
||||
01w,23sep04,elg Change wdbGopherLibInit() prototype.
|
||||
01v,15dec03,elg Add new initialization routine: wdbTaskHookInit().
|
||||
01u,04jul03,elg Export wdbTaskModeInit() instead of wdbTaskRtIfInit().
|
||||
01t,27feb03,elg Merge file with BSD.
|
||||
01s,13feb03,elg Add WDB_MAX_ARGS ddefinition.
|
||||
01r,25apr02,jhw Added C++ support (SPR 76304).
|
||||
01q,28aug00,elg Add wdbPdLibInit() declaration.
|
||||
01p,21aug00,elg Add a new routine wdbFuncCallFpLibInit() (SPR 33747).
|
||||
01o,31jan00,dbt Added wdbUserSvcLibInit() and wdbTrgLibInit() prototypes.
|
||||
01n,14jan00,dbt Renamed wdbSymSyncLibInit().
|
||||
01m,16dec99,elg Add WDB_MAX_ARGS.
|
||||
01l,19oct99,dbt added wdbSymSyncLibInit() prototype.
|
||||
01k,02aug99,dbt added support for standalonagent.
|
||||
01j,26may99,elg Add new facilities for protection domain debug.
|
||||
01i,25mar98,dbt added wdbSystemSuspend() prototype.
|
||||
01h,04mar98,dbt added wdbCtxStartLibInit(), wdbUserEvtLibInit() and
|
||||
wdbUserEvtPost() prototypes.
|
||||
added WDB_MAX_USER_EVT_SIZE define.
|
||||
01g,04feb98,dbt added wdbEvtptLibInit() prototype. Undo 01f change
|
||||
01f,12jan98,dbt moved wdbSysBpLibInit() and wdbTaskBpLibInit() to wdbBpLib.h
|
||||
01e,20jun95,tpr added wdbMemCoreLibInit() prototype.
|
||||
01d,19jun95,ms added prototypes for wdbCtxExitLibInit and wdbSioTest
|
||||
01c,01jun95,ms changed prototype for wdbGopherLibInit.
|
||||
01b,05apr95,ms new data types.
|
||||
01a,20sep94,ms written.
|
||||
*/
|
||||
|
||||
#ifndef __INCwdbLibh
|
||||
#define __INCwdbLibh
|
||||
|
||||
/* includes */
|
||||
|
||||
#include "wdb/wdb.h"
|
||||
#include "wdb/wdbLibP.h"
|
||||
#include "wdb/wdbRtIfLib.h"
|
||||
#include "wdb/wdbRpcLib.h"
|
||||
#include "wdb/wdbCommIfLib.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* defines */
|
||||
|
||||
#define WDB_MAX_USER_EVT_SIZE 250 /* max. WDB user event size (bytes) */
|
||||
#define WDB_MAX_ARGS 10 /* maximum of arguments in a task */
|
||||
|
||||
/* function prototypes */
|
||||
|
||||
extern STATUS wdbExternInit (void * stackBase);
|
||||
extern void wdbInstallRtIf (WDB_RT_IF *);
|
||||
extern void wdbInstallCommIf (WDB_COMM_IF * pCommIf,
|
||||
WDB_XPORT * pXport,
|
||||
UINT32 wdbCommMtu);
|
||||
extern void wdbConnectLibInit (void);
|
||||
extern void wdbMemLibInit (void);
|
||||
extern void wdbMemCoreLibInit (void);
|
||||
extern void wdbCtxExitLibInit (void);
|
||||
extern void wdbRegsLibInit (void);
|
||||
extern void wdbEventLibInit (void);
|
||||
extern void wdbEvtptLibInit (void);
|
||||
extern void wdbFuncCallLibInit (void);
|
||||
extern void wdbDirectCallLibInit (void);
|
||||
extern void wdbGopherLibInit (char primaryTape [], UINT32 tapeLen,
|
||||
UINT32 tapeNb);
|
||||
extern void wdbVioLibInit (void);
|
||||
extern void wdbExcLibInit (void);
|
||||
extern void wdbUserEvtLibInit (void);
|
||||
extern STATUS wdbUserEvtPost (char * event);
|
||||
extern void wdbUserSvcLibInit (WDB_USR_SVC * pWdbUsrSvcStruct,
|
||||
UINT32 numService);
|
||||
extern void wdbCtxStartLibInit (void);
|
||||
extern STATUS wdbSystemSuspend (void);
|
||||
extern void wdbCtxLibInit (void);
|
||||
extern void wdbTgtInfoLibInit (void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __INCwdbLibh */
|
||||
|
||||
@@ -0,0 +1,299 @@
|
||||
/* wdbLibP.h - private header file for remote debug agent */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994-1995,1998,2001-2000,2003-2007,2009-2012,
|
||||
* Wind River Systems, Inc.
|
||||
*
|
||||
* The right to copy, distribute, modify or otherwise make use of this
|
||||
* software may be licensed only pursuant to the terms of an applicable Wind
|
||||
* River license agreement.
|
||||
*/
|
||||
|
||||
/*
|
||||
modification history
|
||||
--------------------
|
||||
02s,07feb12,rlp CQ:WIND00331131. Added wdbIsReady variable.
|
||||
02r,08apr11,rlp Added wdbIoctl prototype.
|
||||
02q,04mar11,jmp Fixed foundation/wdbagent-ptrace build.
|
||||
02p,31jan11,rlp System mode support for LP64.
|
||||
02o,25oct10,rlp Added a variable to indicate if WDB is enabled (WIND00227819).
|
||||
02n,29jul10,pad Moved extern C statement after include statements.
|
||||
02m,07may10,jmp Added wdbRtMemInit().
|
||||
02m,06may10,jmp Added wdbSharedBuffer & wdbSharedBufferSize,
|
||||
and removed obsolete wdbRegsBuffer & wdbRegsBufferSize.
|
||||
02l,27apr10,jmp Added _func_wdb[Task|Extern]CoprocRegs[Set|Get],
|
||||
and wdb[Task|Extern]CoprocRegLibInit.
|
||||
02k,26feb10,rlp Added more private prototypes.
|
||||
02j,10dec09,rlp Modified _func_wdbTaskBpByIdRemove function pointer.
|
||||
02i,20oct09,rlp Added the WDB_CTX_ARGS_FILL macro to fill context structure,
|
||||
Added WDB_ALL_CTXS for commands that apply to all contexts.
|
||||
02h,26jul07,rlp Added _func_wdbTaskBpByIdRemove function pointer to remove a
|
||||
dependency between the agents (CQ:WIND00099423).
|
||||
02g,26jun07,tbu Added 64 bit support
|
||||
+ p_b completed support
|
||||
02f,02feb07,tbu Added DISCONNECT_ON_CONNECT
|
||||
02e,30oct06,rlp Modified to use VxDBG library (REQ00007655).
|
||||
02d,08dec05,dbt Added wdbCommMtuGet() prototype.
|
||||
02c,06dec05,dbt Added WDB_NTOHx and WDB_HTONx macros
|
||||
02b,28nov05,dbt Removed wdbExternCmdRun().
|
||||
Added macros to isolate code of external and task mode agents
|
||||
02a,07nov05,dbt Updated wdbConnectHookAdd() prototype.
|
||||
Removed wdbDisconnectHookAdd().
|
||||
Removed wdbExternRegsSet() & wdbExternRegsGet() prototypes.
|
||||
Removed wdbMemRtLibInit() prototype.
|
||||
01z,01aug05,bpn Add new register buffer.
|
||||
01y,28may04,elg Add new function pointers.
|
||||
01x,08apr04,elg Define wdbMemChunk.
|
||||
Remove obsolete type WDB_REG_SET_TYPE.
|
||||
01w,13jan04,elg Add prototype of wdbCnctModePost().
|
||||
01v,26sep03,tbu Moved definition of wdbMbufInit & wdbSioTest to wdbOsLib.h
|
||||
01u,15sep03,elg Add definition of wdbSioTest().
|
||||
01t,27aug03,elg Add declarations of context event routines.
|
||||
01s,15jul03,pch Conditional compilation cleanup
|
||||
01r,26jun03,elg Add definition of wdbSuspendSystem() as extern routine.
|
||||
01q,27feb03,elg Merge file with BSD.
|
||||
01p,04feb03,elg Add WDB merged protocol.
|
||||
01o,20jul00,dbt Added wdbExternCmdRun() prototype.
|
||||
01n,03feb00,elg Fix component dependencies problems.
|
||||
01m,31jan00,dbt Added wdbPdUpdateNotify() prototype.
|
||||
01l,21jan00,dbt Added WDB_USR_SVC_STRUCT structure.
|
||||
01k,25oct99,elg Rename PD creation and deletion hooks.
|
||||
01j,15oct99,dbt added wdbConnectHookAdd() and wdbDisconnectHookAdd()
|
||||
prototypes.
|
||||
01i,19aug99,elg Add hooks for protection domains.
|
||||
01h,29jun99,elg Add WDB_CORE support.
|
||||
01g,25apr02,jhw Added C++ support (SPR 76304).
|
||||
01f,14sep01,jhw Added wdbExternRegsGet() and wdbExternRegsSet() function
|
||||
prototypes.
|
||||
Removed __STDC__ precompiler conditional.
|
||||
01e,11jun98,dbt removed wdbTgtHasFpp() prototype.
|
||||
01d,03jun95,ms added prototype for wdbTargetIsConnected()
|
||||
01c,05apr95,ms new data types.
|
||||
01b,06feb95,ms removes wdbRpcLib specific things.
|
||||
01a,20sep94,ms written.
|
||||
*/
|
||||
|
||||
#ifndef __INCwdbLibPh
|
||||
#define __INCwdbLibPh
|
||||
|
||||
/* includes */
|
||||
|
||||
#include <wdb/wdb.h>
|
||||
#include <wdb/wdbRtIfLib.h>
|
||||
#include <wdb/wdbCommIfLib.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* defines */
|
||||
|
||||
#define DISCONNECT_ON_CONNECT 1
|
||||
|
||||
#define WDB_STATE_EXTERN_RUNNING 1
|
||||
|
||||
#define WDB_IS_NOW_EXTERNAL() (wdbMode & WDB_MODE_SYSTEM)
|
||||
|
||||
#ifndef IS_WDB_ENABLED
|
||||
#define IS_WDB_ENABLED() (wdbIsAlwaysEnabled)
|
||||
#endif /* IS_WDB_ENABLED */
|
||||
|
||||
#ifndef IS_WDB_READY
|
||||
#define IS_WDB_READY() (wdbIsReady)
|
||||
#endif /* IS_WDB_READY */
|
||||
|
||||
#define wdbSuspendSystemHere(callBack,callBackArg) \
|
||||
if (_func_wdbSuspendSystem != NULL) \
|
||||
_func_wdbSuspendSystem (NULL, (callBack), (callBackArg))
|
||||
|
||||
#define wdbSuspendSystem(pRegSet,callBack,callBackArg) \
|
||||
if (_func_wdbSuspendSystem != NULL) \
|
||||
_func_wdbSuspendSystem ((pRegSet), (callBack), (callBackArg))
|
||||
|
||||
#define wdbResumeSystem() \
|
||||
if (_func_wdbResumeSystem != NULL) \
|
||||
_func_wdbResumeSystem ()
|
||||
|
||||
/* Byte swapping macros */
|
||||
|
||||
/*
|
||||
* The endianness of the networks packets is always BIG, so is the target is
|
||||
* BIG no swap is needed
|
||||
*/
|
||||
|
||||
#if _BYTE_ORDER == _BIG_ENDIAN
|
||||
#define WDB_NTOH64(x) (x)
|
||||
#define WDB_HTON64(x) (x)
|
||||
#define WDB_NTOH32(x) (x)
|
||||
#define WDB_HTON32(x) (x)
|
||||
#define WDB_NTOH16(x) (x)
|
||||
#define WDB_HTON16(x) (x)
|
||||
#else /* BYTE_ORDER == BIG_ENDIAN */
|
||||
|
||||
#define WDB_NTOH64(x) SWAB_64(x)
|
||||
#define WDB_HTON64(x) SWAB_64(x)
|
||||
#define WDB_NTOH32(x) SWAB_32(x)
|
||||
#define WDB_HTON32(x) SWAB_32(x)
|
||||
#define WDB_NTOH16(x) SWAB_16(x)
|
||||
#define WDB_HTON16(x) SWAB_16(x)
|
||||
|
||||
/* Swap of eight bytes : ABCDEFGH becomes HGFEDCBA */
|
||||
|
||||
#define SWAB_64(x) ((((x) & 0x00000000000000ffLL) << 56) | \
|
||||
(((x) & 0x000000000000ff00LL) << 40) | \
|
||||
(((x) & 0x0000000000ff0000LL) << 24) | \
|
||||
(((x) & 0x00000000ff000000LL) << 8) | \
|
||||
(((x) & 0x000000ff00000000LL) >> 8) | \
|
||||
(((x) & 0x0000ff0000000000LL) >> 24) | \
|
||||
(((x) & 0x00ff000000000000LL) >> 40) | \
|
||||
(((x) & 0xff00000000000000LL) >> 56))
|
||||
|
||||
/* Swap of four bytes : ABCD becomes DCBA */
|
||||
|
||||
#define SWAB_32(x) (((UINT32)((x) & 0x000000ff) << 24) | \
|
||||
((UINT32)((x) & 0x0000ff00) << 8) | \
|
||||
((UINT32)((x) & 0x00ff0000) >> 8) | \
|
||||
((UINT32)((x) & 0xff000000) >> 24))
|
||||
|
||||
/* Swap of two bytes : AB becomes BA */
|
||||
|
||||
#ifdef SWAB_16
|
||||
#undef SWAB_16
|
||||
#endif
|
||||
|
||||
#define SWAB_16(x) ((((x) & 0x00ff) << 8) | \
|
||||
(((x) & 0xff00) >> 8))
|
||||
|
||||
#endif /* BYTE_ORDER == BIG_ENDIAN */
|
||||
|
||||
#define WDB_ACTION_STOP_MASK (WDB_ACTION_STOP | WDB_ACTION_ALL_STOP | \
|
||||
WDB_ACTION_SYS_STOP)
|
||||
|
||||
/* Convert a WDB action type to a VXDBG_BP_ACTION type */
|
||||
|
||||
#define WDB_ACTION_TYPE_CONV(t) (t)
|
||||
|
||||
/* Convert a VxDBG errno value to a WDB error value */
|
||||
|
||||
#define WDB_RETURN_VALUE_GET(rtn) \
|
||||
((rtn == OK) ? WDB_OK : ((errno & ~M_vxdbgLib) + 0x500))
|
||||
|
||||
#define WDB_ALL_CTXS -1L /* Command applies to all contexts */
|
||||
|
||||
/* Fill a context structure */
|
||||
|
||||
#define WDB_CTX_ARGS_FILL(pArgs, pCtx) \
|
||||
{ \
|
||||
int ix; \
|
||||
\
|
||||
for (ix = 0; ix < (int) (pCtx)->numArgs; ix++) \
|
||||
(pArgs) [ix] = (pCtx)->args [ix]; \
|
||||
for (ix = (pCtx)->numArgs; ix < WDB_CTX_MAX_ARGS; ix++) \
|
||||
(pArgs) [ix] = 0; \
|
||||
}
|
||||
|
||||
/* data types */
|
||||
|
||||
typedef enum wdb_cont_type
|
||||
{
|
||||
WDB_STEP = 0x0001,
|
||||
WDB_STEP_OVER = 0x0002,
|
||||
WDB_STEP_RANGE = 0x0004
|
||||
} WDB_CONT_TYPE;
|
||||
|
||||
typedef struct wdb_usr_svc /* user service structure */
|
||||
{
|
||||
FUNCPTR func; /* service entry point */
|
||||
UINT32 svcId; /* service ID */
|
||||
} WDB_USR_SVC;
|
||||
|
||||
/* agent variables */
|
||||
|
||||
extern UINT32 wdbCommMtu;
|
||||
extern UINT32 wdbAvailOptions;
|
||||
extern UINT32 wdbMode;
|
||||
extern BOOL wdbOneShot;
|
||||
extern BOOL wdbIsAlwaysEnabled;
|
||||
extern UINT32 wdbAvailModes;
|
||||
extern BOOL wdbIsInitialized;
|
||||
extern BOOL wdbIsReady;
|
||||
extern char * wdbSharedBuffer;
|
||||
extern UINT32 wdbSharedBufferSize;
|
||||
|
||||
#ifndef _WRS_ARCH_NO_SYSTEM_MODE_AGENT
|
||||
extern void (*_func_wdbResumeSystem) (void);
|
||||
extern void (*_func_wdbExternNotifyHost) (void);
|
||||
extern void (*_func_wdbExternRcvHook) (UINT32 arg);
|
||||
extern void (*_func_wdbSuspendSystem) (WDB_IU_REGS * pRegs,
|
||||
void (*callBack) (_Vx_usr_arg_t arg),
|
||||
_Vx_usr_arg_t arg);
|
||||
extern STATUS (*_func_wdbExternEnterHookAdd) (void (*hook) ());
|
||||
extern STATUS (*_func_wdbExternExitHookAdd) (void (*hook) ());
|
||||
#endif /* !_WRS_ARCH_NO_SYSTEM_MODE_AGENT */
|
||||
|
||||
extern STATUS (*_func_wdbTaskBpByIdRemove) (ULONG bpId);
|
||||
extern UINT32 (*_func_wdbTaskCoprocRegsSet) (WDB_CTX * pContext,
|
||||
UINT32 type,
|
||||
char * pRegs);
|
||||
extern UINT32 (*_func_wdbTaskCoprocRegsGet) (WDB_CTX * pContext,
|
||||
UINT32 type,
|
||||
char ** ppRegs);
|
||||
extern UINT32 (*_func_wdbExternCoprocRegsSet) (WDB_CTX * pContext,
|
||||
UINT32 type,
|
||||
char * pRegs);
|
||||
extern UINT32 (*_func_wdbExternCoprocRegsGet) (WDB_CTX * pContext,
|
||||
UINT32 type,
|
||||
char ** ppRegs);
|
||||
|
||||
extern void * pWdbXport;
|
||||
extern WDB_COMM_IF * pWdbCommIf;
|
||||
extern void * pWdbClnt; /* VxDBG client descriptor for WDB */
|
||||
|
||||
/* function prototypes */
|
||||
|
||||
extern void wdbInfoGet (WDB_AGENT_INFO * pInfo);
|
||||
extern void wdbNotifyHost (void);
|
||||
extern BOOL wdbTargetIsConnected (void);
|
||||
|
||||
extern int wdbIoctl (int function, long arg);
|
||||
extern STATUS wdbModeSet (INT32 newMode);
|
||||
extern BOOL wdbIsNowExternal (void);
|
||||
extern BOOL wdbRunsExternal (void);
|
||||
extern BOOL wdbIsNowTasking (void);
|
||||
extern BOOL wdbRunsTasking (void);
|
||||
extern void wdbCtxCreateNotify (void * pNode);
|
||||
extern void wdbCtxDeleteNotify (void * pNode);
|
||||
extern void wdbCtxEvtLibInit (void);
|
||||
extern void wdbCtxStartEventGet (void * pNode, WDB_EVT_DATA * pEvtData);
|
||||
extern void wdbCtxExitEventGet (void * pNode, WDB_EVT_DATA * pEvtData);
|
||||
extern void wdbCtxExitNotifyHook (WDB_CTX ctx, UINT32 exitCode,
|
||||
UINT32 errnoVal);
|
||||
extern STATUS wdbConnectHookAdd (BOOL connect, FUNCPTR connectHook);
|
||||
extern void wdbCmdLoop (void);
|
||||
extern void wdbRtLibInit (WDB_RT_IF * pWdbRtIf);
|
||||
extern void wdbRtMemInit (WDB_RT_IF * pWdbRtIf);
|
||||
|
||||
#ifndef _WRS_ARCH_NO_SYSTEM_MODE_AGENT
|
||||
extern void wdbCnctModePost (_Vx_usr_arg_t mode);
|
||||
extern void wdbExternLibInit (void);
|
||||
extern STATUS wdbExternRegLibInit (void);
|
||||
extern STATUS wdbExternCoprocRegLibInit (void);
|
||||
extern STATUS wdbExternEnterHookAdd (void (*hook) ());
|
||||
extern STATUS wdbExternExitHookAdd (void (*hook) ());
|
||||
#endif /* !_WRS_ARCH_NO_SYSTEM_MODE_AGENT */
|
||||
|
||||
extern STATUS wdbModeSetHookAdd (void (*hook) (int mode));
|
||||
extern STATUS wdbTaskRegLibInit (void);
|
||||
extern STATUS wdbTaskCoprocRegLibInit (void);
|
||||
extern UINT32 wdbCommMtuGet (void);
|
||||
extern void wdbCommIfEnable (BOOL enable);
|
||||
|
||||
/* globals */
|
||||
|
||||
extern WDB_IU_REGS * pWdbExternSystemRegs;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __INCwdbLibPh */
|
||||
@@ -0,0 +1,98 @@
|
||||
/* wdbMbufLib.h - header file for WDB I/O buffer handling */
|
||||
|
||||
/* Copyright 1984-2002, 2010 Wind River Systems, Inc. */
|
||||
|
||||
/*
|
||||
modification history
|
||||
--------------------
|
||||
01e,29apr10,pad Moved extern C statement after include statements.
|
||||
01d,25apr02,jhw Added C++ support (SPR 76304).
|
||||
01c,19sep97,vin modified for cluster Blk logic, removed hardcoded assumption
|
||||
of the location of the refcnt.
|
||||
01b,24jul96,vin upgraded to BSD4.4 mbufs
|
||||
01a,04may95,ms written.
|
||||
*/
|
||||
|
||||
#ifndef __INCwdbMbufLibh
|
||||
#define __INCwdbMbufLibh
|
||||
|
||||
/* includes */
|
||||
|
||||
#include "net/mbuf.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* macros */
|
||||
|
||||
#define wdbMbufClusterInit(pMbuf, addr, nBytes, callBackRtn, callBackArg) \
|
||||
{ \
|
||||
(pMbuf)->m_next = NULL; \
|
||||
(pMbuf)->m_nextpkt = NULL; \
|
||||
(pMbuf)->m_data = (caddr_t)(addr); \
|
||||
(pMbuf)->m_len = nBytes; \
|
||||
(pMbuf)->m_type = MT_DATA; \
|
||||
(pMbuf)->m_flags |= M_EXT; \
|
||||
(pMbuf)->m_extBuf = (caddr_t)(addr); \
|
||||
(pMbuf)->m_extSize = nBytes; \
|
||||
(pMbuf)->m_extFreeRtn = callBackRtn; \
|
||||
(pMbuf)->m_extRefCnt = 1; \
|
||||
(pMbuf)->m_extArg1 = callBackArg; \
|
||||
(pMbuf)->m_extArg2 = 0; \
|
||||
(pMbuf)->m_extArg3 = 0; \
|
||||
}
|
||||
|
||||
#define wdbMbufChainFree(pMbuf) \
|
||||
{ \
|
||||
struct mbuf *__pNextMbuf; \
|
||||
struct mbuf *__pThisMbuf; \
|
||||
__pThisMbuf = pMbuf; \
|
||||
while (__pThisMbuf != NULL) \
|
||||
{ \
|
||||
__pNextMbuf = __pThisMbuf->m_next; \
|
||||
wdbMbufFree (__pThisMbuf); \
|
||||
__pThisMbuf = __pNextMbuf; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define wdbMbufDataGet(__pMbuf, __pDest, __len, __pLen) \
|
||||
{ \
|
||||
int __nBytes; \
|
||||
struct mbuf * __pThisMbuf; \
|
||||
\
|
||||
__nBytes = 0; \
|
||||
for (__pThisMbuf = __pMbuf; \
|
||||
__pThisMbuf != NULL; \
|
||||
__pThisMbuf = __pThisMbuf->m_next) \
|
||||
{ \
|
||||
int __moreBytes = MIN (__pThisMbuf->m_len, __len - __nBytes); \
|
||||
bcopy (mtod (__pThisMbuf, char *), __pDest + __nBytes, __moreBytes); \
|
||||
__nBytes += __moreBytes; \
|
||||
if (__nBytes >= __len) \
|
||||
break; \
|
||||
} \
|
||||
\
|
||||
*(__pLen) = __nBytes; \
|
||||
}
|
||||
|
||||
/* function prototypes */
|
||||
|
||||
#ifdef __STDC__
|
||||
|
||||
extern struct mbuf * wdbMbufAlloc (void);
|
||||
extern void wdbMbufFree (struct mbuf * segId);
|
||||
|
||||
#else /* __STDC__ */
|
||||
|
||||
extern struct mbuf * wdbMbufAlloc ();
|
||||
extern void wdbMbufFree ();
|
||||
|
||||
#endif /* __STDC__ */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __INCwdbMbufLibh */
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
/* wdbMemLib.h - WDB memory services header file */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2003-2005 Wind River Systems, Inc.
|
||||
*
|
||||
* The right to copy, distribute, modify or otherwise make use of this
|
||||
* software may be licensed only pursuant to the terms of an applicable Wind
|
||||
* River license agreement.
|
||||
*/
|
||||
|
||||
/*
|
||||
modification history
|
||||
--------------------
|
||||
01b,18nov05,dbt Removed wdbMemTest() prototype.
|
||||
01a,14nov05,dbt Updated wdbMemTest prototype.
|
||||
Removed useless function pointers.
|
||||
01d,30sep03.elg Fix build warnings.
|
||||
01c,29sep03,tbu Changed wdbMemScan usage (now returns a status)
|
||||
01b,16sep03,tbu Added _wdbMemCksum
|
||||
01a,06jan03,elg Written.
|
||||
*/
|
||||
|
||||
#ifndef __INCwdbMemLibh
|
||||
#define __INCwdbMemLibh
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* externs */
|
||||
|
||||
extern UINT32 wdbCksum (UINT16 * pData, UINT32 nBytes, UINT32 init,
|
||||
BOOL moreData);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __INCwdbMemLibh */
|
||||
@@ -0,0 +1,39 @@
|
||||
/* wdbMipcSockLib.h - header file for remote debug agent MIPC library */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2008, 2010 Wind River Systems, Inc.
|
||||
*
|
||||
* The right to copy, distribute, modify or otherwise make use of this
|
||||
* software may be licensed only pursuant to the terms of an applicable Wind
|
||||
* River license agreement.
|
||||
*/
|
||||
|
||||
/*
|
||||
modification history
|
||||
--------------------
|
||||
01b,29apr10,pad Moved extern C statement after include statements.
|
||||
01a,30may05,dbt written.
|
||||
*/
|
||||
|
||||
#ifndef __INCwdbMipcSockLibh
|
||||
#define __INCwdbMipcSockLibh
|
||||
|
||||
/* includes */
|
||||
|
||||
#include "wdb/wdbCommIfLib.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* function prototypes */
|
||||
|
||||
extern STATUS wdbMipcSockIfInit (WDB_COMM_IF * pCommIf,
|
||||
char * mipcBusName,
|
||||
int mipcPortNumber);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __INCwdbMipcSockLibh */
|
||||
@@ -0,0 +1,226 @@
|
||||
/* wdbOsLib.h - WDB vxWorks specific header */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2003-2011 Wind River Systems, Inc.
|
||||
*
|
||||
* The right to copy, distribute, modify or otherwise make use of this
|
||||
* software may be licensed only pursuant to the terms of an applicable Wind
|
||||
* River license agreement.
|
||||
*/
|
||||
|
||||
/*
|
||||
modification history
|
||||
--------------------
|
||||
02a,20dec11,rlp CQID: Fix WIND00323889 - Updated vxdbgCpuAllSuspend()
|
||||
prototype.
|
||||
01z,25oct10,rlp Defined the IS_WDB_ENABLED macro.
|
||||
01y,29apr10,pad Moved extern C statement after include statements.
|
||||
01x,01mar10,rlp Cleaned up warnings.
|
||||
01w,23feb10,rlp Added wdbDynPrintfBpHandler prototype.
|
||||
01v,10feb10,rlp Added vxdbgLibP header file.
|
||||
01u,05feb10,rlp Renamed loCtx field of WDB_MEM_CTX_T to ctx for backward
|
||||
compatibility.
|
||||
01t,29sep09,rlp Added the WDB_CORE_MEM_CTX_GET macro for LP64 adaptation.
|
||||
01t,21sep09,s_s changed INT_CPU_LOCK() and INT_CPU_UNLOCK() to
|
||||
INT_CPU_MICRO_LOCK() and INT_CPU_MICRO_UNLOCK()
|
||||
(WIND00181479)
|
||||
01s,10sep08,dbt Added WDB_KERNEL_IS_INITIALIZED() macro.
|
||||
01r,27aug08,jpb Renamed VSB header file
|
||||
01q,24jun08,jpb Added include path for kernel configurations options set in
|
||||
vsb. Renamed _WRS_VX_SMP to _WRS_CONFIG_SMP.
|
||||
01p,22apr08,dbt Added WDB dynamic printf init routine.
|
||||
01o,25jul07,rlp Added CPU all suspend timeout (CQ:WIND00099255).
|
||||
01n,11jul07,rlp Added SMP support.
|
||||
01m,06jul07,p_b Added 64bits support
|
||||
01l,09nov06,rlp Added sigLib header file to remove warnings.
|
||||
01k,30oct06,rlp Modified to use VxDBG library (REQ00007655).
|
||||
01j,20dec05,dbt Added VxWorks specific APIs from wdbLib.h.
|
||||
01i,05dec05,dbt Removed inclusion of RPC header files.
|
||||
Cleanup.
|
||||
01h,28nov05,dbt Moved WDB_CTX_XXX definitions to wdbOsLib.h.
|
||||
01g,14nov05,dbt Added WDB_IU_REGS definition.
|
||||
01f,23mar04,elg Macros to get information in context are now OS specific.
|
||||
01e,12sep03,tbu Added inclusion of netinet/in_systm.h
|
||||
01d,29aug03,elg Redefine GOPHER_STRTOL to do strtoul() (fix SPR #90223).
|
||||
Include vxWorks.h first (fix SPR #90034).
|
||||
01c,14jul03,pch Conditional compilation cleanup
|
||||
01b,06may03,elg Fix compilation error when Altivec is supported.
|
||||
01a,03jan03,elg Written.
|
||||
*/
|
||||
|
||||
#ifndef __INCwdbOsLibh
|
||||
#define __INCwdbOsLibh
|
||||
|
||||
/*
|
||||
DESCRIPTION
|
||||
|
||||
The vxWorks specific header contains definitions that cannot be used by other
|
||||
OSes.
|
||||
*/
|
||||
|
||||
/* includes */
|
||||
|
||||
#include <vxWorks.h> /* this file must be included first */
|
||||
#include <vsbConfig.h>
|
||||
|
||||
#include <types/vxANSI.h>
|
||||
#include <netBufLib.h>
|
||||
#include <net/mbuf.h>
|
||||
|
||||
#include <ctype.h>
|
||||
#include <limits.h>
|
||||
#include <sioLib.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <regs.h>
|
||||
#include <dspLib.h>
|
||||
#include <taskHookLib.h>
|
||||
#include <taskLib.h>
|
||||
#include <intLib.h>
|
||||
#include <fppLib.h>
|
||||
#include <sigLib.h>
|
||||
#include <sysDbgLib.h>
|
||||
#include <private/intMicroLibP.h>
|
||||
#include <private/vxdbgLibP.h>
|
||||
#ifdef _WRS_CONFIG_SMP
|
||||
#include <private/vxdbgCpuLibP.h>
|
||||
#endif /* _WRS_CONFIG_SMP */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* data types */
|
||||
|
||||
typedef REG_SET WDB_IU_REGS; /* WDB register set */
|
||||
struct wdb_brkpt; /* WDB breakpoint structure */
|
||||
|
||||
/* OS definitions */
|
||||
|
||||
#define IS_WDB_ENABLED() (wdbIsAlwaysEnabled ? TRUE : sysDebugModeGet())
|
||||
|
||||
#define WDB_KERNEL_ID -1L /* kernel ID in WDB agent */
|
||||
|
||||
/* access to registers */
|
||||
|
||||
#define WDB_PC(ptr) (ptr)->reg_pc
|
||||
#define WDB_FP(ptr) (ptr)->reg_fp
|
||||
#define WDB_SP(ptr) (ptr)->reg_sp
|
||||
|
||||
/* debug info */
|
||||
|
||||
/* on vxWorks, PC does not need to be changed */
|
||||
|
||||
#define _WRS_ADJUST_PC_AFTER_SW_BP(pRegs)
|
||||
|
||||
/* macros to get and set ID from context structure */
|
||||
|
||||
#ifdef _WRS_CONFIG_SMP
|
||||
#define WDB_CTX_SYS_INFO_SET(pArgs) \
|
||||
{ \
|
||||
(pArgs) [0] = 0; \
|
||||
(pArgs) [1] = (TGT_LONG_T) _WRS_CPU_INDEX_GET(); \
|
||||
}
|
||||
#else /* _WRS_CONFIG_SMP */
|
||||
#define WDB_CTX_SYS_INFO_SET(pArgs) \
|
||||
{ \
|
||||
(pArgs) [0] = 0; \
|
||||
(pArgs) [1] = 0; \
|
||||
}
|
||||
#endif /* _WRS_CONFIG_SMP */
|
||||
|
||||
#define WDB_CTX_TASK_INFO_SET(pArgs, tid, pid) \
|
||||
{ \
|
||||
(pArgs) [0] = (TGT_LONG_T) (tid); \
|
||||
(pArgs) [1] = (TGT_LONG_T) (pid); \
|
||||
}
|
||||
|
||||
#define WDB_CTX_RTP_INFO_SET(pArgs, pid) \
|
||||
{ \
|
||||
(pArgs) [0] = (TGT_LONG_T) (pid); \
|
||||
(pArgs) [1] = 0; \
|
||||
}
|
||||
|
||||
/* macro to get context from WDB_CORE structure */
|
||||
|
||||
#ifdef _WRS_CONFIG_LP64
|
||||
#define WDB_CORE_MEM_CTX_GET(memCtx) \
|
||||
((((ULONG) memCtx.hiCtx) << 32) + \
|
||||
(0x00000000ffffffff & (ULONG) memCtx.ctx))
|
||||
#else /* _WRS_CONFIG_LP64 */
|
||||
#define WDB_CORE_MEM_CTX_GET(memCtx) memCtx.ctx
|
||||
#endif /* _WRS_CONFIG_LP64 */
|
||||
|
||||
/* macros used to save/load external agent context */
|
||||
|
||||
#ifndef WDB_CTX_LOAD
|
||||
#define WDB_CTX_LOAD(pRegs) _sigCtxLoad(pRegs)
|
||||
#endif /* WDB_CTX_LOAD */
|
||||
|
||||
#ifndef WDB_CTX_SAVE
|
||||
#define WDB_CTX_SAVE(pRegs) _sigCtxSave(pRegs)
|
||||
#endif /* WDB_CTX_SAVE */
|
||||
|
||||
#ifndef WDB_CTX_SETUP
|
||||
#define WDB_CTX_SETUP(pRegs, pStack, taskEntry, pArgs) \
|
||||
_sigCtxSetup ((pRegs), (pStack), (taskEntry), (pArgs))
|
||||
#endif /* WDB_CTX_SETUP */
|
||||
|
||||
#ifndef WDB_CTX_RTN_VALUE_SET
|
||||
#define WDB_CTX_RTN_VALUE_SET(pRegs,retVal) \
|
||||
_sigCtxRtnValSet ((pRegs),(retVal))
|
||||
#endif /* WDB_CTX_RTN_VALUE_SET */
|
||||
|
||||
/*
|
||||
* These macros are used to stop/continue all CPUs of the system except the
|
||||
* current one. Moreover, they lock/unlock interrupts on the local CPU.
|
||||
*/
|
||||
|
||||
#ifdef _WRS_CONFIG_SMP
|
||||
#define WDB_CPU_ALL_STOP_TIMEOUT 100 /* CPU all suspend timeout */
|
||||
/* in msecs. */
|
||||
|
||||
#define WDB_CPU_ALL_STOP(level) \
|
||||
level = INT_CPU_MICRO_LOCK (); \
|
||||
vxdbgCpuAllSuspend (WDB_CPU_ALL_STOP_TIMEOUT, NULL, TRUE)
|
||||
#define WDB_CPU_ALL_CONTINUE(level) \
|
||||
vxdbgCpuAllResume (); \
|
||||
INT_CPU_MICRO_UNLOCK (level)
|
||||
#else /* _WRS_CONFIG_SMP */
|
||||
#define WDB_CPU_ALL_STOP(level) \
|
||||
level = INT_CPU_MICRO_LOCK ()
|
||||
#define WDB_CPU_ALL_CONTINUE(level) \
|
||||
INT_CPU_MICRO_UNLOCK (level)
|
||||
#endif /* _WRS_CONFIG_SMP */
|
||||
|
||||
/* This macro is used to know if the kernel is multitasking or not */
|
||||
|
||||
#define WDB_KERNEL_IS_INITIALIZED() \
|
||||
((taskIdSelf() == (TASK_ID) 0) ? FALSE : TRUE)
|
||||
|
||||
/* globals */
|
||||
|
||||
extern void wdbMbufInit (struct mbuf *, UINT32,
|
||||
CL_BLK *, UINT32);
|
||||
extern void wdbSioTest (SIO_CHAN *, int, char);
|
||||
extern void wdbMdlSymSyncLibInit (void);
|
||||
extern void wdbSysBpLibInit (struct wdb_brkpt * pBps, UINT32 bpCnt);
|
||||
extern void wdbTaskBpLibInit (void);
|
||||
extern STATUS wdbTaskModeInit (UINT32 spawnStackSize,
|
||||
UINT32 taskPriority,
|
||||
UINT32 taskOptions,
|
||||
UINT32 stackSize,
|
||||
UINT32 maxRestarts,
|
||||
UINT32 restartTime);
|
||||
extern void wdbRtpLibInit (int priority);
|
||||
extern void wdbRtpBpLibInit (void);
|
||||
extern void wdbTaskHookInit (void);
|
||||
extern void wdbBpSyncLibInit (void);
|
||||
extern void wdbDynPrintfLibInit (UINT32 maxMsgs, size_t maxMsgLength);
|
||||
extern void wdbDynPrintfBpHandler (long arg, REG_SET * pRegisters);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __INCwdbOsLibh */
|
||||
@@ -0,0 +1,103 @@
|
||||
/* wdbRpcLib.h - header file for remote debug agents RPC interface */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1995-2005, 2008, 2010 Wind River Systems, Inc.
|
||||
*
|
||||
* The right to copy, distribute, modify or otherwise make use of this
|
||||
* software may be licensed only pursuant to the terms of an applicable Wind
|
||||
* River license agreement.
|
||||
*/
|
||||
|
||||
/*
|
||||
modification history
|
||||
--------------------
|
||||
01h,29jul10,pad Moved extern C statement after include statements.
|
||||
01g,26sep08,rlp Added the wdbRpcFreeArgs prototype (CQ:WIND00133970).
|
||||
01f,05dec05,dbt Added more RPC definitions.
|
||||
Removed references to sockaddr_in
|
||||
01e,01dec05,dbt Removed references to timeval structure.
|
||||
01d,25apr02,jhw Added C++ support (SPR 76304).
|
||||
01c,03jun95,ms added wdbRpcNotifyConnect.
|
||||
01b,05apr95,ms new data types.
|
||||
01a,06feb95,ms written.
|
||||
*/
|
||||
|
||||
#ifndef __INCwdbRpcLibh
|
||||
#define __INCwdbRpcLibh
|
||||
|
||||
/* includes */
|
||||
|
||||
#include <wdb/wdbCommIfLib.h>
|
||||
#include <wdb/wdbXdrLib.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* defines */
|
||||
|
||||
/* RPC return values */
|
||||
|
||||
#define SUCCESS 0
|
||||
#define PROG_UNAVAIL 1
|
||||
#define PROG_MISMATCH 2
|
||||
#define PROC_UNAVAIL 3
|
||||
#define GARBAGE_ARGS 4
|
||||
#define SYSTEM_ERR 5
|
||||
|
||||
/* RPC message types */
|
||||
|
||||
#define CALL 0
|
||||
#define REPLY 1
|
||||
|
||||
/* RPC reply status */
|
||||
|
||||
#define MSG_ACCEPTED 0
|
||||
#define MSG_DENIED 1
|
||||
|
||||
/* address size */
|
||||
|
||||
#define WDB_RPC_ADDR_SIZE (4 * sizeof (UINT32))
|
||||
|
||||
/* data types */
|
||||
|
||||
typedef struct /* hidden */
|
||||
{
|
||||
WDB_COMM_IF * pCommIf; /* communication interface */
|
||||
WDB_XDR xdrs; /* XDR stream */
|
||||
UINT32 * pInBuf; /* input buffer */
|
||||
INT32 numBytesIn; /* # bytes recv'ed */
|
||||
UINT32 * pOutBuf; /* output buffer */
|
||||
UINT32 numBytesOut; /* # bytes sent */
|
||||
UINT32 bufSize; /* size of buffers in bytes */
|
||||
UINT32 xid; /* transport ID */
|
||||
UINT32 notifyAddr [WDB_RPC_ADDR_SIZE/4]; /* address to send */
|
||||
/* event data */
|
||||
UINT32 replyAddr [WDB_RPC_ADDR_SIZE/4]; /* address to send */
|
||||
/* reply */
|
||||
} WDB_XPORT;
|
||||
|
||||
/* function prototypes */
|
||||
|
||||
extern void wdbRpcXportInit (WDB_XPORT *pXport, WDB_COMM_IF *pIf,
|
||||
char * pInBuf, char * pOutBuf,
|
||||
UINT32 bufSize);
|
||||
extern BOOL wdbRpcRcv (void *pXport, INT32 timeout);
|
||||
extern BOOL wdbRpcGetArgs (void *pXport, BOOL (*inProc)(),
|
||||
char * args);
|
||||
#if defined(_WRS_WDB_XDR_USE_MEMORY_MANAGER)
|
||||
extern BOOL wdbRpcFreeArgs (void *pXport, BOOL (*inProc)(),
|
||||
char * args);
|
||||
#endif /* _WRS_WDB_XDR_USE_MEMORY_MANAGER */
|
||||
extern void wdbRpcReply (void *pXport, BOOL (*inProc)(),
|
||||
char * addr);
|
||||
extern void wdbRpcReplyErr (void *pXport, UINT32 errStatus);
|
||||
extern void wdbRpcResendReply (void *pXport);
|
||||
extern void wdbRpcNotifyHost (void *pXport);
|
||||
extern void wdbRpcNotifyConnect (void *pXport);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __INCwdbRpcLibh */
|
||||
@@ -0,0 +1,374 @@
|
||||
/* wdbRtIfLib.h - header file for the WDB agents runtime interface */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994-1995,1999-2005,2007, 2009-2011, 2013-2014
|
||||
* Wind River Systems, Inc.
|
||||
*
|
||||
* The right to copy, distribute, modify or otherwise make use of this
|
||||
* software may be licensed only pursuant to the terms of an applicable Wind
|
||||
* River license agreement.
|
||||
*/
|
||||
|
||||
/*
|
||||
modification history
|
||||
--------------------
|
||||
17nov14,rlp Resource lock macros return a lock-out key (VXW6-83803).
|
||||
02d,12sep13,elp resource lock/unlock return value check.
|
||||
02c,06may11,jmp Updated excHookAdd to no longer take structures as parameters,
|
||||
we now use pointers on structures (CQ:WIND00266088).
|
||||
02b,29jul10,pad Moved extern C statement after include statements.
|
||||
02a,10dec09,rlp Changed excHookAdd function pointer signature.
|
||||
01z,11sep09,rlp Adapted to LP64 model.
|
||||
01y,11jul07,rlp Added System mode support for SMP.
|
||||
01x,26jun07,tbu Added 64 bit support
|
||||
+ p_b completed support
|
||||
01w,02may07,rlp Added resource lock/unlock routines to WDB_RT_IF structure.
|
||||
01v,18nov05,dbt Added OS specific memory scan API; removed OS specific memory
|
||||
problem API.
|
||||
01u,14nov05,dbt Added APIs to access memory. Removed wdbRegs.h inclusion.
|
||||
01t,13aug04,dbt Added signal information in exception notification.
|
||||
01s,31mar04,elg Change prototype of excHookAdd() pointer.
|
||||
01r,30sep03,elg Fix build warnings.
|
||||
Fix pointer error with memory probe runtime interface.
|
||||
01q,12sep03,tbu Moved inclusion of netinet/in_systm.h to wdbOsLib.h
|
||||
01p,27feb03,elg Merge file with BSD and define new runtime interface.
|
||||
01o,25apr02,jhw Added C++ support (SPR 76304).
|
||||
01n,01feb01,dtr Adding in call for test for Altivec Registers.
|
||||
01m,28aug00,elg Change pdIsValid() to pdIdVerify().
|
||||
01l,16aug00,elg Change memProtect() prototype.
|
||||
01k,25apr00,elg Add taskCtxGet() routine.
|
||||
01j,12apr00,elg Add parmeters in pdCreate().
|
||||
01i,02feb00,dbt Added pdIsValid and removed pdListGet.
|
||||
01h,15nov99,elg Add returnNodeGet() in WDB runtime interface.
|
||||
01g,08nov99,elg Add ltExitCreate().
|
||||
01f,15oct99,elg Change pdCreate() interface.
|
||||
01e,09sep99,elg Add taskCtxSwitch() to Runtime interface.
|
||||
01d,06may99,elg Add 2 new routines in the Runtime Interface: taskDebugStart()
|
||||
and taskDebugEnd().
|
||||
01c,01jun95,ms added taskLock/Unlock, removed timers
|
||||
01b,05apr95,ms new data types.
|
||||
01a,23sep94,ms written.
|
||||
*/
|
||||
|
||||
#ifndef __INCwdbRtIfLibh
|
||||
#define __INCwdbRtIfLibh
|
||||
|
||||
/* includes */
|
||||
|
||||
#include <wdb/wdb.h>
|
||||
#include <wdb/wdbCtxIfLib.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* data types */
|
||||
|
||||
typedef enum wdb_rt_mem_access
|
||||
{
|
||||
WDB_READ = 0, /* memory read access */
|
||||
WDB_WRITE = 1 /* memory write access */
|
||||
} WDB_MEM_ACCESS;
|
||||
|
||||
typedef enum wdb_lock_type /* type of lock */
|
||||
{
|
||||
INT_LOCK = 0,
|
||||
SCHED_LOCK = 1,
|
||||
TASK_RESOURCE_LOCK = 2,
|
||||
ISR_RESOURCE_LOCK = 3
|
||||
} WDB_LOCK_TYPE;
|
||||
|
||||
typedef struct wdb_rt_if
|
||||
{
|
||||
/* this function must be provided always */
|
||||
|
||||
UINT32 (*rtConnectInfoGet) (WDB_CONNECT_INFO * pRtInfo);
|
||||
|
||||
UINT32 (*rtInfoGet) (WDB_RT_INFO * pRtInfo);
|
||||
|
||||
/* function call to reboot machine */
|
||||
|
||||
UINT32 (*reboot) (void);
|
||||
|
||||
/* function to call after loading text */
|
||||
|
||||
UINT32 (*cacheTextUpdate) (char * addr, UINT32 nBytes);
|
||||
|
||||
/* function to call to write protect memory */
|
||||
|
||||
UINT32 (*memProtect) (
|
||||
ULONG ctx,
|
||||
char * addr,
|
||||
UINT32 nBytes,
|
||||
BOOL protect,
|
||||
UINT32 * oldAttr
|
||||
);
|
||||
|
||||
/* required memory access operations */
|
||||
|
||||
UINT32 (*memWrite) (
|
||||
char * pSource,
|
||||
char * pDestination,
|
||||
UINT32 nBytes,
|
||||
UINT32 width
|
||||
);
|
||||
|
||||
UINT32 (*memFill) (
|
||||
char * addr,
|
||||
UINT32 nBytes,
|
||||
UINT32 pattern,
|
||||
UINT32 width
|
||||
);
|
||||
|
||||
UINT32 (*memRead) (
|
||||
char * addr,
|
||||
char * dest,
|
||||
UINT32 nBytes,
|
||||
UINT32 width
|
||||
);
|
||||
|
||||
UINT32 (*memCksum) (
|
||||
char * addr,
|
||||
UINT32 nBytes,
|
||||
UINT32 * pCksum
|
||||
);
|
||||
|
||||
/* optional memory access APIs */
|
||||
|
||||
UINT32 (*memMove) (
|
||||
char * pSource,
|
||||
char * pDestination,
|
||||
UINT32 nBytes
|
||||
);
|
||||
|
||||
UINT32 (*memScan) (
|
||||
char * start,
|
||||
char * end,
|
||||
char * pattern,
|
||||
UINT32 size,
|
||||
BOOL match,
|
||||
char ** pAddr
|
||||
);
|
||||
|
||||
/* memory management operations */
|
||||
|
||||
void * (*memalloc) (size_t nBytes);
|
||||
UINT32 (*memfree) (void * pData);
|
||||
|
||||
/* Memory context switch operation */
|
||||
|
||||
ULONG (*memCtxSwitch) (ULONG newCtx);
|
||||
|
||||
/* Internal resource lock/unlock routines */
|
||||
|
||||
STATUS (*resourceLock) (WDB_LOCK_TYPE intResourceType,
|
||||
int * pLockLvl);
|
||||
STATUS (*resourceUnlock) (WDB_LOCK_TYPE intResourceType,
|
||||
int lockLvl);
|
||||
|
||||
/* errno management */
|
||||
|
||||
int (*errnoGet) (void);
|
||||
STATUS (*errnoSet) (int);
|
||||
|
||||
/* function to install an exception hook (for exc event notification) */
|
||||
|
||||
UINT32 (*excHookAdd) (void (*hook) (
|
||||
WDB_CTX * pStoppedCtx,
|
||||
WDB_CTX * pExcCtx,
|
||||
UINT32 vec,
|
||||
UINT32 sigNum,
|
||||
void * pESF,
|
||||
WDB_IU_REGS * pRegs,
|
||||
BOOL systemSuspend
|
||||
));
|
||||
|
||||
/* Page Size information */
|
||||
|
||||
int pageSize;
|
||||
|
||||
/* node on context specific routines */
|
||||
|
||||
WDB_CTX_IF * pWdbCtxIf [WDB_CTX_TYPE_NUM];
|
||||
} WDB_RT_IF;
|
||||
|
||||
/* global variables */
|
||||
|
||||
extern WDB_RT_IF * pWdbRtIf; /* runtime interface */
|
||||
|
||||
/* macros */
|
||||
|
||||
/* info macro */
|
||||
|
||||
#define WDB_RT_CONNECT_INFO_GET(pRtInfo) \
|
||||
(pWdbRtIf->rtConnectInfoGet == NULL ? \
|
||||
WDB_ERR_NO_RT_PROC : \
|
||||
pWdbRtIf->rtConnectInfoGet (pRtInfo))
|
||||
|
||||
#define WDB_RT_INFO_GET(pRtInfo) \
|
||||
(pWdbRtIf->rtInfoGet == NULL ? \
|
||||
WDB_ERR_NO_RT_PROC : \
|
||||
pWdbRtIf->rtInfoGet (pRtInfo))
|
||||
|
||||
/* reboot macro */
|
||||
|
||||
#define WDB_RT_REBOOT() \
|
||||
(pWdbRtIf->reboot == NULL ? \
|
||||
WDB_ERR_NO_RT_PROC : \
|
||||
pWdbRtIf->reboot ())
|
||||
|
||||
/* memory macros */
|
||||
|
||||
#define WDB_RT_MEM_CACHE_UPDATE(addr, nBytes) \
|
||||
(pWdbRtIf->cacheTextUpdate == NULL ? \
|
||||
WDB_ERR_NO_RT_PROC : \
|
||||
pWdbRtIf->cacheTextUpdate ((addr), (nBytes)))
|
||||
|
||||
#define WDB_RT_MEM_PROTECT(memCtx, dest, nBytes, protect, oldAttr) \
|
||||
(pWdbRtIf->memProtect == NULL ? \
|
||||
WDB_ERR_NO_RT_PROC : \
|
||||
pWdbRtIf->memProtect ((memCtx), (dest), (nBytes), \
|
||||
(protect), (oldAttr)))
|
||||
|
||||
#define WDB_RT_MEM_READ(source, dest, nBytes, width) \
|
||||
(pWdbRtIf->memRead == NULL ? \
|
||||
WDB_ERR_NO_RT_PROC : \
|
||||
pWdbRtIf->memRead ((char*)(source), (char*)(dest), \
|
||||
(nBytes), (width)))
|
||||
|
||||
#define WDB_RT_MEM_WRITE(source, dest, nBytes, width) \
|
||||
(pWdbRtIf->memWrite == NULL ? \
|
||||
WDB_ERR_NO_RT_PROC : \
|
||||
pWdbRtIf->memWrite ((source), (dest), (nBytes), (width)))
|
||||
|
||||
#define WDB_RT_MEM_FILL(source, nBytes, pattern, width) \
|
||||
(pWdbRtIf->memFill == NULL ? \
|
||||
WDB_ERR_NO_RT_PROC : \
|
||||
pWdbRtIf->memFill ((source), (nBytes), (pattern), (width)))
|
||||
|
||||
#define WDB_RT_MEM_MOVE(source, dest, nBytes) \
|
||||
(pWdbRtIf->memMove == NULL ? \
|
||||
WDB_ERR_NO_RT_PROC : \
|
||||
pWdbRtIf->memMove ((source), (dest), (nBytes)))
|
||||
|
||||
#define WDB_RT_MEM_SCAN(start, end, pattern, size, match, pAddr) \
|
||||
(pWdbRtIf->memScan == NULL ? \
|
||||
WDB_ERR_NO_RT_PROC : \
|
||||
pWdbRtIf->memScan ((start), (end), (pattern), (size), \
|
||||
(match), (pAddr)))
|
||||
|
||||
#define WDB_RT_MEM_CKSUM(addr, size, pCksum) \
|
||||
(pWdbRtIf->memCksum == NULL ? \
|
||||
WDB_ERR_NO_RT_PROC : \
|
||||
pWdbRtIf->memCksum ((addr), (size), (pCksum)))
|
||||
|
||||
#define WDB_RT_MEM_ALLOC(type, size) \
|
||||
(pWdbRtIf->memalloc == NULL ? \
|
||||
(type *) NULL : \
|
||||
(type *) pWdbRtIf->memalloc ((size_t) ((size) * sizeof (type))))
|
||||
|
||||
#define WDB_RT_MEM_FREE(addr) \
|
||||
(pWdbRtIf->memfree == NULL ? \
|
||||
WDB_ERR_NO_RT_PROC : \
|
||||
pWdbRtIf->memfree (addr))
|
||||
|
||||
#define WDB_RT_MEM_SWITCH(memCtx) \
|
||||
(pWdbRtIf->memCtxSwitch == NULL ? \
|
||||
WDB_ERR_NO_RT_PROC : \
|
||||
pWdbRtIf->memCtxSwitch (memCtx))
|
||||
|
||||
/* Internal resource lock/unlock macros */
|
||||
|
||||
/*
|
||||
* This lock disables scheduling on the local CPU. This effectively prevents
|
||||
* any other task from running on the local CPU and prevents the calling
|
||||
* from migrating to another CPU until the lock is released. Note that in
|
||||
* system mode, it's nop operation.
|
||||
*/
|
||||
|
||||
#define WDB_RT_SCHED_LOCK(pLevel) \
|
||||
(pWdbRtIf->resourceLock == NULL ? \
|
||||
WDB_ERR_NO_RT_PROC : \
|
||||
(void)pWdbRtIf->resourceLock (SCHED_LOCK, pLevel))
|
||||
|
||||
#define WDB_RT_SCHED_UNLOCK(level) \
|
||||
(pWdbRtIf->resourceUnlock == NULL ? \
|
||||
WDB_ERR_NO_RT_PROC : \
|
||||
(void)pWdbRtIf->resourceUnlock (SCHED_LOCK, level))
|
||||
|
||||
/*
|
||||
* This lock disables interrupts on the local CPU. An architecture-dependent
|
||||
* lock-out key for the interrupt state prior to the call is returned. This
|
||||
* value will be used by WDB_RT_INT_UNLOCK() as input parameter to unlock
|
||||
* resource.
|
||||
*/
|
||||
|
||||
#define WDB_RT_INT_LOCK(pLevel) \
|
||||
(pWdbRtIf->resourceLock == NULL ? \
|
||||
WDB_ERR_NO_RT_PROC : \
|
||||
pWdbRtIf->resourceLock (INT_LOCK, pLevel))
|
||||
|
||||
#define WDB_RT_INT_UNLOCK(level) \
|
||||
(pWdbRtIf->resourceUnlock == NULL ? \
|
||||
WDB_ERR_NO_RT_PROC : \
|
||||
pWdbRtIf->resourceUnlock (INT_LOCK, level))
|
||||
|
||||
/*
|
||||
* This lock is used to control mutually exclusive access to task-level and
|
||||
* interrupt-level WDB internal resource. An architecture dependent lock-out
|
||||
* key for the interrupt state prior to the call is returned. This lock-out
|
||||
* key will be used to unlock resource. Note that in system mode (SMP system
|
||||
* only), it's nop.
|
||||
*/
|
||||
|
||||
#define WDB_RT_ISR_RESOURCE_LOCK(pLockLvl) \
|
||||
(pWdbRtIf->resourceLock == NULL ? \
|
||||
WDB_ERR_NO_RT_PROC : \
|
||||
pWdbRtIf->resourceLock (ISR_RESOURCE_LOCK, pLockLvl))
|
||||
|
||||
#define WDB_RT_ISR_RESOURCE_UNLOCK(lockLvl) \
|
||||
(pWdbRtIf->resourceUnlock == NULL ? \
|
||||
WDB_ERR_NO_RT_PROC : \
|
||||
pWdbRtIf->resourceUnlock (ISR_RESOURCE_LOCK, lockLvl))
|
||||
|
||||
/*
|
||||
* This lock is used to control mutually exclusive access to a task-level
|
||||
* WDB internal resource, it cannot be used at interrupt-level. Return OK on
|
||||
* success or ERROR if the we cannot lock the resource. Note that in system
|
||||
* mode, it's nop operation.
|
||||
*/
|
||||
|
||||
#define WDB_RT_TASK_RESOURCE_LOCK(pLockLvl) \
|
||||
(pWdbRtIf->resourceLock == NULL ? \
|
||||
WDB_ERR_NO_RT_PROC : \
|
||||
pWdbRtIf->resourceLock (TASK_RESOURCE_LOCK, pLockLvl))
|
||||
|
||||
#define WDB_RT_TASK_RESOURCE_UNLOCK(lockLvl) \
|
||||
(pWdbRtIf->resourceUnlock == NULL ? \
|
||||
WDB_ERR_NO_RT_PROC : \
|
||||
pWdbRtIf->resourceUnlock (TASK_RESOURCE_LOCK, lockLvl))
|
||||
|
||||
/* errno management */
|
||||
|
||||
#define WDB_RT_ERRNO_GET() \
|
||||
(pWdbRtIf->errnoGet == NULL ? \
|
||||
ERROR : \
|
||||
pWdbRtIf->errnoGet ())
|
||||
|
||||
#define WDB_RT_ERRNO_SET(x) \
|
||||
(pWdbRtIf->errnoSet == NULL ? \
|
||||
ERROR : \
|
||||
pWdbRtIf->errnoSet (x))
|
||||
|
||||
/* hooks */
|
||||
|
||||
#define WDB_RT_EXC_HOOK_ADD(hook) \
|
||||
(pWdbRtIf->excHookAdd == NULL ? \
|
||||
WDB_ERR_NO_RT_PROC : \
|
||||
pWdbRtIf->excHookAdd (hook))
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __INCwdbRtIfLibh */
|
||||
@@ -0,0 +1,52 @@
|
||||
/* wdbRtpLibP.h - private header file for RTP runtime interface */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2005,2010 Wind River Systems, Inc.
|
||||
*
|
||||
* The right to copy, distribute, modify or otherwise make use of this
|
||||
* software may be licensed only pursuant to the terms of an applicable Wind
|
||||
* River license agreement.
|
||||
*/
|
||||
|
||||
/*
|
||||
modification history
|
||||
--------------------
|
||||
01c,29apr10,pad Moved extern C statement after include statements.
|
||||
01b,05mar10,rlp LP64 adaptation.
|
||||
01a,25jul05,bpn Created.
|
||||
*/
|
||||
|
||||
#ifndef __INCwdbRtpLibPh
|
||||
#define __INCwdbRtpLibPh
|
||||
|
||||
/* includes */
|
||||
|
||||
#include <rtpLib.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* data types */
|
||||
|
||||
typedef struct wdb_rtp_info
|
||||
{
|
||||
/* RTP exit hook for WDB */
|
||||
void (*wdbDeleteHook) (WDB_CTX ctx, UINT32 exitCode, UINT32 err);
|
||||
/* RTP Detach routine */
|
||||
void (*wdbDetachHook) (RTP_ID rtpId, struct wdb_rtp_info * pInfo);
|
||||
/* TRUE if CPS is set for that task */
|
||||
BOOL childProcessStop;
|
||||
} WDB_RTP_INFO;
|
||||
|
||||
/* function prototypes */
|
||||
|
||||
extern void wdbRtpCtrlLibInit (void);
|
||||
extern STATUS wdbRtpDeleteHookManage (BOOL addHook);
|
||||
extern WDB_RTP_INFO * wdbRtpInfoAlloc (RTP_ID pid);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __INCwdbRtpLibPh */
|
||||
@@ -0,0 +1,86 @@
|
||||
/* wdbSvcLib.h - header file for remote debug server */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994-2005,2009-2010 Wind River Systems, Inc.
|
||||
*
|
||||
* The right to copy, distribute, modify or otherwise make use of this
|
||||
* software may be licensed only pursuant to the terms of an applicable Wind
|
||||
* River license agreement.
|
||||
*/
|
||||
|
||||
/*
|
||||
modification history
|
||||
--------------------
|
||||
01k,30mar10,pad Moved 'extern "C"' statement and applied C++ inline scheme for
|
||||
wdbSvcHookAdd().
|
||||
01k,19jan10,pad Removed usage of _WRS_KEEP_USING_FUNCPTR.
|
||||
01j,20oct09,rlp Adapted to LP64 model.
|
||||
01i,06dec05,dbt Removed u_int & IMPORT references.
|
||||
Replaced XDR references with WDB XDR references.
|
||||
01h,28jul05,bpn Remove DSA support.
|
||||
01g,27feb03,elg Merge file with BSD.
|
||||
01f,25apr02,jhw Added C++ support (SPR 76304).
|
||||
01e,11jan99,dbt added wdbSvcHookAdd() prototype (SPR #24323).
|
||||
01d,12feb98,dbt added "dynamic" field in WDB_SVC structure
|
||||
added wdbSvcDsaSvcRemove() declaration.
|
||||
01c,05apr95,ms new data types.
|
||||
01b,06feb95,ms added XPORT handle to dispatch routine.
|
||||
01a,20sep94,ms written.
|
||||
*/
|
||||
|
||||
#ifndef __INCwdbSvcLibh
|
||||
#define __INCwdbSvcLibh
|
||||
|
||||
/* includes */
|
||||
|
||||
#include <wdb/wdb.h>
|
||||
#include <wdb/xdrwdb.h>
|
||||
#include <wdb/wdbRpcLib.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* data types */
|
||||
|
||||
typedef UINT32 (*WDB_SVC_HOOK_FUNCPTR) (unsigned long arg);
|
||||
|
||||
typedef struct /* hidden */
|
||||
{
|
||||
UINT32 serviceNum;
|
||||
UINT32 (*serviceRtn)();
|
||||
wdbXdrProc_t inProc;
|
||||
wdbXdrProc_t outProc;
|
||||
} WDB_SVC;
|
||||
|
||||
/* function prototypes */
|
||||
|
||||
extern void wdbSvcLibInit (WDB_SVC * wdbSvcArray, UINT32 size);
|
||||
extern STATUS wdbSvcAdd (UINT32 procNum, UINT32 (*rout) (),
|
||||
wdbXdrProc_t xdrIn, wdbXdrProc_t xdrOut);
|
||||
extern void wdbSvcDispatch (WDB_XPORT * pXport, UINT32 procNum);
|
||||
extern void wdbSvcHookAdd (UINT32 (*hookRtn) (unsigned long arg),
|
||||
unsigned long arg);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
/*
|
||||
* Inlined C++ wrapper for the old-style FUNCPTR based wdbSvcHookAdd() function
|
||||
* prototype.
|
||||
*/
|
||||
|
||||
extern void wdbSvcHookAdd (FUNCPTR hookRtn, unsigned long arg) \
|
||||
_WRS_DEPRECATED ("please use fully qualified function pointer version "
|
||||
"of API");
|
||||
|
||||
inline void wdbSvcHookAdd
|
||||
(
|
||||
FUNCPTR hookRtn,
|
||||
unsigned long arg
|
||||
)
|
||||
{
|
||||
return wdbSvcHookAdd ((WDB_SVC_HOOK_FUNCPTR)hookRtn, arg);
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __INCwdbSvcLibh */
|
||||
@@ -0,0 +1,84 @@
|
||||
/* wdbTaskLib.h - header file for task support in WDB agent */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2003,2005-2007,2009-2010 Wind River Systems, Inc.
|
||||
*
|
||||
* The right to copy, distribute, modify or otherwise make use of this
|
||||
* software may be licensed only pursuant to the terms of an applicable Wind
|
||||
* River license agreement.
|
||||
*/
|
||||
|
||||
/*
|
||||
modification history
|
||||
--------------------
|
||||
01g,19jan10,pad Removed usage of _WRS_KEEP_USING_FUNCPTR.
|
||||
01f,10dec09,rlp Modified wdbTaskBpAdd prototype and removed TGT_XXX types.
|
||||
01e,29sep09,rlp Adapted to LP64 model.
|
||||
01d,06jul07,p_b Added 64bits support
|
||||
01c,30oct06,rlp Modified to use VxDBG library (REQ00007655).
|
||||
01b,12jul05,bpn Added childProcessStop field to WDB_TASK_INFO.
|
||||
01a,16dec03,elg Written.
|
||||
*/
|
||||
|
||||
#ifndef __INCwdbTaskLibh
|
||||
#define __INCwdbTaskLibh
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* defines */
|
||||
|
||||
#define WDB_INFO(p) ((WDB_TASK_INFO *) (((WIND_TCB *) (p))->pWdbInfo))
|
||||
|
||||
/* data types */
|
||||
|
||||
typedef struct wdb_task_info /* task information for WDB */
|
||||
{
|
||||
struct
|
||||
{
|
||||
void * wdb1;
|
||||
void * wdb2;
|
||||
} wdbEvtList; /* dll for event */
|
||||
void * taskBpAddr; /* current breakpoint address */
|
||||
INSTR * taskPc; /* task program counter */
|
||||
void * taskFp; /* task frame pointer */
|
||||
void * taskSp; /* task stack pointer */
|
||||
VOIDFUNCPTR wdbExitHook; /* task exit hook */
|
||||
ULONG tid; /* task ID */
|
||||
UINT32 ctxType; /* context stopped by breakpoint */
|
||||
UINT32 status; /* status of context that hit BP */
|
||||
BOOL evtQueued; /* event queued for host */
|
||||
BOOL childProcessStop; /* TRUE if CPS is set for that task */
|
||||
} WDB_TASK_INFO;
|
||||
|
||||
/* globals */
|
||||
|
||||
extern BOOL (*wdbTaskRestartHook) (EXC_INFO * pExcInfo);
|
||||
|
||||
/* function prototypes */
|
||||
|
||||
extern UINT32 wdbTaskDeleteHookAdd (ULONG tid, void (*hook)
|
||||
(
|
||||
WDB_CTX ctx,
|
||||
int exitCode,
|
||||
int errorStatus
|
||||
));
|
||||
extern UINT32 wdbTaskCreateHookAdd (void (*hook)
|
||||
(
|
||||
WDB_CTX * createdCtx,
|
||||
WDB_CTX * creationCtx
|
||||
),
|
||||
WDB_ACTION_TYPE action);
|
||||
extern UINT32 wdbTaskStep (ULONG ctxId, INSTR * startAddr, INSTR * endAddr);
|
||||
extern UINT32 wdbTaskStop (ULONG ctxId);
|
||||
extern UINT32 wdbTaskCont (ULONG ctxId);
|
||||
extern UINT32 wdbTaskBpAdd (WDB_CTX * pCtx, WDB_ACTION * pAction,
|
||||
void * addr, UINT32 count,
|
||||
UINT32 type, ULONG * pBpId);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __INCwdbTaskLibh */
|
||||
@@ -0,0 +1,39 @@
|
||||
/* wdbTipcSockLib.h - header file for remote debug agent TIPC library */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2005, 2010 Wind River Systems, Inc.
|
||||
*
|
||||
* The right to copy, distribute, modify or otherwise make use of this
|
||||
* software may be licensed only pursuant to the terms of an applicable Wind
|
||||
* River license agreement.
|
||||
*/
|
||||
|
||||
/*
|
||||
modification history
|
||||
--------------------
|
||||
01b,29apr10,pad Moved extern C statement after include statements.
|
||||
01a,30may05,dbt written.
|
||||
*/
|
||||
|
||||
#ifndef __INCwdbTipcSockLibh
|
||||
#define __INCwdbTipcSockLibh
|
||||
|
||||
/* includes */
|
||||
|
||||
#include "wdb/wdbCommIfLib.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* function prototypes */
|
||||
|
||||
extern STATUS wdbTipcSockIfInit (WDB_COMM_IF * pCommIf,
|
||||
UINT8 tipcPortType,
|
||||
UINT8 tipcPortInstance);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __INCwdbTipcSockLibh */
|
||||
@@ -0,0 +1,55 @@
|
||||
/* wdbTyCoDrv.h - header file for BSP serial drivers used by the agent */
|
||||
|
||||
/* Copyright 1984-2002, 2010 Wind River Systems, Inc. */
|
||||
|
||||
/*
|
||||
modification history
|
||||
--------------------
|
||||
01e,29apr10,pad Moved extern C statement after include statements.
|
||||
01d,25apr02,jhw Added C++ support (SPR 76304).
|
||||
01c,15jun95,ms updated for new serial driver.
|
||||
01b,05apr95,ms new data types.
|
||||
01a,20dec94,ms written.
|
||||
*/
|
||||
|
||||
#ifndef __INCwdbTyCoDrvh
|
||||
#define __INCwdbTyCoDrvh
|
||||
|
||||
/* includes */
|
||||
|
||||
#include "sioLib.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* data types */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
SIO_DRV_FUNCS * pDrvFuncs; /* driver functions */
|
||||
STATUS (*getTxChar)(); /* tx callback */
|
||||
void * getTxArg; /* callback arg */
|
||||
STATUS (*putRcvChar)(); /* receive callback */
|
||||
void * putRcvArg; /* callback arg */
|
||||
int fd; /* underlying tyCo file descriptor */
|
||||
} WDB_TYCO_SIO_CHAN;
|
||||
|
||||
/* function prototypes */
|
||||
|
||||
#if defined(__STDC__)
|
||||
|
||||
extern STATUS wdbTyCoDevInit (WDB_TYCO_SIO_CHAN *pDev, char *devName,
|
||||
int baud);
|
||||
|
||||
#else /* __STDC__ */
|
||||
|
||||
extern STATUS wdbTyCoInit ();
|
||||
|
||||
#endif /* __STDC__ */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __INCwdbTyCoDrvh */
|
||||
@@ -0,0 +1,44 @@
|
||||
/* wdbUdpLib.h - header file for remote debug agents UDP library */
|
||||
|
||||
/* Copyright 1984-2002, 2010 Wind River Systems, Inc. */
|
||||
|
||||
/*
|
||||
modification history
|
||||
--------------------
|
||||
01d,29apr10,pad Moved extern C statement after include statements.
|
||||
01c,25apr02,jhw Added C++ support (SPR 76304).
|
||||
01b,05apr95,ms new data types.
|
||||
01a,20dec94,ms written.
|
||||
*/
|
||||
|
||||
#ifndef __INCwdbUdpLibh
|
||||
#define __INCwdbUdpLibh
|
||||
|
||||
/* includes */
|
||||
|
||||
#include "wdb/wdbCommIfLib.h"
|
||||
#include "wdb/wdbMbufLib.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* function prototypes */
|
||||
|
||||
#if defined(__STDC__)
|
||||
|
||||
extern STATUS udpCommIfInit (WDB_COMM_IF *pWdbCommIf, WDB_DRV_IF *pDrvIf);
|
||||
extern void udpRcv (struct mbuf *pMbuf);
|
||||
|
||||
#else /* __STDC__ */
|
||||
|
||||
extern STATUS udpCommIfInit ();
|
||||
extern void udpRcv ();
|
||||
|
||||
#endif /* __STDC__ */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __INCwdbUdpLibh */
|
||||
@@ -0,0 +1,40 @@
|
||||
/* wdbUdpSockLib.h - header file for remote debug agents UDP library */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1995, 2002, 2010-2011 Wind River Systems, Inc.
|
||||
*
|
||||
* The right to copy, distribute, modify or otherwise make use of this
|
||||
* software may be licensed only pursuant to the terms of an applicable Wind
|
||||
* River license agreement.
|
||||
*/
|
||||
|
||||
/*
|
||||
modification history
|
||||
--------------------
|
||||
01e,17mar11,rlp Modified wdbUdpSockIfInit prototype to pass an IP address.
|
||||
01d,29apr10,pad Moved extern C statement after include statements.
|
||||
01c,25apr02,jhw Added C++ support (SPR 76304).
|
||||
01b,05apr95,ms new data types.
|
||||
01a,08mar95,ms written.
|
||||
*/
|
||||
|
||||
#ifndef __INCwdbUdpSockLibh
|
||||
#define __INCwdbUdpSockLibh
|
||||
|
||||
/* includes */
|
||||
|
||||
#include "wdb/wdbCommIfLib.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* function prototypes */
|
||||
|
||||
extern STATUS wdbUdpSockIfInit (WDB_COMM_IF *pCommIf, char * ipAddr);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __INCwdbUdpSockLibh */
|
||||
@@ -0,0 +1,78 @@
|
||||
/* wdbVioLib.h - VIO header file for remote debug server */
|
||||
|
||||
/*
|
||||
* Copyright 1994-1998,2002,2007,2010 Wind River Systems, Inc.
|
||||
*
|
||||
* The right to copy, distribute, modify or otherwise make use
|
||||
* of this software may be licensed only pursuant to the terms
|
||||
* of an applicable Wind River license agreement.
|
||||
*/
|
||||
|
||||
/*
|
||||
modification history
|
||||
--------------------
|
||||
01l,29apr10,pad Moved extern C statement after include statements.
|
||||
01k,04feb10,rlp Removed wdbVioDrv prototype.
|
||||
01j,03feb10,rlp LP64 adaptation.
|
||||
01i,04jul07,rlp Modified wdbVioChannelUnregister prototype.
|
||||
01h,25apr02,jhw Added C++ support (SPR 76304).
|
||||
01g,27may98,cth removed get snd/rcv buffer ioctl commands for tsfs sockets
|
||||
01f,19mar98,cth add ioctl commands for tsfs sockets
|
||||
01e,18aug97,cth add FIOSNDURGB ioctl cmd for tsfs
|
||||
01d,12nov96,c_s add wdbTsfsDrv prototype
|
||||
01c,24may95,ms added wdbVioChannelUnregister().
|
||||
01b,05apr95,ms new data types.
|
||||
01a,15nov94,ms written.
|
||||
*/
|
||||
|
||||
#ifndef __INCwdbVioLibh
|
||||
#define __INCwdbVioLibh
|
||||
|
||||
/* includes */
|
||||
|
||||
#include <wdb/wdb.h>
|
||||
#include <wdb/dll.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* data types */
|
||||
|
||||
typedef struct wdb_vio_node
|
||||
{
|
||||
dll_t node;
|
||||
UINT32 channel;
|
||||
UINT32 (*inputRtn)
|
||||
(
|
||||
struct wdb_vio_node * pNode,
|
||||
char * pData,
|
||||
UINT32 nBytes);
|
||||
void * pVioDev;
|
||||
} WDB_VIO_NODE;
|
||||
|
||||
/* ioctl commands for Target-Server File System (TSFS) */
|
||||
|
||||
#define SO_SNDURGB 5000 /* send an out-of-band byte on sock */
|
||||
#define SO_SETDEBUG 5001 /* setsockopt SO_DEBUG for sock (int) */
|
||||
#define SO_GETDEBUG 5002 /* getsockopt SO_DEBUG for sock (int) */
|
||||
#define SO_SETSNDBUF 5003 /* setsockopt SO_SNDBUF for sock (int) */
|
||||
#define SO_SETRCVBUF 5005 /* setsockopt SO_RCVBUF for sock (int) */
|
||||
#define SO_SETDONTROUTE 5007 /* setsockopt SO_DONTROUTE for sock (int) */
|
||||
#define SO_GETDONTROUTE 5008 /* getsockopt SO_DONTROUTE for sock (int) */
|
||||
#define SO_SETOOBINLINE 5009 /* setsockopt SO_OOBINLINE for sock (int) */
|
||||
#define SO_GETOOBINLINE 5010 /* getsockopt SO_OOBINLINE for sock (int) */
|
||||
|
||||
|
||||
/* function prototypes */
|
||||
|
||||
extern void wdbVioLibInit (void);
|
||||
extern STATUS wdbVioChannelRegister (WDB_VIO_NODE *pVioNode);
|
||||
extern STATUS wdbVioChannelUnregister (WDB_VIO_NODE *pVioNode);
|
||||
extern STATUS wdbTsfsDrv (char * root);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __INCwdbVioLibh */
|
||||
@@ -0,0 +1,95 @@
|
||||
/* wdbXdrLib.h - External Data Representation Serialization Routines for WDB */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2005-2007 Wind River Systems, Inc.
|
||||
*
|
||||
* The right to copy, distribute, modify or otherwise make use of this
|
||||
* software may be licensed only pursuant to the terms of an applicable Wind
|
||||
* River license agreement.
|
||||
*/
|
||||
|
||||
/*
|
||||
modification history
|
||||
--------------------
|
||||
01c,10jul07,tbu Fixed for 64 bits big endian, some cleanup
|
||||
01b,06jul07,p_b Added 64 bits support
|
||||
01a,06dec05,dbt written based on xdr.h
|
||||
*/
|
||||
|
||||
#ifndef __INCwdbXdrLibh
|
||||
#define __INCwdbXdrLibh
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
DESCRIPTION
|
||||
|
||||
Header file for WDB XDR implementation. This header file is mean to be used
|
||||
only when building runtime XDRs, it should not be used when building
|
||||
Target Server. The main reason for this WDB XDR implementation is to provide
|
||||
a fully standalone WDB agent that does not depend on the runtime Operating
|
||||
System source and header files.
|
||||
*/
|
||||
|
||||
/* defines */
|
||||
|
||||
#define WDB_XDR_SETPOS wdbXdrSetpos
|
||||
#define WDB_XDR_GETPOS wdbXdrGetpos
|
||||
#define WDB_XDR_INLINE wdbXdrInline
|
||||
#define WDB_XDR_PUTBYTES wdbXdrPutbytes
|
||||
|
||||
#define WDB_XDR_GETLONG(xdrs,lp) \
|
||||
wdbXdrGetVal((xdrs),(lp),sizeof(long))
|
||||
#define WDB_XDR_PUTLONG(xdrs,lp) \
|
||||
wdbXdrPutVal((xdrs),(lp),sizeof(long))
|
||||
#define WDB_XDR_GETUINT32(xdrs,lp) \
|
||||
wdbXdrGetVal((xdrs),(lp),sizeof(UINT32))
|
||||
#define WDB_XDR_PUTUINT32(xdrs,lp) \
|
||||
wdbXdrPutVal((xdrs),(lp),sizeof(UINT32))
|
||||
#define WDB_XDR_GETADDR(xdrs,lp) \
|
||||
wdbXdrGetVal((xdrs),(lp),sizeof(TGT_ADDR_T))
|
||||
#define WDB_XDR_PUTADDR(xdrs,lp) \
|
||||
wdbXdrPutVal((xdrs),(lp),sizeof(TGT_ADDR_T))
|
||||
|
||||
/* XDR type definitions (target only) */
|
||||
|
||||
typedef enum wdb_xdr_op
|
||||
{
|
||||
WDB_XDR_ENCODE = 0,
|
||||
WDB_XDR_DECODE = 1,
|
||||
WDB_XDR_FREE = 2
|
||||
} WDB_XDR_OP;
|
||||
|
||||
typedef struct wdb_xdr
|
||||
{
|
||||
WDB_XDR_OP x_op; /* operation; fast additional param */
|
||||
char * x_private; /* pointer to private data */
|
||||
char * x_base; /* private used for position info */
|
||||
UINT32 x_handy; /* extra private word */
|
||||
} WDB_XDR;
|
||||
|
||||
typedef BOOL (*wdbXdrProc_t)();
|
||||
|
||||
/* function declarations */
|
||||
|
||||
extern void wdbXdrCreate (WDB_XDR * xdrs, char * addr,
|
||||
UINT32 size, WDB_XDR_OP op);
|
||||
extern BOOL wdbXdrSetpos (WDB_XDR * xdrs, UINT32 pos);
|
||||
extern UINT32 wdbXdrGetpos (WDB_XDR * xdrs);
|
||||
|
||||
extern UINT32 * wdbXdrInline (WDB_XDR * xdrs, size_t len);
|
||||
extern BOOL wdbXdrPutbytes (WDB_XDR * xdrs, char * addr,
|
||||
size_t len);
|
||||
|
||||
extern BOOL wdbXdrGetVal (WDB_XDR * xdrs,void * lp,
|
||||
size_t size);
|
||||
extern BOOL wdbXdrPutVal (WDB_XDR * xdrs,void * lp,
|
||||
size_t size);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __INCwdbXdrLibh */
|
||||
@@ -0,0 +1,169 @@
|
||||
/* xdrwdb.h - External Data Representation Serialization Routines for WDB */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2005,2007,2009-2010 Wind River Systems, Inc.
|
||||
*
|
||||
* The right to copy, distribute, modify or otherwise make use of this
|
||||
* software may be licensed only pursuant to the terms of an applicable Wind
|
||||
* River license agreement.
|
||||
*/
|
||||
|
||||
/*
|
||||
modification history
|
||||
--------------------
|
||||
01d,29jul10,pad Moved extern C statement after include statements.
|
||||
01c,11jun09,rlp Created xdr_INT32 (WIND00169866).
|
||||
01b,26jun07,tbu added 64 bit support
|
||||
+ p_b completed support
|
||||
01a,06dec05,dbt written based on xdr.h
|
||||
*/
|
||||
|
||||
#ifndef __INCxdrwdbh
|
||||
#define __INCxdrwdbh
|
||||
|
||||
/* includes */
|
||||
|
||||
#include <wdb/wdb.h>
|
||||
#ifdef HOST
|
||||
#include <rpc/rpc.h>
|
||||
#else /* HOST */
|
||||
#include <wdb/wdbXdrLib.h>
|
||||
#endif /* HOST */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* defines */
|
||||
|
||||
#define BYTES_PER_WDB_XDR_UNIT 4
|
||||
|
||||
#define WDB_XDR_RNDUP(x) ((((x) + BYTES_PER_WDB_XDR_UNIT - 1) / \
|
||||
BYTES_PER_WDB_XDR_UNIT) \
|
||||
* BYTES_PER_WDB_XDR_UNIT)
|
||||
|
||||
#ifdef HOST
|
||||
#define WDB_XDR_SETPOS XDR_SETPOS
|
||||
#define WDB_XDR_GETPOS XDR_GETPOS
|
||||
#define WDB_XDR_INLINE XDR_INLINE
|
||||
#define WDB_XDR_PUTBYTES XDR_PUTBYTES
|
||||
#define WDB_XDR_GETLONG XDR_GETLONG
|
||||
#define WDB_XDR_PUTLONG XDR_PUTLONG
|
||||
#define wdbXdrProc_t xdrproc_t
|
||||
#define WDB_XDR XDR
|
||||
#define WDB_XDR_OP XDR_OP
|
||||
#define WDB_XDR_ENCODE XDR_ENCODE
|
||||
#define WDB_XDR_DECODE XDR_DECODE
|
||||
#define WDB_XDR_FREE XDR_FREE
|
||||
#define WDB_XDR_GETUINT32 XDR_GETLONG
|
||||
#define WDB_XDR_PUTUINT32 XDR_PUTLONG
|
||||
#define WDB_XDR_GETADDR XDR_GETLONG
|
||||
#define WDB_XDR_PUTADDR XDR_PUTLONG
|
||||
|
||||
#endif /* HOST */
|
||||
|
||||
#define xdr_TGT_INT_T(xdrs,pInt) xdr_UINT32((xdrs),(UINT32*) (pInt))
|
||||
#define xdr_INT32(xdrs,pInt) xdr_UINT32((xdrs),(UINT32*) (pInt))
|
||||
|
||||
/* type definitions */
|
||||
|
||||
typedef struct wdb_param_wrapper
|
||||
{
|
||||
struct wdb_core wdbCore; /* core parameters */
|
||||
void * pParams; /* real parameters */
|
||||
BOOL (*xdr)(); /* XDR filter for the real params */
|
||||
UINT32 seqNum; /* sequence number */
|
||||
} WDB_PARAM_WRAPPER;
|
||||
|
||||
typedef struct wdb_reply_wrapper
|
||||
{
|
||||
void * pReply; /* real reply */
|
||||
BOOL (*xdr)(); /* XDR filter for the real reply */
|
||||
UINT32 errCode; /* error status */
|
||||
} WDB_REPLY_WRAPPER;
|
||||
|
||||
/* function declarations */
|
||||
|
||||
extern BOOL xdr_UINT32 (WDB_XDR *xdrs, UINT32 *objp);
|
||||
extern BOOL xdr_TGT_ADDR_T (WDB_XDR *xdrs, TGT_ADDR_T *objp);
|
||||
extern BOOL xdr_TGT_LONG_T (WDB_XDR *xdrs, TGT_LONG_T *objp);
|
||||
extern BOOL xdr_WDB_CORE (WDB_XDR *xdrs, WDB_CORE *objp);
|
||||
extern BOOL xdr_WDB_STRING_T (WDB_XDR *xdrs, WDB_STRING_T *objp);
|
||||
extern BOOL xdr_WDB_OPQ_DATA_T (WDB_XDR *xdrs, WDB_OPQ_DATA_T *objp,
|
||||
UINT32 len);
|
||||
extern BOOL xdr_ARRAY (WDB_XDR *xdrs, char **, UINT32 *,
|
||||
UINT32, size_t,
|
||||
wdbXdrProc_t elproc);
|
||||
extern BOOL xdr_WDB_STRING_ARRAY (WDB_XDR * xdrs, char **,
|
||||
UINT32 *, UINT32);
|
||||
extern BOOL xdr_CHECKSUM (WDB_XDR *xdrs, UINT32 xdrCksumVal,
|
||||
UINT32 xdrStreamSize,
|
||||
UINT32 xdrCksumValPos,
|
||||
UINT32 xdrStreamSizePos);
|
||||
extern BOOL xdr_REFERENCE (WDB_XDR * xdrs, char ** pp,
|
||||
size_t size, wdbXdrProc_t elproc);
|
||||
extern BOOL xdr_WDB_PARAM_WRAPPER (WDB_XDR *xdrs,
|
||||
WDB_PARAM_WRAPPER *objp);
|
||||
extern BOOL xdr_WDB_REPLY_WRAPPER (WDB_XDR *xdrs,
|
||||
WDB_REPLY_WRAPPER *objp);
|
||||
extern BOOL xdr_WDB_AGENT_INFO (WDB_XDR *xdrs,
|
||||
WDB_AGENT_INFO *objp);
|
||||
extern BOOL xdr_WDB_CONNECT_INFO (WDB_XDR *xdrs,
|
||||
WDB_CONNECT_INFO *objp);
|
||||
extern BOOL xdr_WDB_TGT_INFO (WDB_XDR *xdrs,
|
||||
WDB_TGT_INFO *objp);
|
||||
extern BOOL xdr_WDB_MEM_REGION (WDB_XDR *xdrs,
|
||||
WDB_MEM_REGION *objp);
|
||||
extern BOOL xdr_WDB_MEM_XFER (WDB_XDR *xdrs,
|
||||
WDB_MEM_XFER *objp);
|
||||
extern BOOL xdr_WDB_MEM_SCAN_DESC (WDB_XDR *xdrs,
|
||||
WDB_MEM_SCAN_DESC *objp);
|
||||
extern BOOL xdr_WDB_CTX (WDB_XDR *xdrs, WDB_CTX *objp);
|
||||
extern BOOL xdr_WDB_CTX_CREATE_DESC (WDB_XDR *xdrs,
|
||||
WDB_CTX_CREATE_DESC *objp);
|
||||
extern BOOL xdr_WDB_CTX_KILL_DESC (WDB_XDR *xdrs,
|
||||
WDB_CTX_KILL_DESC *objp);
|
||||
extern BOOL xdr_WDB_CTX_STEP_DESC (WDB_XDR *xdrs,
|
||||
WDB_CTX_STEP_DESC *objp);
|
||||
extern BOOL xdr_WDB_DIRECT_CALL_RET (WDB_XDR *xdrs,
|
||||
WDB_DIRECT_CALL_RET *objp);
|
||||
extern BOOL xdr_WDB_CALL_RETURN_INFO(WDB_XDR *xdrs,
|
||||
WDB_CALL_RET_INFO *objp);
|
||||
extern BOOL xdr_WDB_REG_READ_DESC (WDB_XDR *xdrs,
|
||||
WDB_REG_READ_DESC *objp);
|
||||
extern BOOL xdr_WDB_REG_WRITE_DESC (WDB_XDR *xdrs,
|
||||
WDB_REG_WRITE_DESC *objp);
|
||||
extern BOOL xdr_WDB_EVTPT_ADD_DESC (WDB_XDR *xdrs,
|
||||
WDB_EVTPT_ADD_DESC *objp);
|
||||
extern BOOL xdr_WDB_EVTPT_DEL_DESC (WDB_XDR *xdrs,
|
||||
WDB_EVTPT_DEL_DESC *objp);
|
||||
extern BOOL xdr_WDB_EVT_DATA (WDB_XDR *xdrs,
|
||||
WDB_EVT_DATA *objp);
|
||||
extern BOOL xdr_WDB_EVT_INFO (WDB_XDR *xdrs, WDB_EVT_INFO *objp);
|
||||
extern BOOL xdr_WDB_SYM_INFO (WDB_XDR * xdrs, WDB_SYM_INFO * objp);
|
||||
extern BOOL xdr_WDB_SYM_LIST (WDB_XDR * xdrs, WDB_SYM_LIST * objp);
|
||||
extern BOOL xdr_WDB_SECT_INFO (WDB_XDR * xdrs, WDB_SECT_INFO * objp);
|
||||
extern BOOL xdr_WDB_SEG_INFO (WDB_XDR * xdrs, WDB_SEG_INFO * objp);
|
||||
extern BOOL xdr_WDB_MOD_INFO (WDB_XDR * xdrs, WDB_MOD_INFO * objp);
|
||||
extern BOOL xdr_WDB_SYM_MOD_DESC (WDB_XDR * xdrs,
|
||||
WDB_SYM_MOD_DESC * objp);
|
||||
extern BOOL xdr_WDB_SYM_ID_LIST (WDB_XDR * xdrs,
|
||||
WDB_SYM_ID_LIST * objp);
|
||||
extern BOOL xdr_WDB_SYM_ID (WDB_XDR * xdrs, WDB_SYM_ID * objp);
|
||||
extern BOOL xdr_WDB_RT_INFO (WDB_XDR * xdrs, WDB_RT_INFO * objp);
|
||||
extern BOOL xdr_WDB_USR_SVC_CTRL_INFO (WDB_XDR * xdrs,
|
||||
WDB_USR_SVC_CTRL_INFO * objp);
|
||||
|
||||
extern BOOL xdr_VOID (WDB_XDR * xdrs);
|
||||
extern BOOL xdr_BOOL (WDB_XDR * xdrs, BOOL * bp);
|
||||
extern BOOL xdr_ENUM (WDB_XDR * xdrs, UINT32 * ep);
|
||||
|
||||
extern BOOL xdr_WDB_TGT_INFO_2 (WDB_XDR * xdrs,
|
||||
WDB_TGT_INFO_2 * objp);
|
||||
extern BOOL xdr_WDB_CONNECT_PARAMS (WDB_XDR * xdrs,
|
||||
WDB_CONNECT_PARAMS * objp);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __INCxdrwdbh */
|
||||
Reference in New Issue
Block a user