bool KeySymbol::matches( dr_handle hdl, const char * name ) //--------------------------------------------------------- // perform a partial comparison (no containers) { dr_sym_type type; type = DRGetSymType( hdl ); if( !(SymTypeConvert[ type ] & _searchFor) ) { return( FALSE ); } if( !_anonymous ) { if( name == NULL || *name == 0 ) { return( FALSE ); } } if( !_artificial ) { if( DRIsArtificial( hdl ) ) { return( FALSE ); } } if( !_declaration ) { if( !DRIsSymDefined( hdl ) ) { return( FALSE ); } } if( _nameProg ) { if( name ) { if( !RegExec( (regexp *) _nameProg, (char *) name, TRUE ) ) { return( FALSE ); } } else { if( !RegExec( (regexp *) _nameProg, "", TRUE ) ) { return( FALSE ); } } } if( !_fileFilter->matches( hdl ) ) { return FALSE; } return( TRUE ); }
static bool AMemLookup( dr_handle var, int index, void *_d ) /**********************************************************/ { type_wlk_lookup *d = _d; imp_sym_handle *is; char *name; unsigned len; name = DRGetName( var ); if( name == NULL ) { DCStatus( DS_FAIL ); return( FALSE ); } len = strlen( name ); if( len == d->li->name.len && d->comp( name, d->li->name.start, len ) == 0 ) { is = DCSymCreate( d->com.ii, d->com.d ); SetSymHandle( (type_wlk *)d, is ); is->sym = var; switch( index ) { case 0: is->sclass = SYM_MEM; break; case 2: is->sclass = SYM_MEMVAR; // static member break; case 3: if( DRGetVirtuality( var ) == DR_VIRTUALITY_VIRTUAL ) { is->sclass = SYM_VIRTF; // virtual func } else if( !DRIsSymDefined( var ) ) { is->sclass = SYM_MEMF; // memfunc decl } else { is->sclass = SYM_MEMVAR; // inlined defn treat like a var } break; } d->sr = SR_EXACT; } DCFree( name ); return( TRUE ); }
static bool AMem( dr_handle var, int index, void *_d ) /****************************************************/ { type_wlk_wlk *d = _d; bool cont; imp_sym_handle *is; dr_dbg_handle saved; cont = TRUE; is = d->is; SetSymHandle( (type_wlk *)d, is ); is->sym = var; switch( index ) { case 0: is->sclass = SYM_MEM; break; case 2: is->sclass = SYM_MEMVAR; // static member break; case 3: if( DRGetVirtuality( var ) == DR_VIRTUALITY_VIRTUAL ) { is->sclass = SYM_VIRTF; // virtual func } else if( !DRIsSymDefined( var ) ) { is->sclass = SYM_MEMF; // memfunc decl } else { is->sclass = SYM_MEMVAR; // inlined defn treat like a var } break; } saved = DRGetDebug(); d->wr = d->wk( d->com.ii, SWI_SYMBOL, is, d->com.d ); DRSetDebug( saved ); if( d->wr != WR_CONTINUE ) { cont = FALSE; } return( cont ); }
bool KeySymbol::matches( dr_sym_context * ctxt ) //---------------------------------------------- { bool accept; char * container; if( !(SymTypeConvert[ ctxt->type ] & _searchFor) ) { return( FALSE ); } if( !_anonymous ) { if( ctxt->name == NULL || *ctxt->name == 0 ) { return( FALSE ); } } if( !_artificial ) { if( DRIsArtificial( ctxt->handle ) ) { return( FALSE ); } } if( !_declaration ) { if( !DRIsSymDefined( ctxt->handle ) ) { return( FALSE ); } } if( _nameProg && ctxt->name ) { if( ctxt->name ) { if( !RegExec( (regexp *) _nameProg, ctxt->name, TRUE ) ) { return( FALSE ); } } else { if( !RegExec( (regexp *) _nameProg, "", TRUE ) ) { return( FALSE ); } } } if( _contClassProg ) { if( ctxt->context->classhdl ) { container = DRGetName( ctxt->context->classhdl ); if( container ) { accept = (bool) RegExec( (regexp *) _contClassProg, container, TRUE ); WBRFree( container ); if( !accept ) { return( FALSE ); } } else { if( !RegExec( (regexp *) _contClassProg, "", TRUE ) ) { return( FALSE ); } } } else { return( FALSE ); // not local to anything } } if( _contFunctionProg ) { if( ctxt->context->functionhdl ) { container = DRGetName( ctxt->context->functionhdl ); if( container ) { accept = (bool) RegExec( (regexp *) _contFunctionProg, container, TRUE ); WBRFree( container ); if( !accept ) { return( FALSE ); } } else { if( !RegExec( (regexp *) _contFunctionProg, "", TRUE ) ) { return( FALSE ); } } } else { return( FALSE ); // not local to anything } } if( !_fileFilter->matches( ctxt->handle ) ) { return FALSE; } return( TRUE ); }