- MyString fn = PROCNAME;
- static char sProcessSize[ 12 ] = { 0 };
- std::pair< const char *, bool > dataSect[ 3 ];
- dataSect[ 0 ] = std::make_pair( MYBINARYNAME, false );
- dataSect[ 1 ] = std::make_pair( MYLIBRARYNAME, false );
- dataSect[ 2 ] = std::make_pair( MYALLOCNAME, false );
- static pid_t sProcID = 0;
- if( 0 == sProcID ) {
- sProcID = getpid();
- sprintf( sProcessSize, "%d", sProcID );
- }
- fn.replace( REPLACEPOS, 1, sProcessSize );
- std::ifstream procName( fn.c_str() );
- if( procName.is_open() ){
- MyString line;
- while( procName.good() ){
- getline( procName, line );
- int i = 0;
- for( i = 0; i < 3; ++i ){
- if( MyString::npos != line.find( dataSect[ i ].first ) ) break;
- }
- if( i >= 3 || dataSect[ i ].second == true ) continue;
- dataSect[ i ].second = true;
- if( !procName.good() )return;
- getline( procName, line );
- takeSegmentSnapshot( line );
- }
- }
+ MyString fn = PROCNAME;
+ static char sProcessSize[ 12 ] = { 0 };
+ std::pair< const char *, bool > dataSect[ 3 ];
+ dataSect[ 0 ] = std::make_pair( MYBINARYNAME, false );
+ dataSect[ 1 ] = std::make_pair( MYLIBRARYNAME, false );
+ dataSect[ 2 ] = std::make_pair( MYALLOCNAME, false );
+ static pid_t sProcID = 0;
+ if( 0 == sProcID ) {
+ sProcID = getpid();
+ sprintf( sProcessSize, "%d", sProcID );
+ }
+ fn.replace( REPLACEPOS, 1, sProcessSize );
+ std::ifstream procName( fn.c_str() );
+ if( procName.is_open() ){
+ MyString line;
+ while( procName.good() ){
+ getline( procName, line );
+ int i = 0;
+ for( i = 0; i < 3; ++i ){
+ if( MyString::npos != line.find( dataSect[ i ].first ) ) break;
+ }
+ if( i >= 3 || dataSect[ i ].second == true ) continue;
+ dataSect[ i ].second = true;
+ if( !procName.good() )return;
+ getline( procName, line );
+ takeSegmentSnapshot( line );
+ }
+ }