From 33613a85afc4b1481367fbe92a17ee59c240250b Mon Sep 17 00:00:00 2001 From: Sven Eisenhauer Date: Fri, 10 Nov 2023 15:11:48 +0100 Subject: add new repo --- .../ARM202U/SOURCE/WIN32/ARMDBG/ARMDBG.H | 1137 ++++++++++++++++++++ .../ARM202U/SOURCE/WIN32/ARMDBG/DBG_CONF.H | 47 + .../ARM202U/SOURCE/WIN32/ARMDBG/DBG_CP.H | 57 + .../ARM202U/SOURCE/WIN32/ARMDBG/DBG_HIF.H | 46 + .../ARM202U/SOURCE/WIN32/ARMDBG/DBG_RDI.H | 614 +++++++++++ .../ARM202U/SOURCE/WIN32/ARMDBG/DBG_STAT.H | 37 + 6 files changed, 1938 insertions(+) create mode 100644 Bachelor/Mikroprozessorsysteme2/ARM202U/SOURCE/WIN32/ARMDBG/ARMDBG.H create mode 100644 Bachelor/Mikroprozessorsysteme2/ARM202U/SOURCE/WIN32/ARMDBG/DBG_CONF.H create mode 100644 Bachelor/Mikroprozessorsysteme2/ARM202U/SOURCE/WIN32/ARMDBG/DBG_CP.H create mode 100644 Bachelor/Mikroprozessorsysteme2/ARM202U/SOURCE/WIN32/ARMDBG/DBG_HIF.H create mode 100644 Bachelor/Mikroprozessorsysteme2/ARM202U/SOURCE/WIN32/ARMDBG/DBG_RDI.H create mode 100644 Bachelor/Mikroprozessorsysteme2/ARM202U/SOURCE/WIN32/ARMDBG/DBG_STAT.H (limited to 'Bachelor/Mikroprozessorsysteme2/ARM202U/SOURCE/WIN32/ARMDBG') diff --git a/Bachelor/Mikroprozessorsysteme2/ARM202U/SOURCE/WIN32/ARMDBG/ARMDBG.H b/Bachelor/Mikroprozessorsysteme2/ARM202U/SOURCE/WIN32/ARMDBG/ARMDBG.H new file mode 100644 index 0000000..93ec407 --- /dev/null +++ b/Bachelor/Mikroprozessorsysteme2/ARM202U/SOURCE/WIN32/ARMDBG/ARMDBG.H @@ -0,0 +1,1137 @@ +/* + * ARM symbolic debugger toolbox interface + * Copyright (C) 1992 Advanced Risc Machines Ltd. All rights reserved. + */ + +/* + * RCS $Revision: 1.62.2.8 $ + * Checkin $Date: 1995/06/09 15:38:00 $ + * Revising $Author: plg $ + */ + +/* Minor points of uncertainty are indicated by a question mark in the + LH margin. + + Wherever an interface is required to iterate over things of some class, + I prefer something of the form EnumerateXXs(..., XXProc *p, void *arg) + which results in a call of p(xx, arg) for each xx, rather than something + of the form + for (xxh = StartIterationOverXXs(); (xx = Next(xxh)) != 0; ) { ... } + EndIterationOverXXs(xxh); + Others may disagree. + (Each XXProc returns an Error value: if this is not Err_OK, iteration + stops immediately and the EnumerateXXs function returns that value). + + ptrace has been retired as of insufficient utility. If such fuctionality is + required, it can be constructed using breakpoints. + + The file form of all name fields in debug areas is in-line, with a length + byte and no terminator. The debugger toolbox makes an in-store translation, + where the strings are out of line (the namep variant in asdfmt.h) and have a + terminating zero byte: the pointer is to the first character of the string + with the length byte at ...->n.namep[-1]. + */ + +#ifndef armdbg__h +#define armdbg__h + +#include + +#include "asdfmt.h" +#include "host.h" +#include "ieeeflt.h" +#include "msg.h" + +typedef unsigned32 ARMaddress; +typedef unsigned32 ARMword; +typedef unsigned16 ARMhword; + +#include "dbg_conf.h" +#include "dbg_rdi.h" + +#ifdef __cplusplus +extern "C" +{ +#endif + +typedef unsigned char Dbg_Byte; + +typedef int Dbg_Error; + +typedef struct Dbg_MCState Dbg_MCState; +/* A representation of the state of the target. The structure is not revealed. + A pointer to one of these is returned by Dbg_Initialise(), is passed to all + toolbox calls which refer to the state of the target, and is discarded + by Dbg_Finalise(). + Nothing in the toolbox itself precludes there being multiple targets, each + with its own state. + */ + +/* Most toolbox interfaces return an error status. Only a few of the status + values are expected to be interesting to clients and defined here; the + rest are private (but a textual form can be produced by ErrorToChars()). + */ + +#define Error_OK 0 + +/* Partitioning of the error code space: errors below Dbg_Error_Base are RDI + errors (as defined in dbg_rdi.h). Codes above Dbg_Error_Limit are + available to clients, who may impose some further structure. + */ +#define Dbg_Error_Base 0x1000 +#define Dbg_Error_Limit 0x2000 + +#define DbgError(n) ((Dbg_Error)(Dbg_Error_Base+(n))) + +#define Dbg_Err_OK Error_OK +#define Dbg_Err_Interrupted (DbgError(1)) +#define Dbg_Err_Overflow (DbgError(2)) +#define Dbg_Err_FileNotFound (DbgError(3)) +#define Dbg_Err_ActivationNotPresent (DbgError(4)) +#define Dbg_Err_OutOfHeap (DbgError(5)) +#define Dbg_Err_TypeNotSimple (DbgError(6)) +#define Dbg_Err_BufferFull (DbgError(7)) +#define Dbg_Err_AtStackBase (DbgError(8)) +#define Dbg_Err_AtStackTop (DbgError(9)) +#define Dbg_Err_DbgTableFormat (DbgError(10)) +#define Dbg_Err_NotVariable (DbgError(11)) +#define Dbg_Err_NoSuchBreakPoint (DbgError(12)) +#define Dbg_Err_NoSuchWatchPoint (DbgError(13)) +#define Dbg_Err_FileLineNotFound (DbgError(14)) +#define Dbg_Err_DbgTableVersion (DbgError(15)) +#define Dbg_Err_NoSuchPath (DbgError(16)) +#define Dbg_Err_StateChanged (DbgError(17)) +#define Dbg_Err_SoftInitialiseError (DbgError(18)) +#define Dbg_Err_CoProRegNotWritable (DbgError(19)) +#define Dbg_Err_NotInHistory (DbgError(20)) + + /* functions which evaluate expressions may return this value, to indicate + that execution became suspended within a function called in the debugee */ + +/* Functions returning characters take a BufDesc argument, with fields buffer + and bufsize being input arguments describing the buffer to be filled, and + filled being set on return to the number of bytes written to the buffer + (omitting the terminating 0). + */ + +typedef struct Dbg_BufDesc Dbg_BufDesc; + +typedef void Dbg_BufferFullProc(Dbg_BufDesc *bd); + +struct Dbg_BufDesc { + char *buffer; + size_t size, + filled; + Dbg_BufferFullProc *p; + void *arg; +}; + +#define Dbg_InitBufDesc(bd, buf, bytes) \ + ((bd).buffer = (buf), (bd).size = (bytes), (bd).filled = 0,\ + (bd).p = NULL, (bd).arg = NULL) + +#define Dbg_InitBufDesc_P(bd, buf, bytes, fn, a) \ + ((bd).buffer = (buf), (bd).size = (bytes), (bd).filled = 0,\ + (bd).p = (fn), (bd).arg = (a)) + +Dbg_Error Dbg_StringToBuf(Dbg_BufDesc *buf, char const *s); +Dbg_Error Dbg_BufPrintf(Dbg_BufDesc *buf, char const *form, ...); +#ifdef NLS +Dbg_Error Dbg_MsgToBuf(Dbg_BufDesc *buf, msg_t t); +Dbg_Error Dbg_BufMsgPrintf(Dbg_BufDesc *buf, msg_t form, ...); +#else +#define Dbg_MsgToBuf Dbg_StringToBuf +#define Dbg_BufMsgPrintf Dbg_BufPrintf +#endif +Dbg_Error Dbg_CharToBuf(Dbg_BufDesc *buf, int ch); + +int Dbg_CIStrCmp(char const *s1, char const *s2); +/* Case-independent string comparison, interface as for strcmp */ + +void Dbg_ErrorToChars(Dbg_MCState *state, Dbg_Error err, Dbg_BufDesc *buf); + +typedef int Dbg_RDIResetCheckProc(int); +/* Type of a function to be called after each RDI operation performed by the + toolbox, with the status from the operation as argument. The value returned + is treated as the status. (The intent is to allow the toolbox's client to + take special action to handle RDIDbg_Error_Reset). + */ + +typedef struct Dbg_CoProDesc Dbg_CoProDesc; + +typedef Dbg_Error Dbg_CoProFoundProc(Dbg_MCState *state, int cpno, Dbg_CoProDesc const *cpd); +/* Type of a function to be called when the shape of a coprocessor is discovered + by enquiry of the target or agent (via RequestCoProDesc) + */ + +typedef struct RDIProcVec RDIProcVec; + +Dbg_Error Dbg_Initialise( + Dbg_ConfigBlock *config, Dbg_HostosInterface const *i, + Dbg_RDIResetCheckProc *checkreset, Dbg_CoProFoundProc *coprofound, + RDIProcVec const *rdi, Dbg_MCState **statep); +/* values in config are updated if they call for default values */ + +void Dbg_Finalise(Dbg_MCState *state); + +typedef struct { + char name[16]; + RDI_MemDescr md; + RDI_MemAccessStats a; +} Dbg_MemStats; + +/*--------------------------------------------------------------------------*/ + +/* Symbol table management. + The structure of a Dbg_SymTable is not revealed. It is created by + Dbg_ReadSymbols() or by Dbg_LoadFile(), and associated with the argument + Dbg_MCState. + Many symbol tables may be concurrently active. + A Dbg_SymTable is removed either explicitly (by call to Dbg_DeleteSymbols) + or implicitly when a symbol table for an overlapping address range is read. + + There is a pre-defined symbol table containing entries for ARM registers, + co-processor registers and the like. + */ + +typedef struct Dbg_SymTable Dbg_SymTable; + +typedef struct Dbg_ImageFragmentDesc { + ARMaddress base, limit; +} Dbg_ImageFragmentDesc; + +typedef struct Dbg_ImageDesc { + int lang; + int executable; + ARMaddress robase, rolimit, rwbase, rwlimit; + int nfrags; + Dbg_ImageFragmentDesc *fragments; +} Dbg_ImageDesc; + +Dbg_ImageDesc *Dbg_ImageAreas(Dbg_SymTable *st); + +Dbg_SymTable *Dbg_NewSymTable(Dbg_MCState *state, const char *name); + +Dbg_Error Dbg_ReadSymbols(Dbg_MCState *state, const char *filename, Dbg_SymTable **st); +/* Just read the symbols from the named image. is set to the allocated + symbol table. +? Maybe we could usefully allow other formats than AIF images to describe + the symbols (eg) of shared libraries + */ + +typedef struct Dbg_SymInfo { + int isize; + ARMaddress addr; + char *name; +} Dbg_SymInfo; + +Dbg_SymInfo *Dbg_AsmSym(Dbg_SymTable *st, ARMaddress addr); +int32 Dbg_AsmAddr(Dbg_SymTable *st, int32 line); +int32 Dbg_AsmLine(Dbg_SymTable *st, ARMaddress addr); +int32 Dbg_AsmLinesInRange(Dbg_SymTable *st, ARMaddress start, ARMaddress end); + +Dbg_Error Dbg_LoadFile(Dbg_MCState *state, const char *filename, Dbg_SymTable **st); +/* load the image into target memory, and read its symbols. is set to + the allocated symbol table. + A null filename reloads the most recently loaded file (and rereads its + symbols). + Loading an image leaves breakpoints unchanged. If a client wishes + otherwise, it must remove the breakpoints explicitly. +*/ + +Dbg_Error Dbg_CallGLoadFile(Dbg_MCState *state, const char *filename, Dbg_SymTable **st); + +Dbg_Error Dbg_LoadAgent(Dbg_MCState *state, const char *filename); +/* Load a debug agent, and start it. + Symbols in the image for the agent are ignored. +*/ + +Dbg_Error Dbg_RelocateSymbols(Dbg_SymTable *st, ARMaddress reloc); +/* add to the value of all symbols in describing absolute memory + locations. The intent is to allow the symbols in a load-time relocating + image (for example) to be useful. + */ + +Dbg_Error Dbg_DeleteSymbols(Dbg_MCState *state, Dbg_SymTable **st); + +typedef enum Dbg_LLSymType { + llst_code, + llst_code16, + llst_data, + llst_const +} Dbg_LLSymType; +/* Since AIF images contain no type information for low-level symbols, this + classification is only a guess, and some symbols describing constants will + incorrectly be described as code or data. + */ + +typedef Dbg_Error Dbg_SymProc( + Dbg_MCState *state, + const char *symbol, Dbg_LLSymType symtype, ARMaddress value, + void *arg); + +Dbg_Error Dbg_EnumerateLowLevelSymbols( + Dbg_MCState *state, const char *match, Dbg_SymProc *p, + void *arg); +/* Call p(name, value) for each low level symbol in the tables of + whose name matches the regular expression (a NULL matches + any name). Symbols are enumerated in no particular order. + */ + +/*--------------------------------------------------------------------------*/ + +/* Functions are provided here to allow quick mass access to register values + for display. There is no comparable need for quick mass update, so writing + should be via Assign(). + */ + +typedef struct Dbg_RegSet { + ARMword + user[15], + pc, + psr, + fiq[7], + spsr_fiq, + irq[2], + spsr_irq, + svc[2], + spsr_svc, + abort[2], + spsr_abort, + undef[2], + spsr_undef; +} Dbg_RegSet; + +/* bits in the modemask argument for ReadRegisters */ + +#define Dbg_MM_User 1 +#define Dbg_MM_FIQ 2 +#define Dbg_MM_IRQ 4 +#define Dbg_MM_SVC 8 +#define Dbg_MM_Abort 0x10 +#define Dbg_MM_Undef 0x20 +#define Dbg_MM_System 0x40 + +Dbg_Error Dbg_ReadRegisters(Dbg_MCState *state, Dbg_RegSet *regs, int modemask); + +Dbg_Error Dbg_WriteRegister(Dbg_MCState *state, int rno, int modemask, ARMword val); + +int Dbg_StringToMode(const char *name); + +int Dbg_ModeToModeMask(ARMword mode); + +/* Some implementations of the FP instruction set keep FP values loaded into + registers in their unconverted format, converting only when necessary. + Some RDI implementations deliver these values uninterpreted. + (For the rest, register values will always have type F_Extended). + */ + +typedef enum { F_Single, F_Double, F_Extended, F_Packed, /* fpe340 values */ + F_Internal, /* new fpe : mostly as extended */ + F_None } Dbg_FPType; + +typedef struct { ARMword w[3]; } Dbg_TargetExtendedVal; +typedef struct { ARMword w[3]; } Dbg_TargetPackedVal; +typedef struct { ARMword w[2]; } Dbg_TargetDoubleVal; +typedef struct { ARMword w[1]; } Dbg_TargetFloatVal; + +typedef union { Dbg_TargetExtendedVal e; Dbg_TargetPackedVal p; + Dbg_TargetDoubleVal d; Dbg_TargetFloatVal f; } Dbg_TargetFPVal; + +#define TargetSizeof_Extended 12 +#define TargetSizeof_Packed 12 +#define TargetSizeof_Double 8 +#define TargetSizeof_Float 4 + +typedef struct Dbg_FPRegVal { + Dbg_FPType type; + Dbg_TargetFPVal v; +} Dbg_FPRegVal; + +typedef struct Dbg_FPRegSet { + Dbg_FPRegVal f[8]; + ARMword fpsr, fpcr; +} Dbg_FPRegSet; + +Dbg_Error Dbg_ReadFPRegisters(Dbg_MCState *state, Dbg_FPRegSet *regs); + +Dbg_Error Dbg_WriteFPRegisters(Dbg_MCState *state, int32 mask, Dbg_FPRegSet *regs); + +Dbg_Error Dbg_FPRegToDouble(DbleBin *d, Dbg_FPRegVal const *f); +/* Converts from a FP register value (in any format) to a double with + approximately the same value (or returns Dbg_Err_Overflow) + */ + +void Dbg_DoubleToFPReg(Dbg_FPRegVal *f, DbleBin const *d); +/* Converts the double to a Dbg_FPRegVal with type F_Extended */ + +/*--------------------------------------------------------------------------*/ + +#include "dbg_cp.h" + +Dbg_Error Dbg_DescribeCoPro(Dbg_MCState *state, int cpnum, Dbg_CoProDesc *p); + +Dbg_Error Dbg_DescribeCoPro_RDI(Dbg_MCState *state, int cpnum, Dbg_CoProDesc *p); + +Dbg_Error Dbg_ReadCPRegisters(Dbg_MCState *state, int cpnum, ARMword *regs); + +Dbg_Error Dbg_WriteCPRegisters(Dbg_MCState *state, int cpnum, int32 mask, ARMword *regs); + +/*--------------------------------------------------------------------------*/ + +Dbg_Error Dbg_ReadWords( + Dbg_MCState *state, + ARMword *words, ARMaddress addr, unsigned count); +/* Reads a number of (32-bit) words from target store. The values are in host + byte order; if they are also to be interpreted as bytes Dbg_SwapByteOrder() + must be called to convert to target byte order. + */ + +Dbg_Error Dbg_WriteWords( + Dbg_MCState *state, + ARMaddress addr, const ARMword *words, unsigned count); +/* Writes a number of (32-bit) words to target store. The values are in host + byte order (if what is being written is actually a byte string it must be + converted by Dbg_SwapByteOrder()). + */ + +Dbg_Error Dbg_ReadHalf(Dbg_MCState *state, ARMhword *val, ARMaddress addr); +Dbg_Error Dbg_WriteHalf(Dbg_MCState *state, ARMaddress addr, ARMword val); + +Dbg_Error Dbg_ReadBytes(Dbg_MCState *state, Dbg_Byte *val, ARMaddress addr, unsigned count); +Dbg_Error Dbg_WriteBytes(Dbg_MCState *state, ARMaddress addr, const Dbg_Byte *val, unsigned count); + +void Dbg_HostWords(Dbg_MCState *state, ARMword *words, unsigned wordcount); +/* (A noop unless host and target bytesexes differ) */ + +ARMword Dbg_HostWord(Dbg_MCState *state, ARMword v); + +ARMhword Dbg_HostHalf(Dbg_MCState *state, ARMword v); + +/*--------------------------------------------------------------------------*/ + +/* Types describing various aspects of position within code. + There are rather a lot of these, in the interests of describing precisely + what fields must be present (rather than having a single type with many + fields which may or may not be valid according to context). + */ + +typedef struct Dbg_LLPos { + Dbg_SymTable *st; + char *llsym; + ARMaddress offset; +} Dbg_LLPos; + +typedef struct Dbg_File { + Dbg_SymTable *st; + char *file; +} Dbg_File; + +typedef struct Dbg_Line { + unsigned32 line; /* linenumber in the file */ + unsigned16 statement, /* within the line (1-based) */ + charpos; /* ditto */ +} Dbg_Line; +/* As an output value from toolbox functions, both statement and charpos are set + if the version of the debugger tables for the section concerned permits. + On input, is used only if is 0 (in which case, if + is non-0, Dbg_Err_DbgTableVersion is returned if the version of + the debugger tables concerned is too early. + */ + +typedef struct Dbg_FilePos { + Dbg_File f; + Dbg_Line line; +} Dbg_FilePos; + +typedef struct Dbg_ProcDesc { + Dbg_File f; + char *name; +} Dbg_ProcDesc; + +typedef struct Dbg_ProcPos { + Dbg_ProcDesc p; + Dbg_Line line; +} Dbg_ProcPos; + +/* Support for conversions between position representations */ + +Dbg_Error Dbg_ProcDescToLine(Dbg_MCState *state, Dbg_ProcDesc *proc, Dbg_Line *line); +/* If proc->f.file is null (and there is just one function proc->name), it is + updated to point to the name of the file containing (the start of) + proc->name. + */ + +Dbg_Error Dbg_FilePosToProc(Dbg_MCState *state, const Dbg_FilePos *pos, char **procname); + +/* Conversions from position representations to and from code addresses */ + +Dbg_Error Dbg_AddressToProcPos( + Dbg_MCState *state, ARMaddress addr, + Dbg_ProcPos *pos); +Dbg_Error Dbg_AddressToLLPos( + Dbg_MCState *state, ARMaddress addr, + Dbg_LLPos *pos, Dbg_LLSymType *res_type, int system_names); + +Dbg_Error Dbg_ProcPosToAddress( + Dbg_MCState *state, const Dbg_ProcPos *pos, + ARMaddress *res); +Dbg_Error Dbg_LLPosToAddress( + Dbg_MCState *state, const Dbg_LLPos *pos, + ARMaddress *res); + +typedef struct { + ARMaddress start, end; +} Dbg_AddressRange; + +Dbg_Error Dbg_FileRangeToAddressRange( + Dbg_SymTable *st, const char *f, int32 first, int32 last, Dbg_AddressRange *res); + +typedef struct Dbg_Environment Dbg_Environment; +/* A Dbg_Environment describes the context required to make sense of a variable + name and access its value. Its format is not revealed. Dbg_Environment + values are allocated by Dbg_NewEnvironment() and discarded by + Dbg_DeleteEnvironment(). + */ + +Dbg_Environment *Dbg_NewEnvironment(Dbg_MCState *state); +void Dbg_DeleteEnvironment(Dbg_MCState *state, Dbg_Environment *env); + +Dbg_Error Dbg_StringToEnv( + Dbg_MCState *state, char *str, Dbg_Environment *resenv, + int forcontext, Dbg_Environment const *curenv); + +Dbg_Error Dbg_ProcPosToEnvironment( + Dbg_MCState *state, const Dbg_ProcPos *pos, int activation, + const Dbg_Environment *current, Dbg_Environment *res); + +/* Conversion from a position representation to an Dbg_Environment (as required + to access variable values). Only a Dbg_ProcPos argument here; other + representations need to be converted first. + + Returns describing the th instance of the function + described by , up from the stack base if is negative, + else down from . + If this function returns Dbg_Err_ActivationNotPresent, the result + Dbg_Environment is still valid for accessing non-auto variables. + */ + +typedef struct Dbg_DeclSpec Dbg_DeclSpec; + +Dbg_Error Dbg_EnvToProcItem( + Dbg_MCState *state, Dbg_Environment const *env, Dbg_DeclSpec *proc); + +Dbg_Error Dbg_ContainingEnvironment( + Dbg_MCState *state, const Dbg_Environment *context, Dbg_Environment *res); +/* Set to describe the containing function, file if is within + a top-level function (or error if already describes a file). + */ + +/*--------------------------------------------------------------------------*/ + +/* ASD debug table pointers are not by themselves sufficient description, + since there's an implied section context. Hence the DeclSpec and TypeSpec + structures. + */ + +struct Dbg_DeclSpec { + ItemSection *section; + union { + ItemVar *var; + ItemType *type; + ItemProc *proc; + } item; +}; + +typedef struct Dbg_TypeSpec { + ItemSection *section; + asd_Type type; +} Dbg_TypeSpec; + +typedef Dbg_Error Dbg_FileProc(Dbg_MCState *state, const char *name, const Dbg_DeclSpec *procdef, void *arg); + +Dbg_Error Dbg_EnumerateFiles(Dbg_MCState *state, Dbg_SymTable *st, Dbg_FileProc *p, void *arg); +/* The top level for a high level enumerate. Lower levels are performed by + EnumerateDeclarations (below). + */ + +typedef struct Dbg_DComplex { DbleBin r, i; } Dbg_DComplex; + +typedef union Dbg_ConstantVal { + int32 l; + unsigned32 u; + DbleBin d; + Dbg_DComplex fc; + ARMaddress a; + char *s; +} Dbg_ConstantVal; + +typedef struct Dbg_Constant { + asd_Type typecode; /* not a Dbg_TypeSpec since only primitive types are + possible here */ + Dbg_ConstantVal val; +} Dbg_Constant; + +typedef enum Dbg_ValueSort { + vs_register, + vs_store, + vs_constant, + vs_local, + vs_filtered, + vs_none, + vs_error +} Dbg_ValueSort; + +/* vs_local allows the use of symbol table entries to describe entities within + the debugger's own address space, accessed in the same way as target + variables. + vs_filtered describes entities which may be read or written only via an + access function (eg r15) + */ + +#define fpr_base 16 +/* There's only one register ValueSort (reflecting asd table StgClass); + fp register n is encoded as register n+fpr_base. + */ + +typedef struct Dbg_Value Dbg_Value; + +typedef Dbg_Error Dbg_AccessFn(Dbg_MCState *state, int write, Dbg_Value *self, Dbg_Constant *c); +/* == 0: read a vs_filtered value, updating the value self. + == 1: update a vs_filtered value, with the value described by c. + allows use of the same Dbg_AccessFn for several different entities + (using different val.f.id fields). + */ + +typedef Dbg_Error Dbg_FormatFn(int decode, char *b, ARMword *valp, void *formatarg); + +typedef struct { Dbg_AccessFn *f; int id; } Dbg_AccessFnRec; + +typedef Dbg_Error Dbg_ValueChangedFn(Dbg_MCState *state, Dbg_Value const *val, void *arg); + +typedef struct { Dbg_ValueChangedFn *f; void *arg; } Dbg_ValueChangedFnRec; + +struct Dbg_Value { + Dbg_TypeSpec type; + Dbg_ValueSort sort; + Dbg_FormatFn *formatp; + void *formatarg; + Dbg_ValueChangedFnRec const *valuechanged; + int f77csize; + union { + struct { int no; ARMaddress frame; } r; + ARMaddress ptr; + Dbg_ConstantVal c; + void *localp; + Dbg_AccessFnRec f; + Dbg_Error err; + } val; +}; + +Dbg_Error Dbg_AddLLSymbol(Dbg_SymTable *st, char const *name, Dbg_LLSymType type, ARMword val); + +Dbg_Error Dbg_AddSymbol(Dbg_SymTable *st, char const *name, Dbg_Value const *val); + +Dbg_Error Dbg_AttachValueChangedRec( + Dbg_MCState *state, char const *name, Dbg_Environment const *context, + Dbg_ValueChangedFnRec const *vc); + +typedef struct Dbg_DeclSpecF { + Dbg_DeclSpec decl; + Dbg_FormatFn *formatp; + void *formatarg; +} Dbg_DeclSpecF; + +typedef Dbg_Error Dbg_DeclProc(Dbg_MCState *state, const Dbg_Environment *context, + const Dbg_DeclSpecF *var, int decltype, int masked, + void *arg); + +Dbg_Error Dbg_EnumerateDeclarations(Dbg_MCState *state, const Dbg_Environment *context, + Dbg_DeclProc *p, void *arg); +/* call p once for every declaration local to the function described by + (or file if describes a place outside a function). + p's argument is true if the variable is not visible, thanks to + a declaration in an inner scope. decltype has one of the values + ITEMVAR, ITEMTYPE or ITEMFUNCTION. + */ + +Dbg_Error Dbg_ValueOfVar(Dbg_MCState *state, const Dbg_Environment *context, + const Dbg_DeclSpec *var, Dbg_Value *val); +/* Different from Dbg_EvalExpr() in that the thing being evaluated is described + by a Dbg_DeclSpec (which must be for a variable), rather than a string + needing to be decoded and associated with a symbol-table item. Intended to + be called from a Dbg_DeclProc called from Dbg_EnumerateDeclarations. + */ + +Dbg_Error Dbg_EvalExpr(Dbg_MCState *state, Dbg_Environment const *context, + char const *expr, int flags, Dbg_Value *val); + +Dbg_Error Dbg_EvalExpr_ep(Dbg_MCState *state, Dbg_Environment const *context, + char const *expr, char **exprend, int flags, Dbg_Value *val); + +/* Both Dbg_ValueOfVar and Dbg_EvalExpr mostly deliver a value still containing + an indirection (since it may be wanted as the lhs of an assignment) + */ + +void Dbg_RealLocation(Dbg_MCState *state, Dbg_Value *val); +/* If val describes a register, this may really be a register, or a place on + the stack where the register's value is saved. In the latter case, val + is altered to describe the save place. (In all others, it remains + unchanged). + */ + +Dbg_Error Dbg_DereferenceValue(Dbg_MCState *state, const Dbg_Value *value, Dbg_Constant *c); +/* This fails if describes a structure or array, returning + Dbg_Err_TypeNotSimple + */ + +typedef struct Dbg_Expr Dbg_Expr; +/* The result of parsing an expression in an environment: its structure is not + revealed. (Clients may wish to parse just once an expression which may be + evaluated often). In support of which, the following two functions partition + the work of Dbg_EvalExpr(). + */ + +#define Dbg_exfl_heap 1 /* allocate Expr on the heap (FreeExpr must then be + called to discard it). Otherwise, it goes in a + place overwritten by the next call to ParseExpr + or EvalExpr + */ +#define Dbg_exfl_needassign 2 +#define Dbg_exfl_lowlevel 4 + +int Dbg_SetInputRadix(Dbg_MCState *state, int radix); +char *Dbg_SetDefaultIntFormat(Dbg_MCState *state, char *format); + +Dbg_Error Dbg_ParseExpr( + Dbg_MCState *state, Dbg_Environment const *env, char *string, + char **end, Dbg_Expr **res, int flags); +/* Just parse the argument string, returning a pointer to a parsed expression + and a pointer to the first non-white space character in the input string + which is not part of the parsed expression. (If macro expansion has taken + place, the returned pointer will not be into the argument string at all, + rather into the expanded version of it). + */ + +Dbg_Error Dbg_ParseExprCheckEnd( + Dbg_MCState *state, Dbg_Environment const *env, char *string, + Dbg_Expr **res, int flags); +/* As Dbg_ParseExpr, but the parsed expression is required completely to fill + the argument string (apart possibly for trailing whitespace), and an error + is returned if it does not. + */ + +Dbg_Error Dbg_ParsedExprToValue( + Dbg_MCState *state, const Dbg_Environment *env, Dbg_Expr *expr, Dbg_Value *v); + +Dbg_Error Dbg_ReadDecl( + Dbg_MCState *state, Dbg_Environment const *env, char *string, + Dbg_TypeSpec *p, char **varp, int flags); +/* Read a variable declaration, returing a description of the type of the + variable to p, and a pointer to its name to varp. + */ + +void Dbg_FreeExpr(Dbg_Expr *expr); + +Dbg_Error Dbg_ExprToVar(const Dbg_Expr *expr, Dbg_DeclSpec *var, Dbg_Environment *env); + +Dbg_Error Dbg_Assign(Dbg_MCState *state, const Dbg_Value *lv, const Dbg_Value *rv); + +typedef enum Dbg_TypeSort { + ts_simple, + ts_union, + ts_struct, + ts_array +} Dbg_TypeSort; + +Dbg_TypeSort Dbg_TypeSortOfValue(Dbg_MCState *state, const Dbg_Value *val, int *fieldcount); + +Dbg_Error Dbg_TypeToChars(const Dbg_TypeSpec *var, Dbg_BufDesc *buf); + +Dbg_Error Dbg_TypeSize(Dbg_MCState *state, const Dbg_TypeSpec *type, int32 *res); + +typedef int Dbg_ValToChars_cb(Dbg_MCState *state, Dbg_Value *subval, const char *fieldname, + Dbg_BufDesc *buf, void *arg); + +Dbg_Error Dbg_ValToChars(Dbg_MCState *state, Dbg_Value *val, int base, + Dbg_ValToChars_cb *cb, void *arg, + const char *form, Dbg_BufDesc *buf); +/* + is used for (any size) integer values. + If is of an array or structure type, is called for each element, + with as its last parameter, and describing the space remaining + in . If returns 0, conversion ceases. + */ + +Dbg_Error Dbg_NthElement( + Dbg_MCState *state, + const Dbg_Value *val, unsigned32 n, char **fieldname, Dbg_Value *subval); + +typedef Dbg_Error Dbg_HistoryProc(void *, int, Dbg_Value *); + +Dbg_Error Dbg_RegisterHistoryProc(Dbg_MCState *state, Dbg_HistoryProc *p, void *arg); + +/*--------------------------------------------------------------------------*/ + +/* Control of target program execution. + Currently, only synchronous operation is provided. + Execution could possibly be asynchronous where the target is a seperate + processor, but is necessarily synchronous if the target is Armulator. + Unfortunately, this may require modification to the RDI implementation + if multitasking is required but the the host system provides it only + cooperatively, or if there is no system-provided way to generate SIGINT. + */ + +Dbg_Error Dbg_SetCommandline(Dbg_MCState *state, const char *args); +/* Set the argument string to the concatenation of the name of the most + recently loaded image and args. + */ + +typedef enum Dbg_ProgramState { + ps_notstarted, + /* Normal ways of stopping */ + ps_atbreak, ps_atwatch, ps_stepdone, + ps_interrupted, + ps_stopped, + /* abnormal (but unsurprising) ways of stopping */ + ps_lostwatch, + ps_branchthrough0, ps_undef, ps_caughtswi, ps_prefetch, + ps_abort, ps_addrexcept, ps_caughtirq, ps_caughtfiq, + ps_error, + /* only as a return value from Call() */ + ps_callfailed, ps_callreturned, + /* internal inconsistencies */ + ps_unknownbreak, + ps_unknown +} Dbg_ProgramState; + +Dbg_ProgramState Dbg_Call(Dbg_MCState *state, ARMaddress target, + int argcount, const ARMword *args); +Dbg_ProgramState Dbg_Call16(Dbg_MCState *state, ARMaddress target, + int argcount, const ARMword *args); +Dbg_ProgramState Dbg_CallNaturalSize(Dbg_MCState *state, ARMaddress target, + int argcount, const ARMword *args); +/* Call a function in the debuggee, address with integer + arguments (values in the array ). + Any Dbg_ProgramState value may be returned, not just ps_callreturned (the + called function may abort, hit breakpoints, or whatever). + */ + +int Dbg_IsCallLink(Dbg_MCState *state, ARMaddress pc); + +typedef struct { + ARMword intres; + Dbg_FPRegVal fpres; +} Dbg_CallResults; + +Dbg_CallResults *Dbg_GetCallResults(Dbg_MCState *state); + +#define Dbg_S_STATEMENTS 0 +#define Dbg_S_INSTRUCTIONS 1 +#define Dbg_S_STEPINTOPROCS 2 + +Dbg_Error Dbg_Step(Dbg_MCState *state, int32 stepcount, int stepby, Dbg_ProgramState *status); +/* is a combination of the Dbg_S_... values above */ + +Dbg_Error Dbg_StepOut(Dbg_MCState *state, Dbg_ProgramState *status); + +int Dbg_CanGo(Dbg_MCState *state); + +Dbg_Error Dbg_Go(Dbg_MCState *state, Dbg_ProgramState *status); + +Dbg_Error Dbg_Stop(Dbg_MCState *state); +/* Asynchronous Stop request, for call from SIGINT handler. On return to the + caller, the call of Dbg_Go, Dbg_Step or Dbg_Call which started execution + should return ps_interrupted. + */ + +Dbg_Error Dbg_SetReturn(Dbg_MCState *state, + const Dbg_Environment *context, const Dbg_Value *value); +/* Prepare continuation by returning from the function activation + described by . (Dbg_Go() or Dbg_Step() actually perform the + continuation). + */ + +Dbg_Error Dbg_SetExecution(Dbg_MCState *state, Dbg_Environment *context); +/* Set the pc in a high-level fashion */ + +Dbg_Error Dbg_ProgramStateToChars(Dbg_MCState *state, Dbg_ProgramState event, Dbg_BufDesc *buf); +/* This is guaranteed to give a completely accurate description of if + this was the value returned by the most recent call of Dbg_Go, Dbg_Step, + or Dbg_Call. + */ + +/*--------------------------------------------------------------------------*/ + +Dbg_Error Dbg_CurrentEnvironment(Dbg_MCState *state, Dbg_Environment *context); + +Dbg_Error Dbg_PrevFrame(Dbg_MCState *state, Dbg_Environment *context); +/* towards the base of the stack */ + +Dbg_Error Dbg_NextFrame(Dbg_MCState *state, Dbg_Environment *context); +/* away from the base of the stack */ + +typedef struct Dbg_AnyPos { + enum { pos_source, pos_ll, pos_none } postype; + ARMaddress pc; + union { + Dbg_ProcPos source; + Dbg_LLPos ll; + ARMaddress none; + } pos; +} Dbg_AnyPos; + +Dbg_Error Dbg_EnvironmentToPos(Dbg_MCState *state, const Dbg_Environment *context, Dbg_AnyPos *pos); +/* is set to a Dbg_ProcPos if these is one corresponding to + else a Dbg_LLPos if there is one. + */ + +/*--------------------------------------------------------------------------*/ + +/* Source file management. + Pretty vestigial. Handles source path (per loaded image), + and translates from line-number (as given in debugger tables) to character + position (as required to access files) + */ + +Dbg_Error Dbg_ClearPaths(Dbg_SymTable *st); +Dbg_Error Dbg_AddPath(Dbg_SymTable *st, const char *path); +Dbg_Error Dbg_DeletePath(Dbg_SymTable *st, const char *path); + +Dbg_Error Dbg_GetFileLine(Dbg_MCState *state, const Dbg_FilePos *pos, Dbg_BufDesc *buf); + +typedef struct Dbg_FileRec Dbg_FileRec; +typedef struct { + unsigned32 linecount; + Dbg_FileRec *handle; + Dbg_BufDesc *fullname; +} Dbg_FileDetails; + +Dbg_Error Dbg_GetFileDetails(Dbg_MCState *state, const Dbg_File *fname, Dbg_FileDetails *res); +Dbg_Error Dbg_FinishedWithFile(Dbg_MCState *state, Dbg_FileRec *handle); +Dbg_Error Dbg_FileLineLength(Dbg_MCState *state, Dbg_FileRec *handle, int32 lineno, int32 *len); +Dbg_Error Dbg_GetFileLine_fr(Dbg_MCState *state, Dbg_FileRec *handle, int32 lineno, Dbg_BufDesc *buf); + +/*--------------------------------------------------------------------------*/ + +/* disassembly */ + +/* + ? More exact control is wanted here, but that requires a more complicated + ? disass callback interface. + */ + +typedef const char *Dbg_SWI_Decode(Dbg_MCState *state, ARMword swino); + +Dbg_Error Dbg_InstructionAt(Dbg_MCState *state, ARMaddress addr, + int isize, ARMhword *inst, Dbg_SymTable *st, + Dbg_SWI_Decode *swi_name, Dbg_BufDesc *buf, int *length); +/* describes the form of disassembly wanted: 2 for 16-bit, 4 for 32-bit, + * 0 for 16- or 32-bit depending whether addr addresses 16- or 32-bit code. + * is a pointer to a pair of halfwords *in target byte order* + * Possibly only the first halfword will be consumed: the number of bytes used + * is returned via . + */ + +/*--------------------------------------------------------------------------*/ + +int Dbg_RDIOpen(Dbg_MCState *state, unsigned type); +int Dbg_RDIInfo(Dbg_MCState *state, unsigned type, ARMword *arg1, ARMword *arg2); + +/*--------------------------------------------------------------------------*/ + +typedef enum { + Dbg_Point_Toolbox, + Dbg_Point_RDI_Unknown, + Dbg_Point_RDI_SW, + Dbg_Point_RDI_HW +} Dbg_PointType; + +/* breakpoint management + Associated with a breakpoint there may be any of + a count + an expression + a function + the breakpoint is activated if + the expression evaluates to a non-zero value (or fails to evaluate). + && decrementing the count reaches zero (the count is then reset to its + initial value). + && the function, called with the breakpoint address as argument, returns + a non-zero value. +? (The order here may be open to debate. Note that the first two are in + the opposite order in armsd, but I think this order more rational) + */ + +typedef enum Dbg_BreakPosType { + bt_procpos, + bt_procexit, + bt_address +} Dbg_BreakPosType; + +typedef struct Dbg_BreakPos { + Dbg_BreakPosType sort; + union { + Dbg_ProcPos procpos; + Dbg_ProcDesc procexit; + ARMaddress address; + } loc; +} Dbg_BreakPos; + +typedef int Dbg_BPProc(Dbg_MCState *state, void *BPArg, Dbg_BreakPos *where); + +typedef struct Dbg_BreakStatus { + int index; + int initcount, countnow; + Dbg_BreakPos where; + char *expr; + Dbg_BPProc *p; void *p_arg; + int incomplete; + Dbg_PointType type; + ARMword hwresource; +} Dbg_BreakStatus; + +Dbg_Error Dbg_SetBreakPoint(Dbg_MCState *state, Dbg_BreakPos *where, + int count, + const char *expr, + Dbg_BPProc *p, void *arg); +Dbg_Error Dbg_SetBreakPoint16(Dbg_MCState *state, Dbg_BreakPos *where, + int count, + const char *expr, + Dbg_BPProc *p, void *arg); +Dbg_Error Dbg_SetBreakPointNaturalSize(Dbg_MCState *state, Dbg_BreakPos *where, + int count, + const char *expr, + Dbg_BPProc *p, void *arg); +/* Setting a breakpoint at the same address as a previous breakpoint + completely removes the previous one. + */ + +Dbg_Error Dbg_DeleteBreakPoint(Dbg_MCState *state, Dbg_BreakPos *where); + +Dbg_Error Dbg_SuspendBreakPoint(Dbg_MCState *state, Dbg_BreakPos *where); +/* Temporarily remove the break point (until Reinstated) but leave intact + its associated expr, the value its count has reached, etc. +? The debugger toolbox itself wants this, but I'm not sure what use a client + could have for it. Ditto Reinstate... + */ + +Dbg_Error Dbg_ReinstateBreakPoint(Dbg_MCState *state, Dbg_BreakPos *where); +/* Undo the effect of Dbg_SuspendBreakPoint + */ + +Dbg_Error Dbg_DeleteAllBreakPoints(Dbg_MCState *state); + +Dbg_Error Dbg_SuspendAllBreakPoints(Dbg_MCState *state); + +Dbg_Error Dbg_ReinstateAllBreakPoints(Dbg_MCState *state); + +typedef Dbg_Error Dbg_BPEnumProc(Dbg_MCState *state, Dbg_BreakStatus *status, void *arg); + +Dbg_Error Dbg_EnumerateBreakPoints(Dbg_MCState *state, Dbg_BPEnumProc *p, void *arg); + +Dbg_Error Dbg_BreakPointStatus(Dbg_MCState *state, + const Dbg_BreakPos *where, Dbg_BreakStatus *status); + +/*--------------------------------------------------------------------------*/ + +typedef struct { + Dbg_Value val; + char *name; +} Dbg_WatchPos; + +typedef int Dbg_WPProc(Dbg_MCState *state, void *WPArg, Dbg_WatchPos *where); + +typedef struct Dbg_WPStatus { + int index; + int initcount, countnow; + Dbg_WatchPos what, target; + char *expr; + Dbg_WPProc *p; void *p_arg; + Dbg_PointType type; + ARMword hwresource; + int skip; +} Dbg_WPStatus; + +Dbg_Error Dbg_SetWatchPoint( + Dbg_MCState *state, Dbg_Environment *context, char const *watchee, + char const *target, + int count, + char const *expr, + Dbg_WPProc *p, void *arg); + +/* Cause a watchpoint event if the value of changes to the value of + (or changes at all if is NULL). should + evaluate either to an L-value (when the size of the object being watched is + determined by its type) or to an integer constant (when the word with this + address is watched). + */ + +Dbg_Error Dbg_DeleteWatchPoint(Dbg_MCState *state, Dbg_Environment *context, char const *watchee); + + +Dbg_Error Dbg_SetWatchPoint_V( + Dbg_MCState *state, + char const *name, Dbg_Value const *val, char const *tname, Dbg_Value const *tval, + int count, + char const *expr, + Dbg_WPProc *p, void *arg); + +Dbg_Error Dbg_DeleteWatchPoint_V(Dbg_MCState *state, Dbg_Value const *val); + + +Dbg_Error Dbg_DeleteAllWatchPoints(Dbg_MCState *state); + +typedef Dbg_Error Dbg_WPEnumProc(Dbg_MCState *state, Dbg_WPStatus const *watchee, void *arg); + +Dbg_Error Dbg_EnumerateWatchPoints(Dbg_MCState *state, Dbg_WPEnumProc *p, void *arg); + +Dbg_Error Dbg_WatchPointStatus(Dbg_MCState *state, + Dbg_WatchPos const *where, Dbg_WPStatus *status); + +typedef void Dbg_WPRemovedProc(void *arg, Dbg_WPStatus const *wp); +Dbg_Error Dbg_RegisterWPRemovalProc(Dbg_MCState *state, Dbg_WPRemovedProc *p, void *arg); +/* When a watchpoint goes out of scope it is removed by the toolbox, and the + function registered here gets called back to adjust its view + */ + +/*--------------------------------------------------------------------------*/ + +Dbg_Error Dbg_ProfileLoad(Dbg_MCState *state); + +Dbg_Error Dbg_ProfileStart(Dbg_MCState *state, ARMword interval); +Dbg_Error Dbg_ProfileStop(Dbg_MCState *state); + +Dbg_Error Dbg_ProfileClear(Dbg_MCState *state); + +Dbg_Error Dbg_WriteProfile(Dbg_MCState *state, char const *filename, + char const *toolid, char const *arg); + +/*--------------------------------------------------------------------------*/ + +Dbg_Error Dbg_ConnectChannel_ToHost(Dbg_MCState *state, RDICCProc_ToHost *p, void *arg); +Dbg_Error Dbg_ConnectChannel_FromHost(Dbg_MCState *state, RDICCProc_FromHost *p, void *arg); + +/*--------------------------------------------------------------------------*/ + +/* Configuration data management */ + +Dbg_Error Dbg_LoadConfigData(Dbg_MCState *state, char const *filename); + +Dbg_Error Dbg_SelectConfig( + Dbg_MCState *state, + RDI_ConfigAspect aspect, char const *name, RDI_ConfigMatchType matchtype, + unsigned versionreq, unsigned *versionp); + +Dbg_Error Dbg_ParseConfigVersion( + char const *s, RDI_ConfigMatchType *matchp, unsigned *versionp); + +typedef Dbg_Error Dbg_ConfigEnumProc(Dbg_MCState *state, RDI_ConfigDesc const *desc, void *arg); + +Dbg_Error Dbg_EnumerateConfigs(Dbg_MCState *state, Dbg_ConfigEnumProc *p, void *arg); + +#ifdef __cplusplus +} +#endif + +#endif + \ No newline at end of file diff --git a/Bachelor/Mikroprozessorsysteme2/ARM202U/SOURCE/WIN32/ARMDBG/DBG_CONF.H b/Bachelor/Mikroprozessorsysteme2/ARM202U/SOURCE/WIN32/ARMDBG/DBG_CONF.H new file mode 100644 index 0000000..912ce94 --- /dev/null +++ b/Bachelor/Mikroprozessorsysteme2/ARM202U/SOURCE/WIN32/ARMDBG/DBG_CONF.H @@ -0,0 +1,47 @@ +/* + * ARM symbolic debugger toolbox: dbg_conf.h + * Copyright (C) 1992 Advanced Risc Machines Ltd. All rights reserved. + */ + +/* + * RCS $Revision: 1.11 $ + * Checkin $Date: 1995/04/06 14:09:05 $ + * Revising $Author: mwilliam $ + */ + +#ifndef Dbg_Conf__h + +#define Dbg_Conf__h + +typedef struct Dbg_ConfigBlock { + int bytesex; + int fpe; /* Target should initialise FPE */ + long memorysize; + unsigned long cpu_speed;/* Cpu speed (HZ) */ + int serialport; /*) remote connection parameters */ + int seriallinespeed; /*) (serial connection) */ + int parallelport; /*) ditto */ + int parallellinespeed; /*) (parallel connection) */ + int processor; /* processor the armulator is to emulate (eg ARM60) */ + int rditype; /* armulator / remote processor */ + int drivertype; /* parallel / serial / etc */ + char const *configtoload; + char const *memconfigtoload; + int flags; +} Dbg_ConfigBlock; + +#define Dbg_ConfigFlag_Reset 1 +#define Dbg_ConfigFlag_LLSymsNeedPrefix 2 + +typedef struct Dbg_HostosInterface Dbg_HostosInterface; +/* This structure allows access by the (host-independent) C-library support + module of armulator or pisd (armos.c) to host-dependent functions for + which there is no host-independent interface. Its contents are unknown + to the debugger toolbox. + The assumption is that, in a windowed system, fputc(stderr) for example + may not achieve the desired effect of the character appearing in some + window. + */ + +#endif + \ No newline at end of file diff --git a/Bachelor/Mikroprozessorsysteme2/ARM202U/SOURCE/WIN32/ARMDBG/DBG_CP.H b/Bachelor/Mikroprozessorsysteme2/ARM202U/SOURCE/WIN32/ARMDBG/DBG_CP.H new file mode 100644 index 0000000..777a269 --- /dev/null +++ b/Bachelor/Mikroprozessorsysteme2/ARM202U/SOURCE/WIN32/ARMDBG/DBG_CP.H @@ -0,0 +1,57 @@ +/* + * ARM symbolic debugger toolbox: dbg_cp.h + * Copyright (C) 1992 Advanced Risc Machines Ltd. All rights reserved. + */ + +/* + * RCS $Revision: 1.4 $ + * Checkin $Date: 1994/09/01 10:42:16 $ + * Revising $Author: hmeekings $ + */ + +#ifndef Dbg_CP__h + +#define Dbg_CP__h + +#define Dbg_Access_Readable 1 +#define Dbg_Access_Writable 2 +#define Dbg_Access_CPDT 4 /* else CPRT */ + +typedef struct { + unsigned short rmin, rmax; + /* a single description can be used for a range of registers with + the same properties *accessed via CPDT instructions* + */ + unsigned char nbytes; /* size of register */ + unsigned char access; /* see above (Access_xxx) */ + union { + struct { /* CPDT instructions do not allow the coprocessor much freedom: + only bit 22 ('N') and 12-15 ('CRd') are free for the + coprocessor to use as it sees fit. + */ + unsigned char nbit; + unsigned char rdbits; + } cpdt; + struct { /* CPRT instructions have much more latitude. The bits fixed + by the ARM are 24..31 (condition mask & opcode) + 20 (direction) + 8..15 (cpnum, arm register) + 4 (CPRT not CPDO) + leaving 14 bits free to the coprocessor (fortunately + falling within two bytes). + */ + unsigned char read_b0, read_b1, + write_b0, write_b1; + } cprt; + } accessinst; +} Dbg_CoProRegDesc; + +struct Dbg_CoProDesc { + int entries; + Dbg_CoProRegDesc regdesc[1/* really nentries */]; +}; + +#define Dbg_CoProDesc_Size(n) (sizeof(struct Dbg_CoProDesc) + ((n)-1)*sizeof(Dbg_CoProRegDesc)) + +#endif + \ No newline at end of file diff --git a/Bachelor/Mikroprozessorsysteme2/ARM202U/SOURCE/WIN32/ARMDBG/DBG_HIF.H b/Bachelor/Mikroprozessorsysteme2/ARM202U/SOURCE/WIN32/ARMDBG/DBG_HIF.H new file mode 100644 index 0000000..fef46d1 --- /dev/null +++ b/Bachelor/Mikroprozessorsysteme2/ARM202U/SOURCE/WIN32/ARMDBG/DBG_HIF.H @@ -0,0 +1,46 @@ +/* + * ARM debugger toolbox : dbg_hif.c + * Copyright (C) 1992 Advanced Risc Machines Ltd. All rights reserved. + * Description of the Dbg_HostosInterface structure. This is *NOT* + * part of the debugger toolbox, but it is required by 2 back ends + * (armul & pisd) and two front ends (armsd & wdbg), so putting it + * in the toolbox is the only way of avoiding multiple copies. + */ + +/* + * RCS $Revision: 1.3 $ + * Checkin $Date: 1993/10/22 17:41:07 $ + * Revising $Author: hmeekings $ + */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +typedef void Hif_DbgPrint(void *arg, const char *format, va_list ap); +typedef void Hif_DbgPause(void *arg); + +typedef void Hif_WriteC(void *arg, int c); +typedef int Hif_ReadC(void *arg); +typedef int Hif_Write(void *arg, char const *buffer, int len); +typedef char *Hif_GetS(void *arg, char *buffer, int len); + +typedef void Hif_RDIResetProc(void *arg); + +struct Dbg_HostosInterface { + Hif_DbgPrint *dbgprint; + Hif_DbgPause *dbgpause; + void *dbgarg; + + Hif_WriteC *writec; + Hif_ReadC *readc; + Hif_Write *write; + Hif_GetS *gets; + void *hostosarg; + + Hif_RDIResetProc *reset; + void *resetarg; +}; + \ No newline at end of file diff --git a/Bachelor/Mikroprozessorsysteme2/ARM202U/SOURCE/WIN32/ARMDBG/DBG_RDI.H b/Bachelor/Mikroprozessorsysteme2/ARM202U/SOURCE/WIN32/ARMDBG/DBG_RDI.H new file mode 100644 index 0000000..1611b0c --- /dev/null +++ b/Bachelor/Mikroprozessorsysteme2/ARM202U/SOURCE/WIN32/ARMDBG/DBG_RDI.H @@ -0,0 +1,614 @@ +/* + * ARM debugger toolbox : dbg_rdi.h + * Copyright (C) 1992 Advanced Risc Machines Ltd. All rights reserved. + */ + +/* + * RCS $Revision: 1.36.2.3 $ + * Checkin $Date: 1995/05/18 13:35:04 $ + * Revising $Author: plg $ + */ + +#ifndef dbg_rdi__h +#define dbg_rdi__h + +#include "dbg_stat.h" + +/***************************************************************************\ +* Error Codes * +\***************************************************************************/ + +#define RDIError_NoError 0 + +#define RDIError_Reset 1 +#define RDIError_UndefinedInstruction 2 +#define RDIError_SoftwareInterrupt 3 +#define RDIError_PrefetchAbort 4 +#define RDIError_DataAbort 5 +#define RDIError_AddressException 6 +#define RDIError_IRQ 7 +#define RDIError_FIQ 8 +#define RDIError_Error 9 +#define RDIError_BranchThrough0 10 + +#define RDIError_NotInitialised 128 +#define RDIError_UnableToInitialise 129 +#define RDIError_WrongByteSex 130 +#define RDIError_UnableToTerminate 131 +#define RDIError_BadInstruction 132 +#define RDIError_IllegalInstruction 133 +#define RDIError_BadCPUStateSetting 134 +#define RDIError_UnknownCoPro 135 +#define RDIError_UnknownCoProState 136 +#define RDIError_BadCoProState 137 +#define RDIError_BadPointType 138 +#define RDIError_UnimplementedType 139 +#define RDIError_BadPointSize 140 +#define RDIError_UnimplementedSize 141 +#define RDIError_NoMorePoints 142 +#define RDIError_BreakpointReached 143 +#define RDIError_WatchpointAccessed 144 +#define RDIError_NoSuchPoint 145 +#define RDIError_ProgramFinishedInStep 146 +#define RDIError_UserInterrupt 147 +#define RDIError_CantSetPoint 148 +#define RDIError_IncompatibleRDILevels 149 + +#define RDIError_CantLoadConfig 150 +#define RDIError_BadConfigData 151 +#define RDIError_NoSuchConfig 152 +#define RDIError_BufferFull 153 +#define RDIError_OutOfStore 154 +#define RDIError_NotInDownload 155 +#define RDIError_PointInUse 156 +#define RDIError_BadImageFormat 157 +#define RDIError_TargetRunning 158 +#define RDIError_DeviceWouldNotOpen 159 +#define RDIError_NoSuchHandle 160 +#define RDIError_ConflictingPoint 161 + +#define RDIError_LittleEndian 240 +#define RDIError_BigEndian 241 +#define RDIError_SoftInitialiseError 242 + +#define RDIError_InsufficientPrivilege 253 +#define RDIError_UnimplementedMessage 254 +#define RDIError_UndefinedMessage 255 + + +/***************************************************************************\ +* RDP Message Numbers * +\***************************************************************************/ + +/********* host -> agent *********/ + +#define RDP_Start (unsigned char)0x0 +/* byte type, word memorysize {, byte speed (if (type & 2)) } */ +/* returns byte status */ + +#define RDP_End (unsigned char)0x1 +/* no argument */ +/* returns byte status */ + +#define RDP_Read (unsigned char)0x2 +/* word address, word nbytes */ +/* returns bytes data, byte status {, word count } */ +/* The count value is returned only if status != 0, and is the number */ +/* of bytes successfully read */ + +#define RDP_Write (unsigned char)0x3 +/* word address, word nbytes, bytes data */ +/* returns byte status {, word count } */ +/* The count value is returned only if status != 0, and is the number */ +/* of bytes successfully written */ + +#define RDP_CPUread (unsigned char)0x4 +/* byte mode, word mask */ +/* returns words data, byte status */ + +#define RDP_CPUwrite (unsigned char)0x5 +/* byte mode, word mask, words data */ +/* returns byte status */ + +#define RDP_CPread (unsigned char)0x6 +/* byte cpnum, word mask */ +/* returns words data, byte status */ + +#define RDP_CPwrite (unsigned char)0x7 +/* byte cpnum, word mask, words data */ +/* returns byte status */ + +#define RDP_SetBreak (unsigned char)0xa +/* word address, byte type {, word bound } */ +/* if !(type & RDIPoint_Inquiry) */ +/* returns {word pointhandle, } byte status */ +/* if (type & RDIPoint_Inquiry) */ +/* returns word address {, word bound }, byte status */ +/* pointhandle is present if type & RDIPoint_Handle */ +/* bound arguments and replies are present if */ +/* (type & 7) == RDIPoint_IN, RDIPoint_OUT or RDIPoint_MASK */ + +#define RDP_ClearBreak (unsigned char)0xb +/* word pointhandle */ +/* returns byte status */ + +#define RDP_SetWatch (unsigned char)0xc +/* word address, byte type, byte datatype {, word bound } */ +/* if !(type & RDIPoint_Inquiry) */ +/* returns {word pointhandle, } byte status */ +/* if (type & RDIPoint_Inquiry) */ +/* returns word address {, word bound }, byte status */ +/* pointhandle is present if type & RDIPoint_Handle */ +/* bound arguments and replies are present if */ +/* (type & 7) == RDIPoint_IN or RDIPoint_OUT */ + +#define RDP_ClearWatch (unsigned char)0xd +/* word pointhandle */ +/* returns byte status */ + +#define RDP_Execute (unsigned char)0x10 +/* byte type */ +/* returns {word pointhandle, } byte status */ +/* pointhandle is returned if (type & RDIPoint_Handle); type also has: */ +# define RDIExecute_Async 1 + +#define RDP_Step (unsigned char)0x11 +/* byte type, word stepcount */ +/* returns {word pointhandle, } byte status */ +/* (type as for RDP_Execute) */ + +#define RDP_Info (unsigned char)0x12 +/* argument and return type different for each operation: see below */ + +#define RDP_OSOpReply (unsigned char)0x13 + +#define RDP_AddConfig (unsigned char)0x14 +/* word nbytes */ +/* returns byte status */ + +#define RDP_LoadConfigData (unsigned char)0x15 +/* word nbytes, nbytes * bytes data */ +/* returns byte status */ + +#define RDP_SelectConfig (unsigned char)0x16 +/* byte aspect, byte namelen, byte matchtype, word version, */ +/* namelen * bytes name */ +/* returns word version selected, byte status */ + +#define RDP_LoadAgent (unsigned char)0x17 +/* word loadaddress, word size */ +/* followed by a number of messages: */ +/* byte = RDP_LoadConfigData, word size, size * bytes data */ +/* returns byte status */ + +#define RDP_Interrupt (unsigned char)0x18 + +#define RDP_CCToHostReply (unsigned char)0x19 +#define RDP_CCFromHostReply (unsigned char)0x1a + +/********* agent -> host *********/ + +#define RDP_Stopped (unsigned char)0x20 +/* reply to step or execute with RDIExecute_Async */ + +#define RDP_OSOp (unsigned char)0x21 +#define RDP_CCToHost (unsigned char)0x22 +#define RDP_CCFromHost (unsigned char)0x23 + +#define RDP_Fatal (unsigned char)0x5e +#define RDP_Return (unsigned char)0x5f +#define RDP_Reset (unsigned char)0x7f + +/***************************************************************************\ +* Other RDI values * +\***************************************************************************/ + +#define RDISex_Little 0 /* the byte sex of the debuggee */ +#define RDISex_Big 1 +#define RDISex_DontCare 2 + +#define RDIPoint_EQ 0 /* the different types of break/watchpoints */ +#define RDIPoint_GT 1 +#define RDIPoint_GE 2 +#define RDIPoint_LT 3 +#define RDIPoint_LE 4 +#define RDIPoint_IN 5 +#define RDIPoint_OUT 6 +#define RDIPoint_MASK 7 + +#define RDIPoint_16Bit 16 /* 16-bit breakpoint */ +#define RDIPoint_Conditional 32 + +/* ORRed with point type in extended RDP break and watch messages */ +#define RDIPoint_Inquiry 64 +#define RDIPoint_Handle 128 /* messages */ + +#define RDIWatch_ByteRead 1 /* types of data accesses to watch for*/ +#define RDIWatch_HalfRead 2 +#define RDIWatch_WordRead 4 +#define RDIWatch_ByteWrite 8 +#define RDIWatch_HalfWrite 16 +#define RDIWatch_WordWrite 32 + +#define RDIReg_R15 (1L << 15) /* mask values for CPU */ +#define RDIReg_PC (1L << 16) +#define RDIReg_CPSR (1L << 17) +#define RDIReg_SPSR (1L << 18) +#define RDINumCPURegs 19 + +#define RDINumCPRegs 10 /* current maximum */ + +#define RDIMode_Curr 255 + +/* RDI_Info subcodes */ +/* rdp in parameters are all preceded by */ +/* in byte = RDP_Info, word = info subcode */ +/* out parameters are all preceded by */ +/* out byte = RDP_Return */ + +#define RDIInfo_Target 0 +/* rdi: out ARMword *targetflags, out ARMword *processor id */ +/* rdp: in none, out word targetflags, word processorid, byte status */ +/* the following bits are defined in targetflags */ +# define RDITarget_LogSpeed 0x0f +# define RDITarget_HW 0x10 /* else emulator */ +# define RDITarget_AgentMaxLevel 0xe0 +# define RDITarget_AgentLevelShift 5 +# define RDITarget_DebuggerMinLevel 0x700 +# define RDITarget_DebuggerLevelShift 8 +# define RDITarget_CanReloadAgent 0x800 +# define RDITarget_CanInquireLoadSize 0x1000 +# define RDITarget_UnderstandsRDPInterrupt 0x2000 +# define RDITarget_CanProfile 0x4000 +# define RDITarget_Code16 0x8000 +# define RDITarget_HasCommsChannel 0x10000 + +#define RDIInfo_Points 1 +/* rdi: out ARMword *pointcapabilities */ +/* rdp: in none, out word pointcapabilities, byte status */ +/* the following bits are defined in pointcapabilities */ +# define RDIPointCapability_Comparison 1 +# define RDIPointCapability_Range 2 +/* 4 to 128 are RDIWatch_xx{Read,Write} left-shifted by two */ +# define RDIPointCapability_Mask 0x100 +# define RDIPointCapability_ThreadBreak 0x200 +# define RDIPointCapability_ThreadWatch 0x400 +# define RDIPointCapability_CondBreak 0x800 +# define RDIPointCapability_Status 0x1000 /* status enquiries available */ + +#define RDIInfo_Step 2 +/* rdi: out ARMword *stepcapabilities */ +/* rdp: in none, out word stepcapabilities, byte status */ +/* the following bits are defined in stepcapabilities */ +# define RDIStep_Multiple 1 +# define RDIStep_PCChange 2 +# define RDIStep_Single 4 + +#define RDIInfo_MMU 3 +/* rdi: out ARMword *mmuidentity */ +/* rdp: in none, out word mmuidentity, byte status */ + +#define RDIInfo_DownLoad 4 +/* Inquires whether configuration download and selection is available. */ +/* rdp: in none, out byte status */ +/* No argument, no return value. status == ok if available */ + +#define RDIInfo_SemiHosting 5 +/* Inquires whether RDISemiHosting_* RDI_Info calls are available. */ +/* rdp: in none, out byte status */ +/* No argument, no return value. status == ok if available */ + +#define RDIInfo_CoPro 6 +/* Inquires whether CoPro RDI_Info calls are available. */ +/* rdp: in none, out byte status */ +/* No argument, no return value. status == ok if available */ + +#define RDIInfo_Icebreaker 7 +/* Inquires whether debuggee controlled by IceBreaker. */ +/* rdp: in none, out byte status */ +/* No argument, no return value. status == ok if available */ + +#define RDIMemory_Access 8 +/* rdi: out RDI_MemAccessStats *p, in ARMword *handle */ +/* rdp: in word handle */ +/* out word nreads, word nwrites, word sreads, word swrites, */ +/* word ns, word s, byte status */ + +/* Get memory access information for memory block with specified handle */ + +#define RDIMemory_Map 9 +/* rdi: in RDI_MemDescr md[n], in ARMword *n */ +/* rdp: in word n, n * { */ +/* word handle, word start, word limit, */ +/* byte width, byte access */ +/* word Nread_ns, word Nwrite_ns, */ +/* word Sread_ns, word Swrite_ns} */ +/* out byte status */ +/* Sets memory characteristics. */ + +#define RDISet_CPUSpeed 10 +/* rdi: in ARMword *speed */ +/* rdp: in word speed, out byte status */ +/* Sets CPU speed (in ns) */ + +#define RDIRead_Clock 12 +/* rdi: out ARMword *ns, out ARMword *s */ +/* rdp: in none, out word ns, word s, byte status */ +/* Reads simulated time */ + +#define RDIInfo_Memory_Stats 13 +/* Inquires whether RDI_Info codes 8-12 are available */ +/* rdp: in none, out byte status */ +/* No argument, no return value. status == ok if available */ + +/* The next two are only to be used if RDIInfo_DownLoad returned no */ +/* error */ +#define RDIConfig_Count 14 +/* rdi: out ARMword *count */ +/* rdp: out byte status, word count (if status == OK) */ + +/* In addition, the next one is only to be used if RDIConfig_Count */ +/* returned no error */ +typedef struct { unsigned32 version; char name[32]; } RDI_ConfigDesc; +#define RDIConfig_Nth 15 +/* rdi: in ARMword *n, out RDI_ConfigDesc * */ +/* rdp: in word n */ +/* out word version, byte namelen, bytes * bytelen name, */ +/* byte status */ + +/* The next two are only to be used if the value returned by */ +/* RDIInfo_Points has RDIPointCapability_Status set. */ +#define RDIPointStatus_Watch 0x80 +#define RDIPointStatus_Break 0x81 +/* rdi: inout ARMword * (in handle, out hwresource), out ARMword *type */ +/* rdp: in word handle, out word hwresource, word type, byte status */ + +#define RDISignal_Stop 0x100 +/* Requests that the debuggee stop */ +/* No arguments, no return value */ +/* rdp: no reply (when the debuggee stops, there will be a reply to the */ +/* step or execute request which started it) */ + +#define RDIVector_Catch 0x180 +/* rdi: in ARMword *bitmap */ +/* rdp: int word bitmap, out byte status */ +/* bit i in bitmap set to cause vector i to cause entry to debugger */ + +/* The next four are only to be used if RDIInfo_Semihosting returned */ +/* no error */ +#define RDISemiHosting_SetState 0x181 +/* rdi: in ARMword *semihostingstate */ +/* rdp: in word semihostingstate, out byte status */ +#define RDISemiHosting_GetState 0x182 +/* rdi: out ARMword *semihostingstate */ +/* rdp: in none, out word semihostingstate, byte status */ +#define RDISemiHosting_SetVector 0x183 +/* rdi: in ARMword *semihostingvector */ +/* rdp: in word semihostingvector, out byte status */ +#define RDISemiHosting_GetVector 0x184 +/* rdi: out ARMword *semihostingvector */ +/* rdp: in none, out word semihostingvector, byte status */ + +/* The next two are only to be used if RDIInfo_Icebreaker returned */ +/* no error */ +#define RDIIcebreaker_GetLocks 0x185 +/* rdi: out ARMword *lockedstate */ +/* rdp: in none, out word lockedstate, byte status */ + +#define RDIIcebreaker_SetLocks 0x186 +/* rdi: in ARMword *lockedstate */ +/* rdp: in word lockedstate, out byte status */ + +/* lockedstate is a bitmap of the icebreaker registers locked against */ +/* use by IceMan (because explicitly written by the user) */ + +#define RDIInfo_GetLoadSize 0x187 +/* rdi: out ARMword *maxloadsize */ +/* rdp: in none, out word maxloadsize, byte status */ +/* Inquires the maximum length of data transfer the agent is prepared */ +/* to receive */ +/* Only usable if RDIInfo_Target returned RDITarget_CanInquireLoadSize */ +/* rdi: out ARMword *size */ + +/* Only to be used if the value returned by RDIInfo_Target had */ +/* RDITarget_HasCommsChannel set */ +typedef void RDICCProc_ToHost(void *arg, ARMword data); +typedef void RDICCProc_FromHost(void *arg, ARMword *data, int *valid); + +#define RDICommsChannel_ToHost 0x188 +/* rdi: in RDICCProc_ToHost *, in void *arg */ +/* rdp: in byte connect, out byte status */ +#define RDICommsChannel_FromHost 0x189 +/* rdi: in RDICCProc_FromHost *, in void *arg */ +/* rdp: in byte connect, out byte status */ + +#define RDICycles 0x200 +/* rdi: out ARMword cycles[12] */ +/* rdp: in none, out 6 words cycles, byte status */ +/* the rdi result represents 6 big-endian doublewords; the rdp results */ +/* return values for the ls halves of these */ +# define RDICycles_Size 48 + +#define RDIErrorP 0x201 +/* rdi: out ARMaddress *errorp */ +/* rdp: in none, out word errorp, byte status */ +/* Returns the error pointer associated with the last return from step */ +/* or execute with status RDIError_Error. */ + +#define RDISet_Cmdline 0x300 +/* rdi: in char *commandline (a null-terminated string) */ +/* No corresponding RDP operation (cmdline is sent to the agent in */ +/* response to SWI_GetEnv) */ + +#define RDISet_RDILevel 0x301 +/* rdi: in ARMword *level */ +/* rdp: in word level, out byte status */ +/* Sets the RDI/RDP protocol level to be used (must lie between the */ +/* limits returned by RDIInfo_Target). */ + +#define RDISet_Thread 0x302 +/* rdi: in ARMword *threadhandle */ +/* rdp: in word threadhandle, out byte status */ +/* Sets the thread context for subsequent thread-sensitive operations */ +/* (null value sets no thread) */ + +/* The next two are only to be used if RDIInfo_CoPro returned no error */ +#define RDIInfo_DescribeCoPro 0x400 +/* rdi: in int *cpno, Dbg_CoProDesc *cpd */ +/* rdp: in byte cpno, */ +/* cpd->entries * { */ +/* byte rmin, byte rmax, byte nbytes, byte access, */ +/* byte cprt_r_b0, cprt_r_b1, cprt_w_b0, cprt_w_b1} */ +/* byte = 255 */ +/* out byte status */ + +#define RDIInfo_RequestCoProDesc 0x401 +/* rdi: in int *cpno, out Dbg_CoProDesc *cpd */ +/* rpd: in byte cpno */ +/* out nentries * { */ +/* byte rmin, byte rmax, byte nbytes, byte access, */ +/* } */ +/* byte = 255, byte status */ + +#define RDIInfo_Log 0x800 +/* rdi: out ARMword *logsetting */ +/* No corresponding RDP operation */ +#define RDIInfo_SetLog 0x801 +/* rdi: in ARMword *logsetting */ +/* No corresponding RDP operation */ + +#define RDIProfile_Stop 0x500 +/* No arguments, no return value */ +/* rdp: in none, out byte status */ +/* Requests that pc sampling stop */ + +#define RDIProfile_Start 0x501 +/* rdi: in ARMword *interval */ +/* rdp: in word interval, out byte status */ +/* Requests that pc sampling start, with period usec */ + +#define RDIProfile_WriteMap 0x502 +/* rdi: in ARMword map[] */ +/* map[0] is the length of the array, subsequent elements are sorted */ +/* and are the base of ranges for pc sampling (so if the sampled pc */ +/* lies between map[i] and map[i+1], count[i] is incremented). */ +/* rdp: a number of messages, each of form: */ +/* in word len, word size, word offset, words map data */ +/* out status */ +/* len, size and offset are all word counts. */ + +#define RDIProfile_ReadMap 0x503 +/* rdi: in ARMword *len, out ARMword counts[len] */ +/* Requests that the counts array be set to the accumulated pc sample */ +/* counts */ +/* rdp: a number of messages, each of form: */ +/* in word offset, word size */ +/* out words, status */ +/* len, size and offset are all word counts. */ + +#define RDIProfile_ClearCounts 0x504 +/* No arguments, no return value */ +/* rdp: in none, out byte status */ +/* Requests that pc sample counts be set to zero */ + +typedef struct { + ARMword len; + ARMword map[1]; +} RDI_ProfileMap; + +typedef unsigned32 PointHandle; +typedef unsigned32 ThreadHandle; +#define RDINoPointHandle ((PointHandle)-1L) +#define RDINoHandle ((ThreadHandle)-1L) + +struct Dbg_ConfigBlock; +struct Dbg_HostosInterface; +struct Dbg_MCState; +typedef int rdi_open_proc(unsigned type, struct Dbg_ConfigBlock const *config, + struct Dbg_HostosInterface const *i, + struct Dbg_MCState *dbg_state); +typedef int rdi_close_proc(void); +typedef int rdi_read_proc(ARMword source, void *dest, unsigned *nbytes); +typedef int rdi_write_proc(const void *source, ARMword dest, unsigned *nbytes); +typedef int rdi_CPUread_proc(unsigned mode, unsigned32 mask, ARMword *state); +typedef int rdi_CPUwrite_proc(unsigned mode, unsigned32 mask, ARMword const *state); +typedef int rdi_CPread_proc(unsigned CPnum, unsigned32 mask, ARMword *state); +typedef int rdi_CPwrite_proc(unsigned CPnum, unsigned32 mask, ARMword const *state); +typedef int rdi_setbreak_proc(ARMword address, unsigned type, ARMword bound, + PointHandle *handle); +typedef int rdi_clearbreak_proc(PointHandle handle); +typedef int rdi_setwatch_proc(ARMword address, unsigned type, unsigned datatype, + ARMword bound, PointHandle *handle); +typedef int rdi_clearwatch_proc(PointHandle handle); +typedef int rdi_execute_proc(PointHandle *handle); +typedef int rdi_step_proc(unsigned ninstr, PointHandle *handle); +typedef int rdi_info_proc(unsigned type, ARMword *arg1, ARMword *arg2); +typedef int rdi_pointinq_proc(ARMword *address, unsigned type, + unsigned datatype, ARMword *bound); + +typedef enum { + RDI_ConfigCPU, + RDI_ConfigSystem +} RDI_ConfigAspect; + +typedef enum { + RDI_MatchAny, + RDI_MatchExactly, + RDI_MatchNoEarlier +} RDI_ConfigMatchType; + +typedef int rdi_addconfig_proc(unsigned32 nbytes); +typedef int rdi_loadconfigdata_proc(unsigned32 nbytes, char const *data); +typedef int rdi_selectconfig_proc(RDI_ConfigAspect aspect, char const *name, + RDI_ConfigMatchType matchtype, unsigned versionreq, + unsigned *versionp); + +typedef char *getbufferproc(void *getbarg, unsigned32 *sizep); +typedef int rdi_loadagentproc(ARMword dest, unsigned32 size, getbufferproc *getb, void *getbarg); + +typedef struct { + int itemmax; + char const * const *names; +} RDI_NameList; + +typedef RDI_NameList const *rdi_namelistproc(void); + +typedef int rdi_errmessproc(char *buf, int buflen, int errno); + +struct RDIProcVec { + char rditypename[12]; + + rdi_open_proc *open; + rdi_close_proc *close; + rdi_read_proc *read; + rdi_write_proc *write; + rdi_CPUread_proc *CPUread; + rdi_CPUwrite_proc *CPUwrite; + rdi_CPread_proc *CPread; + rdi_CPwrite_proc *CPwrite; + rdi_setbreak_proc *setbreak; + rdi_clearbreak_proc *clearbreak; + rdi_setwatch_proc *setwatch; + rdi_clearwatch_proc *clearwatch; + rdi_execute_proc *execute; + rdi_step_proc *step; + rdi_info_proc *info; + /* V2 RDI */ + rdi_pointinq_proc *pointinquiry; + + /* These three useable only if RDIInfo_DownLoad returns no error */ + rdi_addconfig_proc *addconfig; + rdi_loadconfigdata_proc *loadconfigdata; + rdi_selectconfig_proc *selectconfig; + + rdi_namelistproc *drivernames; + rdi_namelistproc *cpunames; + + rdi_errmessproc *errmess; + + /* Only if RDIInfo_Target returns a value with RDITarget_LoadAgent set */ + rdi_loadagentproc *loadagent; +}; + +#endif + \ No newline at end of file diff --git a/Bachelor/Mikroprozessorsysteme2/ARM202U/SOURCE/WIN32/ARMDBG/DBG_STAT.H b/Bachelor/Mikroprozessorsysteme2/ARM202U/SOURCE/WIN32/ARMDBG/DBG_STAT.H new file mode 100644 index 0000000..a29976c --- /dev/null +++ b/Bachelor/Mikroprozessorsysteme2/ARM202U/SOURCE/WIN32/ARMDBG/DBG_STAT.H @@ -0,0 +1,37 @@ +/* + * ARM debugger toolbox : dbg_stat.h + * Copyright (C) 1992 Advanced Risc Machines Ltd. All rights reserved. + */ + +/* + * RCS $Revision: 1.1 $ + * Checkin $Date: 1995/02/01 14:39:25 $ + * Revising $Author: hmeekings $ + */ + +#ifndef dbg_stat__h +#define dbg_stat__h + +typedef struct { + ARMword handle; + ARMword start, limit; /* start & limit of this region */ + unsigned char width; /* memory width 0,1,2 => 8,16,32 bit */ + unsigned char access; /* Bit 0 => read access */ + /* Bit 1 => write access */ + /* Bit 2 => latched 32 bit memory */ + unsigned char d1, d2; /* ensure padding */ + /* Access times for R/W N/S cycles */ + unsigned long Nread_ns, Nwrite_ns, Sread_ns, Swrite_ns; +} RDI_MemDescr; + +typedef struct { + ARMword Nreads, /* Counts for R/W N/S cycles */ + Nwrites, + Sreads, + Swrites; + ARMword ns, /* Time (nsec, sec) */ + s; +} RDI_MemAccessStats; + +#endif + \ No newline at end of file -- cgit v1.2.3