static void ImgMenuItem( a_window *wnd, gui_ctl_id id, int row, int piece ) { image_entry *img; char *new_name; char *old_name; piece=piece; img = ImgGetImage( row ); switch( id ) { case MENU_INITIALIZE: WndMenuGrayAll( wnd ); if( img != NULL ) { if( img->dip_handle == NO_MOD ) { WndMenuEnable( wnd, MENU_IMAGE_ADD_SYMBOLS, TRUE ); } else { WndMenuEnableAll( wnd ); } } break; case MENU_IMAGE_ADD_SYMBOLS: // nyi - change sym_file if( img->deferred_symbols ) { ReLoadSymInfo( img ); } else { new_name = DupStr( ImgSymName( img, TRUE ) ); if( !SymBrowse( &new_name ) ) { _Free( new_name ); } else { UnLoadSymInfo( img, TRUE ); old_name = img->sym_name; img->sym_name = new_name; if( ReLoadSymInfo( img ) ) { _Free( old_name ); } else { img->sym_name = old_name; _Free( new_name ); } } } ImgInit( wnd ); break; case MENU_IMAGE_DEL_SYMBOLS: UnLoadSymInfo( img, TRUE ); ImgInit( wnd ); break; case MENU_IMAGE_SHOW_FUNCTIONS: WndGblFuncInspect( img->dip_handle ); break; case MENU_IMAGE_SHOW_MODULES: WndModListInspect( img->dip_handle ); break; case MENU_IMAGE_SHOW_GLOBALS: WndGblVarInspect( img->dip_handle ); break; } }
bool AddLibInfo( bool already_stopping, bool *force_stop ) { unsigned long module; bool added; bool deleted; image_entry *image; added = FALSE; deleted = FALSE; module = 0; while( (module = RemoteGetLibName( module, TxtBuff, TXT_LEN )) != 0 ) { if( TxtBuff[0] == NULLCHAR ) { deleted = TRUE; for( image = DbgImageList; image != NULL; image = image->link ) { if( image->system_handle == module ) { DUIImageLoaded( image, FALSE, already_stopping, force_stop ); UnLoadSymInfo( image, FALSE ); break; } } } else { added = TRUE; image = CreateImage( TxtBuff, NULL ); if( image != NULL ) { image->system_handle = module; if( ReLoadSymInfo( image ) ) { InitImageInfo( image ); } DUIImageLoaded( image, TRUE, already_stopping, force_stop ); } } } CheckSegAlias(); if( deleted ) { HookNotify( TRUE, HOOK_DLL_END ); } if( added ) { HookNotify( TRUE, HOOK_DLL_START ); } return( added ); }
bool LoadDeferredSymbols( void ) { image_entry *image; bool rc = FALSE; bool defer; defer = _IsOn( SW_DEFER_SYM_LOAD ); _SwitchOff( SW_DEFER_SYM_LOAD ); for( image = DbgImageList; image != NULL; image = image->link ) { if( image->deferred_symbols ) { if( ReLoadSymInfo( image ) ) { InitImageInfo( image ); image->deferred_symbols = FALSE; rc = TRUE; } } } if( defer ) _SwitchOn( SW_DEFER_SYM_LOAD ); return( rc ); }