Changeset 53654 in vbox for trunk/src/VBox
- Timestamp:
- Jan 2, 2015 12:27:36 PM (10 years ago)
- Location:
- trunk/src/VBox/ExtPacks/VBoxDTrace
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ExtPacks/VBoxDTrace/VBoxDTrace/Makefile.kmk
r53653 r53654 56 56 $(VBOXDT_PATH_LIBDTRACE)/common/dt_subr.c \ 57 57 $(VBOXDT_PATH_LIBDTRACE)/common/dt_work.c \ 58 \ 58 59 59 60 VBoxDTrace_VBOX_TODO = \ … … 64 65 $(VBOXDT_PATH_LIBDTRACE)/common/dt_dis.c \ 65 66 $(VBOXDT_PATH_LIBDTRACE)/common/dt_dof.c \ 66 $(VBOXDT_PATH_LIBDTRACE)/common/dt_errtags.c \67 67 $(VBOXDT_PATH_LIBDTRACE)/common/dt_handle.c \ 68 68 $(VBOXDT_PATH_LIBDTRACE)/common/dt_ident.c \ … … 78 78 $(VBOXDT_PATH_LIBDTRACE)/common/dt_pragma.c \ 79 79 $(VBOXDT_PATH_LIBDTRACE)/common/dt_provider.c \ 80 $(VBOXDT_PATH_LIBDTRACE)/common/dt_xlator.c 80 $(VBOXDT_PATH_LIBDTRACE)/common/dt_xlator.c \ 81 \ 82 generated: $(VBOXDT_PATH_LIBDTRACE)/common/dt_errtags.c \ 83 84 if 1 85 USES += yacc 86 VBoxDTrace_USES += yacc 87 VBoxDTrace_YACCTOOL = BISON 88 VBoxDTrace_YACCFLAGS = -d 89 VBoxDTrace_SOURCES += \ 90 $(VBOXDT_PATH_LIBDTRACE)/common/dt_grammar.y 91 VBoxDTrace_INCS += $(VBoxDTrace_0_OUTDIR)/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common 92 else 93 # fixme later 94 endif 95 96 if 1 97 USES = lex 98 VBoxDTrace_USES = lex 99 VBoxDTrace_LEXTOOL = FLEX 100 VBoxDTrace_LEXFLAGS = -l 101 VBoxDTrace_DEFS = USING_FLEX 102 VBoxDTrace_SOURCES += \ 103 $(VBOXDT_PATH_LIBDTRACE)/common/dt_lex.l 104 else 105 VBoxDTrace_SOURCES += \ 106 generated/dt_lex.c 107 VBoxDTrace_INCS.win += \ 108 generated/hdrhacks 109 endif 81 110 82 111 VBoxDTrace_LIBS = \ -
trunk/src/VBox/ExtPacks/VBoxDTrace/include/VBoxDTraceTypes.h
r53653 r53654 85 85 # define _IPL32 1 86 86 # endif 87 # define _LITTLE_ENDIAN 1 87 88 88 89 #elif defined(RT_ARCH_AMD64) … … 96 97 # define _LP64 1 97 98 # endif 99 # define _LITTLE_ENDIAN 1 98 100 99 101 #else … … 400 402 # define strncasecmp(a_psz1, a_psz2, a_cch) \ 401 403 RTStrNICmp(a_psz1, a_psz2, a_cch) 404 # undef assert 402 405 # define assert(expr) Assert(expr) 403 406 … … 411 414 # define free(a_pvMem) RTMemFree(a_pvMem) 412 415 # define strdup(a_psz) RTStrDup(a_psz) 416 # define strndup(a_psz, a_cchMax) RTStrDupN(a_psz, a_cchMax) 413 417 # define strlcpy(a_pszDst, a_pszSrc, a_cbDst) ((void)RTStrCopy(a_pszDst, a_cbDst, a_pszSrc)) 414 418 -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_grammar.y
r53634 r53654 25 25 */ 26 26 27 #ifndef VBOX 27 28 #pragma ident "%Z%%M% %I% %E% SMI" 29 #endif 28 30 29 31 #include <dt_impl.h> … … 297 299 } 298 300 ; 299 301 300 302 301 303 probe_definition: … … 401 403 $$ = OP1(DT_TOK_POSTDEC, $1); 402 404 } 403 | DT_TOK_OFFSETOF DT_TOK_LPAR type_name DT_TOK_COMMA 405 | DT_TOK_OFFSETOF DT_TOK_LPAR type_name DT_TOK_COMMA 404 406 DT_TOK_IDENT DT_TOK_RPAR { 405 407 $$ = dt_node_offsetof($3, $5); 406 408 } 407 | DT_TOK_OFFSETOF DT_TOK_LPAR type_name DT_TOK_COMMA 409 | DT_TOK_OFFSETOF DT_TOK_LPAR type_name DT_TOK_COMMA 408 410 DT_TOK_TNAME DT_TOK_RPAR { 409 411 $$ = dt_node_offsetof($3, $5); -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_lex.l
r53634 r53654 25 25 */ 26 26 27 #ifndef VBOX 27 28 #include <string.h> 28 29 #include <stdlib.h> … … 31 32 #include <ctype.h> 32 33 #include <errno.h> 34 #else /* VBOX */ 35 # include <iprt/ctype.h> 36 # define isdigit(a_ch) RT_C_IS_DIGIT(a_ch) 37 #endif /* VBOX */ 33 38 34 39 #include <dt_impl.h> … … 37 42 #include <dt_string.h> 38 43 44 #ifndef USING_FLEX 39 45 /* 40 46 * We need to undefine lex's input and unput macros so that references to these … … 43 49 #undef input 44 50 #undef unput 51 #else /* USING_FLEX */ 52 # define YY_INPUT(buf, result, max_size) \ 53 do { \ 54 if (yypcb->pcb_fileptr != NULL) { \ 55 result = (int)fread(buf, 1, max_size, yypcb->pcb_fileptr); \ 56 if (!result && ferror(yypcb->pcb_fileptr)) \ 57 YY_FATAL_ERROR("input in flex scanner failed"); \ 58 } else { \ 59 size_t off = yypcb->pcb_strptr - yypcb->pcb_string; \ 60 if (off < yypcb->pcb_strlen) { \ 61 result = max_size; \ 62 if ((size_t)result > yypcb->pcb_strlen) \ 63 result = (int)yypcb->pcb_strlen; \ 64 memcpy(buf, yypcb->pcb_strptr, result); \ 65 yypcb->pcb_strptr += result; \ 66 } else \ 67 result = 0; \ 68 } \ 69 } while (0) 70 #endif /* USING_FLEX */ 45 71 46 72 static int id_or_type(const char *); 73 #ifndef USING_FLEX 47 74 static int input(void); 48 75 static void unput(int); 76 #endif 49 77 50 78 /* … … 249 277 */ 250 278 if (isdigit(v[0]) || v[0] == '-' || v[0] == '+') { 279 #ifdef VBOX 280 int rc; 281 #endif 251 282 if (isdigit(v[0])) 252 283 yyintprefix = 0; … … 254 285 yyintprefix = *v++; 255 286 287 #ifndef VBOX 256 288 errno = 0; 257 289 yylval.l_int = strtoull(v, &p, 0); 290 #else 291 rc = RTStrToUInt64Ex(v, &p, 0, &yylval.l_int); 292 #endif 258 293 (void) strncpy(yyintsuffix, p, 259 294 sizeof (yyintsuffix)); 260 295 yyintdecimal = *v != '0'; 261 296 262 if (errno == ERANGE) { 297 #ifndef VBOX 298 if (errno == ERANGE) 299 #else 300 if (rc == VWRN_NUMBER_TOO_BIG || rc == VWRN_NEGATIVE_UNSIGNED) 301 #endif 263 302 xyerror(D_MACRO_OFLOW, "macro argument" 264 303 " %s constant %s results in integer" 265 304 " overflow\n", yytext, v); 266 }267 305 268 306 return (DT_TOK_INT); … … 336 374 char *p; 337 375 376 #ifndef VBOX 338 377 errno = 0; 339 378 yylval.l_int = strtoull(yytext, &p, 0); 379 #else 380 int rc = RTStrToUInt64Ex(yytext, &p, 0, &yylval.l_int); 381 #endif 340 382 yyintprefix = 0; 341 383 (void) strncpy(yyintsuffix, p, sizeof (yyintsuffix)); 342 384 yyintdecimal = yytext[0] != '0'; 343 385 344 if (errno == ERANGE) { 386 #ifndef VBOX 387 if (errno == ERANGE) 388 #else 389 if (rc == VWRN_NUMBER_TOO_BIG || rc == VWRN_NEGATIVE_UNSIGNED) 390 #endif 345 391 xyerror(D_INT_OFLOW, "constant %s results in " 346 392 "integer overflow\n", yytext); 347 }348 393 349 394 if (*p != '\0' && strchr("uUlL", *p) == NULL) { … … 697 742 yylineno = 1; 698 743 yypragma = NULL; 744 #ifndef USING_FLEX 699 745 yysptr = yysbuf; 746 #endif 700 747 } 701 748 … … 793 840 } 794 841 842 #ifndef USING_FLEX 843 795 844 static int 796 845 input(void) … … 834 883 yytchar = c; 835 884 } 885 886 #endif /* USING_FLEX */
Note:
See TracChangeset
for help on using the changeset viewer.