sourcepawn/compiler/amxdbg.h
branchrefac-jit
changeset 2284 026da5437111
parent 2192 7602d7fb60d9
child 2288 15c77b21589a
     1.1 --- a/sourcepawn/compiler/amxdbg.h	Fri Jul 11 06:51:21 2008 +0000
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,173 +0,0 @@
     1.4 -/*  Abstract Machine for the Pawn compiler, debugger support
     1.5 - *
     1.6 - *  This file contains extra definitions that are convenient for debugger
     1.7 - *  support.
     1.8 - *
     1.9 - *  Copyright (c) ITB CompuPhase, 2005
    1.10 - *
    1.11 - *  This software is provided "as-is", without any express or implied warranty.
    1.12 - *  In no event will the authors be held liable for any damages arising from
    1.13 - *  the use of this software.
    1.14 - *
    1.15 - *  Permission is granted to anyone to use this software for any purpose,
    1.16 - *  including commercial applications, and to alter it and redistribute it
    1.17 - *  freely, subject to the following restrictions:
    1.18 - *
    1.19 - *  1.  The origin of this software must not be misrepresented; you must not
    1.20 - *      claim that you wrote the original software. If you use this software in
    1.21 - *      a product, an acknowledgment in the product documentation would be
    1.22 - *      appreciated but is not required.
    1.23 - *  2.  Altered source versions must be plainly marked as such, and must not be
    1.24 - *      misrepresented as being the original software.
    1.25 - *  3.  This notice may not be removed or altered from any source distribution.
    1.26 - *
    1.27 - *  Version: $Id$
    1.28 - */
    1.29 -
    1.30 -#ifndef AMXDBG_H_INCLUDED
    1.31 -#define AMXDBG_H_INCLUDED
    1.32 -
    1.33 -#ifndef AMX_H_INCLUDED
    1.34 -  #include "amx.h"
    1.35 -#endif
    1.36 -
    1.37 -#ifdef  __cplusplus
    1.38 -extern  "C" {
    1.39 -#endif
    1.40 -
    1.41 -/* Some compilers do not support the #pragma align, which should be fine. Some
    1.42 - * compilers give a warning on unknown #pragmas, which is not so fine...
    1.43 - */
    1.44 -#if defined SN_TARGET_PS2 || defined __GNUC__
    1.45 -  #define AMX_NO_ALIGN
    1.46 -#endif
    1.47 -
    1.48 -#if defined __GNUC__
    1.49 -  #define PACKED        __attribute__((packed))
    1.50 -#else
    1.51 -  #define PACKED
    1.52 -#endif
    1.53 -
    1.54 -#if !defined AMX_NO_ALIGN
    1.55 -  #if defined LINUX || defined __FreeBSD__
    1.56 -    #pragma pack(1)         /* structures must be packed (byte-aligned) */
    1.57 -  #elif defined MACOS && defined __MWERKS__
    1.58 -	#pragma options align=mac68k
    1.59 -  #else
    1.60 -    #pragma pack(push)
    1.61 -    #pragma pack(1)         /* structures must be packed (byte-aligned) */
    1.62 -    #if defined __TURBOC__
    1.63 -      #pragma option -a-    /* "pack" pragma for older Borland compilers */
    1.64 -    #endif
    1.65 -  #endif
    1.66 -#endif
    1.67 -
    1.68 -typedef struct tagAMX_DBG_HDR {
    1.69 -  int32_t size          PACKED; /* size of the debug information chunk */
    1.70 -  uint16_t magic        PACKED; /* signature, must be 0xf1ef */
    1.71 -  char    file_version;         /* file format version */
    1.72 -  char    amx_version;          /* required version of the AMX */
    1.73 -  int16_t flags         PACKED; /* currently unused */
    1.74 -  int16_t files         PACKED; /* number of entries in the "file" table */
    1.75 -  int16_t lines         PACKED; /* number of entries in the "line" table */
    1.76 -  int16_t symbols       PACKED; /* number of entries in the "symbol" table */
    1.77 -  int16_t tags          PACKED; /* number of entries in the "tag" table */
    1.78 -  int16_t automatons    PACKED; /* number of entries in the "automaton" table */
    1.79 -  int16_t states        PACKED; /* number of entries in the "state" table */
    1.80 -} PACKED AMX_DBG_HDR;
    1.81 -#define AMX_DBG_MAGIC   0xf1ef
    1.82 -
    1.83 -typedef struct tagAMX_DBG_FILE {
    1.84 -  ucell   address       PACKED; /* address in the code segment where generated code (for this file) starts */
    1.85 -  const char name[1];           /* ASCII string, zero-terminated */
    1.86 -} PACKED AMX_DBG_FILE;
    1.87 -
    1.88 -typedef struct tagAMX_DBG_LINE {
    1.89 -  ucell   address       PACKED; /* address in the code segment where generated code (for this line) starts */
    1.90 -  int32_t line          PACKED; /* line number */
    1.91 -} PACKED AMX_DBG_LINE;
    1.92 -
    1.93 -typedef struct tagAMX_DBG_SYMBOL {
    1.94 -  ucell   address       PACKED; /* address in the data segment or relative to the frame */
    1.95 -  int16_t tag           PACKED; /* tag for the symbol */
    1.96 -  ucell   codestart     PACKED; /* address in the code segment from which this symbol is valid (in scope) */
    1.97 -  ucell   codeend       PACKED; /* address in the code segment until which this symbol is valid (in scope) */
    1.98 -  char    ident;                /* kind of symbol (function/variable) */
    1.99 -  char    vclass;               /* class of symbol (global/local) */
   1.100 -  int16_t dim           PACKED; /* number of dimensions */
   1.101 -  const char name[1];           /* ASCII string, zero-terminated */
   1.102 -} PACKED AMX_DBG_SYMBOL;
   1.103 -
   1.104 -typedef struct tagAMX_DBG_SYMDIM {
   1.105 -  int16_t tag           PACKED; /* tag for the array dimension */
   1.106 -  ucell   size          PACKED; /* size of the array dimension */
   1.107 -} PACKED AMX_DBG_SYMDIM;
   1.108 -
   1.109 -typedef struct tagAMX_DBG_TAG {
   1.110 -  int16_t tag           PACKED; /* tag id */
   1.111 -  const char name[1];           /* ASCII string, zero-terminated */
   1.112 -} PACKED AMX_DBG_TAG;
   1.113 -
   1.114 -typedef struct tagAMX_DBG_MACHINE {
   1.115 -  int16_t automaton     PACKED; /* automaton id */
   1.116 -  ucell address         PACKED; /* address of state variable */
   1.117 -  const char name[1];           /* ASCII string, zero-terminated */
   1.118 -} PACKED AMX_DBG_MACHINE;
   1.119 -
   1.120 -typedef struct tagAMX_DBG_STATE {
   1.121 -  int16_t state         PACKED; /* state id */
   1.122 -  int16_t automaton     PACKED; /* automaton id */
   1.123 -  const char name[1];           /* ASCII string, zero-terminated */
   1.124 -} PACKED AMX_DBG_STATE;
   1.125 -
   1.126 -typedef struct tagAMX_DBG {
   1.127 -  AMX_DBG_HDR     _FAR *hdr         PACKED; /* points to the AMX_DBG header */
   1.128 -  AMX_DBG_FILE    _FAR **filetbl    PACKED;
   1.129 -  AMX_DBG_LINE    _FAR *linetbl     PACKED;
   1.130 -  AMX_DBG_SYMBOL  _FAR **symboltbl  PACKED;
   1.131 -  AMX_DBG_TAG     _FAR **tagtbl     PACKED;
   1.132 -  AMX_DBG_MACHINE _FAR **automatontbl PACKED;
   1.133 -  AMX_DBG_STATE   _FAR **statetbl   PACKED;
   1.134 -} PACKED AMX_DBG;
   1.135 -
   1.136 -#if !defined iVARIABLE
   1.137 -  #define iVARIABLE  1  /* cell that has an address and that can be fetched directly (lvalue) */
   1.138 -  #define iREFERENCE 2  /* iVARIABLE, but must be dereferenced */
   1.139 -  #define iARRAY     3
   1.140 -  #define iREFARRAY  4  /* an array passed by reference (i.e. a pointer) */
   1.141 -  #define iFUNCTN    9
   1.142 -#endif
   1.143 -
   1.144 -
   1.145 -int AMXAPI dbg_FreeInfo(AMX_DBG *amxdbg);
   1.146 -int AMXAPI dbg_LoadInfo(AMX_DBG *amxdbg, void *dbg_addr);
   1.147 -
   1.148 -int AMXAPI dbg_LookupFile(AMX_DBG *amxdbg, ucell address, const char **filename);
   1.149 -int AMXAPI dbg_LookupFunction(AMX_DBG *amxdbg, ucell address, const char **funcname);
   1.150 -int AMXAPI dbg_LookupLine(AMX_DBG *amxdbg, ucell address, long *line);
   1.151 -
   1.152 -int AMXAPI dbg_GetFunctionAddress(AMX_DBG *amxdbg, const char *funcname, const char *filename, ucell *address);
   1.153 -int AMXAPI dbg_GetLineAddress(AMX_DBG *amxdbg, long line, const char *filename, ucell *address);
   1.154 -int AMXAPI dbg_GetAutomatonName(AMX_DBG *amxdbg, int automaton, const char **name);
   1.155 -int AMXAPI dbg_GetStateName(AMX_DBG *amxdbg, int state, const char **name);
   1.156 -int AMXAPI dbg_GetTagName(AMX_DBG *amxdbg, int tag, const char **name);
   1.157 -int AMXAPI dbg_GetVariable(AMX_DBG *amxdbg, const char *symname, ucell scopeaddr, const AMX_DBG_SYMBOL **sym);
   1.158 -int AMXAPI dbg_GetArrayDim(AMX_DBG *amxdbg, const AMX_DBG_SYMBOL *sym, const AMX_DBG_SYMDIM **symdim);
   1.159 -
   1.160 -
   1.161 -#if !defined AMX_NO_ALIGN
   1.162 -  #if defined LINUX || defined __FreeBSD__
   1.163 -    #pragma pack()    /* reset default packing */
   1.164 -  #elif defined MACOS && defined __MWERKS__
   1.165 -    #pragma options align=reset
   1.166 -  #else
   1.167 -    #pragma pack(pop) /* reset previous packing */
   1.168 -  #endif
   1.169 -#endif
   1.170 -
   1.171 -#ifdef  __cplusplus
   1.172 -}
   1.173 -#endif
   1.174 -
   1.175 -#endif /* AMXDBG_H_INCLUDED */
   1.176 -