本文整理汇总了C++中DRSetDebug函数的典型用法代码示例。如果您正苦于以下问题:C++ DRSetDebug函数的具体用法?C++ DRSetDebug怎么用?C++ DRSetDebug使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DRSetDebug函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DIPImpTypeBase
dip_status DIGENTRY DIPImpTypeBase( imp_image_handle *ii,
imp_type_handle *it, imp_type_handle *base,
location_context *lc, location_list *ll )
{
dr_handle btype;
lc = lc;
ll = ll;
/*
Given an implementation type handle, fill in 'base' with the
base type of the handle.
*/
if( base != it ) {
*base = *it;
}
DRSetDebug( ii->dwarf->handle ); /* must do at each call into dwarf */
if( base->state == DF_SET && base->sub_array ) {
base->array.index = GetArrayDim( base->array.index, 1 );
if( base->array.is_based ) {
base->array.is_set = FALSE;
}
base->array.is_based = TRUE;
if( base->array.index != DR_HANDLE_NUL ) {
return( DS_OK );
}
}
btype = DRSkipTypeChain( base->type ); /* skip modifiers and typedefs */
base->type = DRGetTypeAT( btype ); /* get base type */
if( base->type == DR_HANDLE_NUL ) {
base->type = DR_HANDLE_VOID; /* no type means 'void' */
}
base->state = DF_NOT;
return( DS_OK );
}
示例2: DIPImpTypeProcInfo
dip_status DIGENTRY DIPImpTypeProcInfo( imp_image_handle *ii,
imp_type_handle *proc, imp_type_handle *parm, unsigned n )
{
dr_handle btype;
dr_handle parm_type = DR_HANDLE_NUL;
dip_status ret;
DRSetDebug( ii->dwarf->handle ); /* must do at each call into dwarf */
btype = DRSkipTypeChain( proc->type ); /* skip modifiers and typedefs */
if( n > 0 ) {
btype = GetParmN( ii, btype, n );
}// if n == 0 just fall through and get type of function
if( btype != DR_HANDLE_NUL ) {
parm_type = DRGetTypeAT( btype ); /* get type */
}
if( parm_type != DR_HANDLE_NUL ) {
parm->state = DF_NOT;
parm->type = parm_type;
parm->im = proc->im;
ret = DS_OK;
} else {
ret = DS_FAIL;
}
return( ret );
}
示例3: ACueFileNum
static bool ACueFileNum( void *_fc, dr_line_file *curr )
/******************************************************/
{
file_walk_cue *fc = _fc;
bool cont;
imp_cue_handle *ic;
dr_dbg_handle saved;
ic = fc->ic;
ic->a = NilAddr;
ic->im = fc->im;
if( FirstCue( fc->stmts, curr->index, ic ) ) {
ic->fno = curr->index;
ic->line = 1;
ic->col = 0;
}
saved = DRGetDebug();
fc->wr = fc->wk( fc->ii, ic, fc->d );
DRSetDebug( saved );
if( fc->wr == WR_CONTINUE ) {
cont = true;
} else {
cont = false;
}
return( cont );
}
示例4: REQUIRE
void Module::setModule()
//----------------------
// tell the dwarf library that we are reading out of this module
{
REQUIRE( _dataFile->isInitialized(), "Module::setModule - not initialized" );
DRSetDebug( _dbgInfo );
}
示例5: status
/*
Adjust the 'src' cue by 'adj' amount and return the result in 'dst'.
That is, If you get called with "DIPImpCueAdjust( ii, src, 1, dst )",
the 'dst' handle should be filled in with implementation cue handle
representing the source cue immediately following the 'src' cue.
Passing in an 'adj' of -1 will get the immediately preceeding source
cue. The list of source cues for each file are considered a ring,
so if 'src' is the first cue in a file, an 'adj' of -1 will return
the last source cue FOR THAT FILE. The cue adjust never crosses a
file boundry. Also, if 'src' is the last cue in a file, and 'adj' of
1 will get the first source cue FOR THAT FILE. If an adjustment
causes a wrap from begining to end or vice versa, you should return
DS_WRAPPED status (NOTE: DS_ERR should *not* be or'd in, nor should
DCStatus be called in this case). Otherwise DS_OK should be returned
unless an error occurred.
*/
dip_status DIPENTRY DIPImpCueAdjust( imp_image_handle *ii,
imp_cue_handle *src, int adj, imp_cue_handle *dst )
/*****************************************************************/
{
dr_handle stmts;
dfline_search start_state;
dfline_find find;
dip_status ret;
imp_mod_handle imx;
cue_item cue;
cue_list *cue_map;
address map_addr;
imx = src->imx;
DRSetDebug( ii->dwarf->handle ); /* must do at each call into DWARF */
stmts = ii->mod_map[imx].stmts;
if( stmts == 0 ) {
DCStatus( DS_FAIL );
return( DS_ERR|DS_FAIL );
}
cue_map= ii->cue_map;
if( cue_map->imx != imx ) {
ResetCueInfo( cue_map );
cue_map->imx = imx;
map_addr = NilAddr;
LoadCueMap( stmts, &map_addr, cue_map );
}
if( adj < 0 ) {
start_state = LOOK_LOW;
adj = -adj;
} else {
start_state = LOOK_HIGH;
}
cue.fno = src->fno;
cue.line = src->line;
cue.col = src->col;
while( 0 != adj ) {
find = FindCue( cue_map, &cue, start_state );
if( find == LINE_NOT ) break;
--adj;
}
dst->imx = imx;
dst->fno = cue.fno;
dst->line = cue.line;
dst->col = cue.col;
dst->a.mach = cue.mach;
switch( find ) {
case LINE_NOT:
DCStatus( DS_FAIL );
ret = DS_ERR | DS_FAIL;
break;
case LINE_WRAPPED:
ret = DS_WRAPPED;
break;
case LINE_FOUND:
ret = DS_OK;
break;
}
return( ret );
}
示例6: DIPImpWalkFileList
walk_result DIPENTRY DIPImpWalkFileList( imp_image_handle *ii,
imp_mod_handle im, IMP_CUE_WKR *wk, imp_cue_handle *ic,
void *d )
/*************************************************************************/
{
file_walk_cue wlk;
im_idx imx;
dr_handle stmts;
imx = IM2IMX( im );
DRSetDebug( ii->dwarf->handle ); /* must do at each call into DWARF */
stmts = ii->mod_map[imx].stmts;
if( stmts == 0 ) {
DCStatus( DS_FAIL );
return( WR_CONTINUE );
}
wlk.stmts = stmts;
wlk.ii = ii;
wlk.imx = imx;
wlk.wk = wk;
wlk.ic = ic;
wlk.d = d;
wlk.wr = WR_CONTINUE;
DRWalkLFiles( stmts, ACueFileNum, &wlk, ACueDir, NULL );
return( wlk.wr );
}
示例7: ACueFileNum
static int ACueFileNum( void *_fc, dr_line_file *curr )
/*****************************************************/
{
file_walk_cue *fc = _fc;
int cont;
imp_cue_handle *ic;
dr_dbg_handle saved;
ic = fc->ic;
DCFree( curr->name );
ic->a = NilAddr;
ic->imx = fc->imx;
if( FirstCue( fc->stmts, curr->index, ic ) ) {
ic->fno = curr->index;
ic->line = 1;
ic->col = 0;
}
saved = DRGetDebug();
fc->wr = fc->wk( fc->ii, ic, fc->d );
DRSetDebug( saved );
if( fc->wr == WR_CONTINUE ) {
cont = TRUE;
} else {
cont = FALSE;
}
return( cont );
}
示例8: AInherit
static bool AInherit( dr_handle inh, int index, void *_d )
/********************************************************/
{
//TODO: Need to track virtual base as not to visit same place twice
type_wlk_wlk *d = _d;
bool cont;
dr_handle btype;
dr_handle old_inh;
imp_sym_handle *is;
dr_dbg_handle saved;
walk_result wr;
index = index;
cont = TRUE;
btype = DRGetTypeAT( inh );
btype = DRSkipTypeChain( btype ); /* skip modifiers and typedefs */
if( DRGetVirtuality( inh ) == DR_VIRTUALITY_VIRTUAL ) {
if( !AddBase( btype, &d->com.vbase ) ) {
return( cont );
}
}
is = d->is;
SetSymHandle( (type_wlk *)d, is );
is->sym = inh;
is->sclass = SYM_MEM; // treat inherit like a var
saved = DRGetDebug();
wr = d->wk( d->com.ii, SWI_INHERIT_START, is, d->com.d );
DRSetDebug( saved );
if( wr == WR_CONTINUE ) {
old_inh = d->com.inh;
d->com.inh = inh;
DRWalkStruct( btype, StrucWlk, d );
d->com.inh = old_inh;
saved = DRGetDebug();
d->wk( d->com.ii, SWI_INHERIT_END, NULL, d->com.d );
DRSetDebug( saved );
if( d->wr != WR_CONTINUE ) {
cont = FALSE;
}
}
return( cont );
}
示例9: SearchMbr
search_result SearchMbr( imp_image_handle *ii, imp_type_handle *it, lookup_item *li, void *d )
//Search for matching lookup item
{
dr_handle btype;
type_wlk_lookup df;
df_cleaner cleanup;
DRSetDebug( ii->dwarf->handle ); /* must do at each call into dwarf */
if( it->state == DF_NOT ) {
if( DRGetTypeInfo( it->type, &it->typeinfo ) ) {
it->state = DF_SET;
}
}
if( it->state == DF_NOT ) {
return( SR_NONE );
}
df.com.im = it->im;
df.com.ii = ii;
df.com.d = d;
df.com.root = it->type;
df.com.inh = DR_HANDLE_NUL;
df.com.vbase = NULL;
cleanup.rtn = FreeBases; //push cleanup
cleanup.d = &df.com.vbase;
cleanup.prev = Cleaners;
Cleaners = &cleanup;
btype = DRSkipTypeChain( it->type );
if( li->case_sensitive ) {
df.comp = memcmp;
} else {
df.comp = memicmp;
}
df.li = li;
df.sr = SR_NONE;
switch( it->typeinfo.kind ) {
case DR_TYPEK_ENUM:
df.com.sclass = SYM_ENUM;
df.com.einfo.size = it->typeinfo.size;
df.com.einfo.sign = it->typeinfo.modifier.sign;
DRWalkEnum( btype, AEnumMemLookup, &df );
break;
case DR_TYPEK_STRUCT:
case DR_TYPEK_UNION:
case DR_TYPEK_CLASS:
df.com.sclass = SYM_MEM;
DRWalkStruct( btype, StrucWlkLookup, &df );
break;
default:
DCStatus( DS_ERR | DS_BAD_PARM );
df.sr = SR_FAIL;
}
FreeBases( &df.com.vbase ); // free virtual base list
Cleaners = cleanup.prev; // pop cleanup
return( df.sr );
}
示例10: GetParmCount
extern int GetParmCount( imp_image_handle *ii, dr_handle proc ) {
/******************************************************/
// return handle of the n parm
parm_wlk df;
df.count = 0;
df.last = 0;
DRSetDebug( ii->dwarf->handle ); /* must do at each call into dwarf */
DRWalkBlock( proc, DR_SRCH_parm, AParm, (void *)&df );
return( df.count );
}
示例11: WalkTypeSymList
extern walk_result WalkTypeSymList( imp_image_handle *ii, imp_type_handle *it,
IMP_SYM_WKR *wk, imp_sym_handle *is, void *d ) {
dr_handle btype;
type_wlk_wlk df;
df_cleaner cleanup;
DRSetDebug( ii->dwarf->handle ); /* must do at each call into dwarf */
if( it->state == DF_NOT ) {
if( DRGetTypeInfo( it->type, &it->typeinfo ) ) {
it->state = DF_SET;
}
}
if( it->state == DF_NOT ) {
return( WR_STOP );
}
df.com.im = it->im;
df.com.ii = ii;
df.com.d = d;
df.com.root = it->type;
df.com.inh = DR_HANDLE_NUL;
df.com.vbase = NULL;
cleanup.rtn = FreeBases; //push cleanup
cleanup.d = &df.com.vbase;
cleanup.prev = Cleaners;
Cleaners = &cleanup;
btype = DRSkipTypeChain( it->type );
df.is = is;
df.wk = wk;
df.wr = WR_CONTINUE;
switch( it->typeinfo.kind ) {
case DR_TYPEK_ENUM:
df.com.sclass = SYM_ENUM;
df.com.einfo.size = it->typeinfo.size;
df.com.einfo.sign = it->typeinfo.modifier.sign;
DRWalkEnum( btype, AEnumMem, &df );
break;
case DR_TYPEK_STRUCT:
case DR_TYPEK_UNION:
case DR_TYPEK_CLASS:
df.com.sclass = SYM_MEM;
DRWalkStruct( btype, StrucWlk, &df );
break;
default:
DCStatus( DS_ERR | DS_BAD_PARM );
df.wr = WR_STOP;
}
FreeBases( &df.com.vbase ); // free virtual base list
Cleaners = cleanup.prev; // pop cleanup
return( df.wr );
}
示例12: DIPIMPENTRY
size_t DIPIMPENTRY( CueFile )( imp_image_handle *ii, imp_cue_handle *ic,
char *buff, size_t buff_size )
/************************************************************************/
{
char *name;
file_walk_name wlk;
size_t len;
drmem_hdl stmts;
drmem_hdl cu_tag;
int i;
mod_info *modinfo;
DRSetDebug( ii->dwarf->handle ); /* must do at each call into dwarf */
modinfo = IMH2MODI( ii, ic->im );
stmts = modinfo->stmts;
cu_tag = modinfo->cu_tag;
if( stmts == DRMEM_HDL_NULL || cu_tag == DRMEM_HDL_NULL ) {
DCStatus( DS_FAIL );
return( 0 );
}
wlk.index = ic->fno;
wlk.ret = NULL;
wlk.num_dirs = 0;
wlk.dirs = NULL;
DRWalkLFiles( stmts, ACueFile, &wlk, ACueDir, &wlk );
name = wlk.ret;
// Free directory and file table information
for( i = 0; i < wlk.num_dirs; i++ ) {
DCFree( wlk.dirs[i].name );
}
DCFree( wlk.dirs );
if( name == NULL ) {
DCStatus( DS_FAIL );
return( 0 );
}
// If compilation unit has a DW_AT_comp_dir attribute, we need to
// stuff that in front of the file pathname, unless that is absolute
len = DRGetCompDirBuff( cu_tag, buff, buff_size );
if( ( len > 1 ) && IsRelPathname( name ) ) { // Ignore empty comp dirs
len = NameCopy( buff, "/", buff_size, len );
} else {
len = 0;
}
len = NameCopy( buff, name, buff_size, len );
DCFree( name );
return( len );
}
示例13: finf
Module::Module( const char *name, WCValSList<String> & enabled,
WCValSList<String> & disabled )
//------------------------------------------------------------
{
WCPtrOrderedVector<ComponentFile> components;
FileInfo finf( name );
int i;
MsgRetType ret;
_dataFile = new ElfFile( name, false );
DwarfFileMerger merger( name, enabled, disabled );
if( !merger.upToDate() ) {
if( !finf.exists() ) {
merger.doMerge();
} else {
if( enabled.entries() != 0 ) {
ret = WMessageDialog::messagef( topWindow,
MsgQuestion, MsgYesNo, "Source Browser",
"Database %s is not consistent with module files.\n"
"Merge the database now?", name );
if( ret == MsgRetYes ) {
merger.doMerge();
}
}
}
}
_dataFile->initSections();
_dataFile->getEnabledComponents( &components );
for( i = 0; i < components.entries(); i += 1 ) {
_enabledFiles.add( new WFileName( components[i]->name ) );
}
components.clear();
_dataFile->getDisabledComponents( &components );
for( i = 0; i < components.entries(); i += 1 ) {
_disabledFiles.add( new WFileName( components[i]->name ) );
}
checkSourceTime();
_dbgInfo = DRDbgInit( this, _dataFile->getDRSizes(), false );
DRSetDebug( _dbgInfo );
}
示例14: GetParmN
extern dr_handle GetParmN( imp_image_handle *ii,dr_handle proc, int count ) {
/******************************************************/
// return handle of the n parm
parm_wlk df;
dr_handle ret;
df.count = 0;
df.last = count;
DRSetDebug( ii->dwarf->handle ); /* must do at each call into dwarf */
if( DRWalkBlock( proc, DR_SRCH_parm, AParm, (void *)&df ) ) {
ret = DR_HANDLE_NUL;
} else {
ret = df.var;
}
return( ret );
}
示例15: GetParmN
drmem_hdl GetParmN( imp_image_handle *ii, drmem_hdl proc, int count )
/******************************************************/
// return handle of the n parm
{
parm_wlk df;
drmem_hdl ret;
df.count = 0;
df.last = count;
DRSetDebug( ii->dwarf->handle ); /* must do at each call into dwarf */
if( DRWalkBlock( proc, DR_SRCH_parm, AParm, (void *)&df ) ) {
ret = DRMEM_HDL_NULL;
}else{
ret = df.var;
}
return( ret );
}