This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
Defines | |
| #define | DBUG_ENTER(a) |
| #define | DBUG_LEAVE (_db_return_ (__LINE__, &_db_func_, &_db_file_, &_db_level_)) |
| #define | DBUG_RETURN(a1) {DBUG_LEAVE; return(a1);} |
| #define | DBUG_VOID_RETURN {DBUG_LEAVE; return;} |
| #define | DBUG_EXECUTE(keyword, a1) {if (_db_on_) {if (_db_keyword_ (keyword)) { a1 }}} |
| #define | DBUG_PRINT(keyword, arglist) {if (_db_on_) {_db_pargs_(__LINE__,keyword); _db_doprnt_ arglist;}} |
| #define | DBUG_PUSH(a1) _db_push_ (a1) |
| #define | DBUG_POP() _db_pop_ () |
| #define | DBUG_PROCESS(a1) (_db_process_ = a1) |
| #define | DBUG_FILE (_db_fp_) |
| #define | DBUG_SETJMP(a1) (_db_setjmp_ (), setjmp (a1)) |
| #define | DBUG_LONGJMP(a1, a2) (_db_longjmp_ (), longjmp (a1, a2)) |
| #define | DBUG_DUMP(keyword, a1, a2) {if (_db_on_) {_db_dump_(__LINE__,keyword,a1,a2);}} |
| #define | DBUG_IN_USE (_db_fp_ && _db_fp_ != stderr) |
| #define | DEBUGGER_OFF _no_db_=1;_db_on_=0; |
| #define | DEBUGGER_ON _no_db_=0 |
| #define | DBUG_LOCK_FILE { _db_lock_file(); } |
| #define | DBUG_UNLOCK_FILE { _db_unlock_file(); } |
| #define | DBUG_OUTPUT(A) { _db_output_(A); } |
| #define | DBUG_ASSERT(A) assert(A) |
| #define | DBUG_EXECUTE_IF(keyword, a1) {if (_db_on_) {if (_db_strict_keyword_ (keyword)) { a1 }}} |
Functions | |
| int | _db_keyword_ (const char *keyword) |
| int | _db_strict_keyword_ (const char *keyword) |
| void | _db_setjmp_ (void) |
| void | _db_longjmp_ (void) |
| void | _db_push_ (const char *control) |
| void | _db_pop_ (void) |
| void | _db_enter_ (const char *_func_, const char *_file_, uint _line_, const char **_sfunc_, const char **_sfile_, uint *_slevel_, char ***) |
| void | _db_return_ (uint _line_, const char **_sfunc_, const char **_sfile_, uint *_slevel_) |
| void | _db_pargs_ (uint _line_, const char *keyword) |
| void _db_doprnt_ | _VARARGS ((const char *format,...)) |
| void | _db_dump_ (uint _line_, const char *keyword, const char *memory, uint length) |
| void | _db_output_ () |
| void | _db_lock_file () |
| void | _db_unlock_file () |
Variables | |
| int | _db_on_ |
| int | _no_db_ |
| FILE * | _db_fp_ |
| char * | _db_process_ |
|
|
|
|
|
|
|
|
Value: const char *_db_func_, *_db_file_; uint _db_level_; \ char **_db_framep_; \ _db_enter_ (a,__FILE__,__LINE__,&_db_func_,&_db_file_,&_db_level_, \ &_db_framep_) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||||||||||
|
00960 {
00961 int pos;
00962 char dbuff[90];
00963 CODE_STATE *state;
00964 if (!(state=code_state()))
00965 return;
00966
00967 if (_db_keyword_ ((char*) keyword))
00968 {
00969 if (!state->locked)
00970 pthread_mutex_lock(&THR_LOCK_dbug);
00971 DoPrefix (_line_);
00972 if (TRACING)
00973 {
00974 Indent (state->level + 1);
00975 pos= min(max(state->level-stack->sub_level,0)*INDENT,80);
00976 }
00977 else
00978 {
00979 fprintf(_db_fp_, "%s: ", state->func);
00980 }
00981 sprintf(dbuff,"%s: Memory: %lx Bytes: (%d)\n",
00982 keyword,(ulong) memory, length);
00983 (void) fputs(dbuff,_db_fp_);
00984
00985 pos=0;
00986 while (length-- > 0)
00987 {
00988 uint tmp= *((unsigned char*) memory++);
00989 if ((pos+=3) >= 80)
00990 {
00991 fputc('\n',_db_fp_);
00992 pos=3;
00993 }
00994 fputc(_dig_vec_upper[((tmp >> 4) & 15)], _db_fp_);
00995 fputc(_dig_vec_upper[tmp & 15], _db_fp_);
00996 fputc(' ',_db_fp_);
00997 }
00998 (void) fputc('\n',_db_fp_);
00999 dbug_flush(state);
01000 }
01001 }
|
|
||||||||||||||||||||||||||||||||
|
|
|
|
01287 {
01288 REGISTER BOOLEAN result;
01289 CODE_STATE *state;
01290
01291 if (!init_done)
01292 _db_push_ ("");
01293 /* Sasha: pre-my_thread_init() safety */
01294 if (!(state=code_state()))
01295 return FALSE;
01296 result = FALSE;
01297 if (DEBUGGING && !state->disable_output &&
01298 state->level <= stack -> maxdepth &&
01299 InList (stack -> functions, state->func) &&
01300 InList (stack -> keywords, keyword) &&
01301 InList (stack -> processes, _db_process_))
01302 result = TRUE;
01303 return (result);
01304 }
|
|
|
02016 {
02017 CODE_STATE *state;
02018 state=code_state();
02019 pthread_mutex_lock(&THR_LOCK_dbug);
02020 state->locked=1;
02021 }
|
|
|
|
|
|
|
|
||||||||||||
|
00871 {
00872 CODE_STATE *state=code_state();
00873 /* Sasha: pre-my_thread_init() safety */
00874 if (!state)
00875 return;
00876 state->u_line = _line_;
00877 state->u_keyword = (char*) keyword;
00878 }
|
|
|
00626 {
00627 reg1 struct state *discard;
00628 discard = stack;
00629 if (discard != NULL && discard -> next_state != NULL) {
00630 stack = discard -> next_state;
00631 _db_fp_ = stack -> out_file;
00632 _db_pfp_ = stack -> prof_file;
00633 if (discard -> keywords != NULL) {
00634 FreeList (discard -> keywords);
00635 }
00636 if (discard -> functions != NULL) {
00637 FreeList (discard -> functions);
00638 }
00639 if (discard -> processes != NULL) {
00640 FreeList (discard -> processes);
00641 }
00642 if (discard -> p_functions != NULL) {
00643 FreeList (discard -> p_functions);
00644 }
00645 CloseFile (discard -> out_file);
00646 if (discard -> prof_file)
00647 CloseFile (discard -> prof_file);
00648 free ((char *) discard);
00649 if (!(stack->flags & DEBUG_ON))
00650 _db_on_=0;
00651 }
00652 else
00653 {
00654 _db_on_=0;
00655 }
00656 }
|
|
|
00497 {
00498 reg1 char *scan;
00499 reg2 struct link *temp;
00500 CODE_STATE *state;
00501 char *new_str;
00502
00503 if (! _db_fp_)
00504 _db_fp_= stderr; /* Output stream, default stderr */
00505
00506 if (*control == '-')
00507 {
00508 if (*++control == '#')
00509 control++;
00510 }
00511 if (*control)
00512 _no_db_=0; /* We are using dbug after all */
00513
00514 new_str = StrDup (control);
00515 PushState ();
00516 state=code_state();
00517
00518 scan = static_strtok (new_str, ':');
00519 for (; scan != NULL; scan = static_strtok ((char *)NULL, ':')) {
00520 switch (*scan++) {
00521 case 'd':
00522 _db_on_ = TRUE;
00523 stack -> flags |= DEBUG_ON;
00524 if (*scan++ == ',') {
00525 stack -> keywords = ListParse (scan);
00526 }
00527 break;
00528 case 'D':
00529 stack -> delay = 0;
00530 if (*scan++ == ',') {
00531 temp = ListParse (scan);
00532 stack -> delay = DelayArg (atoi (temp -> str));
00533 FreeList (temp);
00534 }
00535 break;
00536 case 'f':
00537 if (*scan++ == ',') {
00538 stack -> functions = ListParse (scan);
00539 }
00540 break;
00541 case 'F':
00542 stack -> flags |= FILE_ON;
00543 break;
00544 case 'i':
00545 stack -> flags |= PID_ON;
00546 break;
00547 #ifndef THREAD
00548 case 'g':
00549 _db_pon_ = TRUE;
00550 if (OpenProfile(PROF_FILE))
00551 {
00552 stack -> flags |= PROFILE_ON;
00553 if (*scan++ == ',')
00554 stack -> p_functions = ListParse (scan);
00555 }
00556 break;
00557 #endif
00558 case 'L':
00559 stack -> flags |= LINE_ON;
00560 break;
00561 case 'n':
00562 stack -> flags |= DEPTH_ON;
00563 break;
00564 case 'N':
00565 stack -> flags |= NUMBER_ON;
00566 break;
00567 case 'A':
00568 case 'O':
00569 stack -> flags |= FLUSH_ON_WRITE;
00570 case 'a':
00571 case 'o':
00572 if (*scan++ == ',') {
00573 temp = ListParse (scan);
00574 DBUGOpenFile(temp -> str, (int) (scan[-2] == 'A' || scan[-2] == 'a'));
00575 FreeList (temp);
00576 } else {
00577 DBUGOpenFile ("-",0);
00578 }
00579 break;
00580 case 'p':
00581 if (*scan++ == ',') {
00582 stack -> processes = ListParse (scan);
00583 }
00584 break;
00585 case 'P':
00586 stack -> flags |= PROCESS_ON;
00587 break;
00588 case 'r':
00589 stack->sub_level= state->level;
00590 break;
00591 case 't':
00592 stack -> flags |= TRACE_ON;
00593 if (*scan++ == ',') {
00594 temp = ListParse (scan);
00595 stack -> maxdepth = atoi (temp -> str);
00596 FreeList (temp);
00597 }
00598 break;
00599 case 'S':
00600 stack -> flags |= SANITY_CHECK_ON;
00601 break;
00602 }
00603 }
00604 free (new_str);
00605 }
|
|
||||||||||||||||||||
|
00797 {
00798 CODE_STATE *state;
00799
00800 if (!_no_db_)
00801 {
00802 int save_errno=errno;
00803 if (!(state=code_state()))
00804 return;
00805 if (!init_done)
00806 _db_push_ ("");
00807 if (stack->flags & (TRACE_ON | DEBUG_ON | PROFILE_ON))
00808 {
00809 if (!state->locked)
00810 pthread_mutex_lock(&THR_LOCK_dbug);
00811 if (state->level != (int) *_slevel_)
00812 (void) fprintf (_db_fp_, ERR_MISSING_RETURN, _db_process_,
00813 state->func);
00814 else
00815 {
00816 #ifdef SAFEMALLOC
00817 if (stack->flags & SANITY_CHECK_ON && !state->disable_output)
00818 {
00819 if (_sanity(*_sfile_,_line_))
00820 stack->flags &= ~SANITY_CHECK_ON;
00821 }
00822 #endif
00823 #ifndef THREAD
00824 if (DoProfile ())
00825 (void) fprintf (_db_pfp_, PROF_XFMT, Clock(), state->func);
00826 #endif
00827 if (DoTrace (state))
00828 {
00829 DoPrefix (_line_);
00830 Indent (state->level);
00831 (void) fprintf (_db_fp_, "<%s\n", state->func);
00832 }
00833 }
00834 dbug_flush(state);
00835 }
00836 state->level = *_slevel_-1;
00837 state->func = *_sfunc_;
00838 state->file = *_sfile_;
00839 #ifndef THREAD
00840 if (state->framep != NULL)
00841 state->framep = (char **) *state->framep;
00842 #endif
00843 errno=save_errno;
00844 }
00845 }
|
|
|
|
|
|
01254 {
01255 if (stack -> keywords == NULL)
01256 return FALSE;
01257 return _db_keyword_ (keyword);
01258 }
|
|
|
02024 {
02025 CODE_STATE *state;
02026 state=code_state();
02027 state->locked=0;
02028 pthread_mutex_unlock(&THR_LOCK_dbug);
02029 }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1.3.9.1