"Fossies" - the Fresh Open Source Software Archive

Member "xxgdb-1.12/datadpy.h" (11 Feb 1994, 4543 Bytes) of package /linux/misc/old/xxgdb-1.12.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 /*****************************************************************************
    2  *
    3  *  xdbx - X Window System interface to the dbx debugger
    4  *
    5  *  Copyright 1989 The University of Texas at Austin
    6  *  Copyright 1990 Microelectronics and Computer Technology Corporation
    7  *
    8  *  Permission to use, copy, modify, and distribute this software and its
    9  *  documentation for any purpose and without fee is hereby granted,
   10  *  provided that the above copyright notice appear in all copies and that
   11  *  both that copyright notice and this permission notice appear in
   12  *  supporting documentation, and that the name of The University of Texas
   13  *  and Microelectronics and Computer Technology Corporation (MCC) not be 
   14  *  used in advertising or publicity pertaining to distribution of
   15  *  the software without specific, written prior permission.  The
   16  *  University of Texas and MCC makes no representations about the 
   17  *  suitability of this software for any purpose.  It is provided "as is" 
   18  *  without express or implied warranty.
   19  *
   20  *  THE UNIVERSITY OF TEXAS AND MCC DISCLAIMS ALL WARRANTIES WITH REGARD TO
   21  *  THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
   22  *  FITNESS, IN NO EVENT SHALL THE UNIVERSITY OF TEXAS OR MCC BE LIABLE FOR
   23  *  ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
   24  *  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
   25  *  CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
   26  *  CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
   27  *
   28  *  Author:     Po Cheung
   29  *  Created:    March 10, 1989
   30  * 
   31  *****************************************************************************
   32  * 
   33  *  xxgdb - X Window System interface to the gdb debugger
   34  *  
   35  *  Copyright 1990,1993 Thomson Consumer Electronics, Inc.
   36  *  
   37  *  Permission to use, copy, modify, and distribute this software and its
   38  *  documentation for any purpose and without fee is hereby granted,
   39  *  provided that the above copyright notice appear in all copies and that
   40  *  both that copyright notice and this permission notice appear in
   41  *  supporting documentation, and that the name of Thomson Consumer
   42  *  Electronics (TCE) not be used in advertising or publicity pertaining
   43  *  to distribution of the software without specific, written prior
   44  *  permission.  TCE makes no representations about the suitability of
   45  *  this software for any purpose.  It is provided "as is" without express
   46  *  or implied warranty.
   47  *
   48  *  TCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
   49  *  ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT
   50  *  SHALL TCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES
   51  *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
   52  *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
   53  *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
   54  *  SOFTWARE.
   55  *
   56  *  Adaptation to GDB:  Pierre Willard
   57  *  XXGDB Created:      December, 1990
   58  *
   59  *****************************************************************************/
   60 
   61 /*  datadpy.h:
   62  *
   63  *  Regular expression pattern matching for C structures
   64  *
   65  *  The reg_token array indicates the register no. for each token type.
   66  *      reg_token[0] : level of indentation
   67  *      reg_token[2] : field name
   68  *      reg_token[4] : pointer string
   69  */
   70 
   71 #define TK_INDENT       0
   72 #define TK_FIELD        2
   73 #define TK_POINTER      4
   74 
   75 #define D_POINTER   0
   76 #define D_FIELD     1
   77 #define D_STRUCT    2
   78 
   79 #ifdef GDB  /* >>>>>>>>>>>>  GDB ONLY <<<<<<<<<<<<<<<<<< */
   80 /*
   81     Note : for GDB the 'set prettyprint on' must be ON.
   82     
   83     Examples :
   84     
   85         $3 = (struct toto *) 0x40c0
   86         
   87         $2 = {
   88           pt = 0x40b4,
   89           u = 5,
   90           v = 6
   91         }
   92 */
   93 
   94 PatternRec dataPattern[] = {
   95     {"@*0x[0-9a-f]+",                 
   96      NULL, {-1, -1, -1, -1, -1, -1}
   97     },
   98     {"\\([ ]*\\)\\(.*[^ ]+\\)[ ]* = \\((.*) \\)?\\(0x[0-9a-f]+\\)[,]?[ ]*\n", 
   99      NULL, { 1, -1,  2, -1,  4, -1}
  100     },
  101     {"\\([ ]*\\)\\(.*[^ ]*\\)[ ]* = {\n",         
  102      NULL, { 1, -1,  2, -1, -1, -1}
  103     },
  104     {
  105     NULL, /* last one */
  106      NULL, { -1, -1, -1, -1, -1, -1}
  107     }
  108 };
  109 
  110 #else       /* >>>>>>>>>>>>  IF NOT GDB <<<<<<<<<<<<<<<<<< */
  111 
  112 PatternRec dataPattern[] = {
  113     {"0x[0-9a-f]+",                   
  114      NULL, {-1, -1, -1, -1, -1, -1}
  115     },
  116     {"\\([ ]*\\)\\(.*[^ ]+\\)[ ]* = \\(0x[0-9a-f]+\\)\n", 
  117      NULL, { 1, -1,  2, -1,  3, -1}
  118     },
  119     {"\\([ ]*\\)\\(.*[^ ]*\\)[ ]* = {\n",         
  120      NULL, { 1, -1,  2, -1, -1, -1}
  121     },
  122     {
  123     NULL, /* last one */
  124      NULL, { -1, -1, -1, -1, -1, -1}
  125     }
  126 };
  127 #endif /* NOT GDB */