extern dig_fhandle PathOpen( char * name, unsigned len, char * ext ) /******************************************************************/ { char path[ _MAX_PATH2 ]; return( FullPathOpen( name, ext, path, sizeof( path ) ) ); }
static void DoDownLoadCode( void ) /********************************/ { file_handle fh; if( !DownLoadTask ) return; fh = FullPathOpen( TaskCmd, strlen( TaskCmd ), "exe", TxtBuff, TXT_LEN ); if( fh == NIL_HANDLE ) { Error( ERR_NONE, LIT_ENG( ERR_FILE_NOT_OPEN ), TaskCmd ); } FileClose( fh ); FindLocalDebugInfo( TxtBuff ); CopyToRemote( TxtBuff, SkipPathInfo( TxtBuff, OP_LOCAL ), true, NULL ); }
void FindLocalDebugInfo( const char *name ) { char *buff, *symfile; size_t len; file_handle fh; len = strlen( name ); _AllocA( buff, len + 1 + 4 + 2 ); _AllocA( symfile, len + 1 + 4 ); strcpy( buff, "@l" ); // If a .sym file is present, use it in preference to the executable fh = FullPathOpen( name, ExtPointer( name, OP_LOCAL ) - name, "sym", symfile, len + 4 ); if( fh != NIL_HANDLE ) { strcat( buff, symfile ); FileClose( fh ); } else { strcat( buff, name ); } InsertRing( RingEnd( &LocalDebugInfo ), buff, strlen( buff ), false ); }
void FindLocalDebugInfo( const char *name ) { char *buff, *symname; unsigned len; handle local; len = strlen( name ); _AllocA( buff, len + 1 + 4 + 2 ); _AllocA( symname, len + 1 + 4 ); strcpy( buff, "@l" ); // If a .sym file is present, use it in preference to the executable local = FullPathOpen( name, ExtPointer( name, OP_LOCAL ) - name, "sym", symname, len + 4 ); if( local != NIL_HANDLE ) { strcat( buff, symname ); FileClose( local ); } else { strcat( buff, name ); } InsertRing( RingEnd( &LocalDebugInfo ), buff, strlen( buff ), FALSE ); }