@ -920,3 +920,14 @@ bool SHMProcess::Private::Aux_Core_Attach(bool & versionOK, pid_t & PID)
#endif
return true;
}
string SHMProcess::getPath()
{
char cwd_name[256];
char target_name[1024];
int target_result;
sprintf(cwd_name,"/proc/%d/cwd", getPID());
// resolve /proc/PID/exe link
target_result = readlink(cwd_name, target_name, sizeof(target_name));
return(string(target_name));
@ -637,4 +637,15 @@ string WineProcess::readClassName (uint32_t vptr)
string raw = readCString(typeinfo + 0xC); // skips the .?AV
raw.resize(raw.length() - 2);// trim @@ from end
return raw;
string WineProcess::getPath()
@ -586,3 +586,14 @@ string NormalProcess::readClassName (uint32_t vptr)
size_t end = raw.length();
return raw.substr(start,end-start);
string NormalProcess::getPath()
@ -368,7 +368,7 @@ namespace DFHack
// get the SHM start if available
char * getSHMStart (void){return 0;};
bool SetAndWait (uint32_t state){return false;};
std::string getPath() {return std::string()}; //FIXME should be pretty trival
std::string getPath();
};