Print this page
4474 DTrace Userland CTF Support
4475 DTrace userland Keyword
4476 DTrace tests should be better citizens
4479 pid provider types
4480 dof emulation missing checks
Reviewed by: Bryan Cantrill <bryan@joyent.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libdtrace/common/dt_lex.l
          +++ new/usr/src/lib/libdtrace/common/dt_lex.l
↓ open down ↓ 15 lines elided ↑ open up ↑
  16   16   * If applicable, add the following below this CDDL HEADER, with the
  17   17   * fields enclosed by brackets "[]" replaced with your own identifying
  18   18   * information: Portions Copyright [yyyy] [name of copyright owner]
  19   19   *
  20   20   * CDDL HEADER END
  21   21   */
  22   22  
  23   23  /*
  24   24   * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  25   25   */
       26 +/*
       27 + * Copyright (c) 2013 by Delphix. All rights reserved.
       28 + * Copyright (c) 2013, Joyent, Inc. All rights reserved.
       29 + */
  26   30  
  27   31  #include <string.h>
  28   32  #include <stdlib.h>
  29   33  #include <stdio.h>
  30   34  #include <assert.h>
  31   35  #include <ctype.h>
  32   36  #include <errno.h>
  33   37  
  34   38  #include <dt_impl.h>
  35   39  #include <dt_grammar.h>
↓ open down ↓ 17 lines elided ↑ open up ↑
  53   57   *
  54   58   * S0 - D program clause and expression lexing
  55   59   * S1 - D comments (i.e. skip everything until end of comment)
  56   60   * S2 - D program outer scope (probe specifiers and declarations)
  57   61   * S3 - D control line parsing (i.e. after ^# is seen but before \n)
  58   62   * S4 - D control line scan (locate control directives only and invoke S3)
  59   63   */
  60   64  %}
  61   65  
  62   66  %e 1500         /* maximum nodes */
  63      -%p 3700         /* maximum positions */
       67 +%p 4900         /* maximum positions */
  64   68  %n 600          /* maximum states */
       69 +%a 3000         /* maximum transitions */
  65   70  
  66   71  %s S0 S1 S2 S3 S4
  67   72  
  68   73  RGX_AGG         "@"[a-zA-Z_][0-9a-zA-Z_]*
  69   74  RGX_PSPEC       [-$:a-zA-Z_.?*\\\[\]!][-$:0-9a-zA-Z_.`?*\\\[\]!]*
       75 +RGX_ALTIDENT    [a-zA-Z_][0-9a-zA-Z_]*
       76 +RGX_LMID        LM[0-9a-fA-F]+`
       77 +RGX_MOD_IDENT   [a-zA-Z_`][0-9a-z.A-Z_`]*`
  70   78  RGX_IDENT       [a-zA-Z_`][0-9a-zA-Z_`]*
  71   79  RGX_INT         ([0-9]+|0[xX][0-9A-Fa-f]+)[uU]?[lL]?[lL]?
  72   80  RGX_FP          ([0-9]+("."?)[0-9]*|"."[0-9]+)((e|E)("+"|-)?[0-9]+)?[fFlL]?
  73   81  RGX_WS          [\f\n\r\t\v ]
  74   82  RGX_STR         ([^"\\\n]|\\[^"\n]|\\\")*
  75   83  RGX_CHR         ([^'\\\n]|\\[^'\n]|\\')*
  76   84  RGX_INTERP      ^[\f\t\v ]*#!.*
  77   85  RGX_CTL         ^[\f\t\v ]*#
  78   86  
  79   87  %%
↓ open down ↓ 49 lines elided ↑ open up ↑
 129  137  <S0>static      return (DT_KEY_STATIC);
 130  138  <S0>string      return (DT_KEY_STRING);
 131  139  <S0>stringof    return (DT_TOK_STRINGOF);
 132  140  <S0>struct      return (DT_KEY_STRUCT);
 133  141  <S0>switch      return (DT_KEY_SWITCH);
 134  142  <S0>this        return (DT_KEY_THIS);
 135  143  <S0>translator  return (DT_KEY_XLATOR);
 136  144  <S0>typedef     return (DT_KEY_TYPEDEF);
 137  145  <S0>union       return (DT_KEY_UNION);
 138  146  <S0>unsigned    return (DT_KEY_UNSIGNED);
      147 +<S0>userland    return (DT_KEY_USERLAND);
 139  148  <S0>void        return (DT_KEY_VOID);
 140  149  <S0>volatile    return (DT_KEY_VOLATILE);
 141  150  <S0>while       return (DT_KEY_WHILE);
 142  151  <S0>xlate       return (DT_TOK_XLATE);
 143  152  
 144  153  <S2>auto        { yybegin(YYS_EXPR);    return (DT_KEY_AUTO); }
 145  154  <S2>char        { yybegin(YYS_EXPR);    return (DT_KEY_CHAR); }
 146  155  <S2>const       { yybegin(YYS_EXPR);    return (DT_KEY_CONST); }
 147  156  <S2>counter     { yybegin(YYS_DEFINE);  return (DT_KEY_COUNTER); }
 148  157  <S2>double      { yybegin(YYS_EXPR);    return (DT_KEY_DOUBLE); }
↓ open down ↓ 158 lines elided ↑ open up ↑
 307  316                           * type id_t (refer to dtrace_update() for details).
 308  317                           */
 309  318                          yylval.l_int = (intmax_t)(int)idp->di_id;
 310  319                          yyintprefix = 0;
 311  320                          yyintsuffix[0] = '\0';
 312  321                          yyintdecimal = 1;
 313  322  
 314  323                          return (DT_TOK_INT);
 315  324                  }
 316  325  
 317      -<S0>{RGX_IDENT} {
      326 +<S0>{RGX_IDENT} |
      327 +<S0>{RGX_MOD_IDENT}{RGX_IDENT} |
      328 +<S0>{RGX_MOD_IDENT} {
 318  329                          return (id_or_type(yytext));
 319  330                  }
 320  331  
 321  332  <S0>{RGX_AGG}   {
 322  333                          if ((yylval.l_str = strdup(yytext)) == NULL)
 323  334                                  longjmp(yypcb->pcb_jmpbuf, EDT_NOMEM);
 324  335                          return (DT_TOK_AGG);
 325  336                  }
 326  337  
 327  338  <S0>"@"         {
↓ open down ↓ 508 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX