Skip to content

Commit

Permalink
Strip current dir from paths.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrfonseca committed May 7, 2014
1 parent 5f1a3fa commit 5664b64
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion memtrail
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ class Symbol(object):
None: None,
}

_cwd = os.getcwd() + os.path.sep

__slots__ = [
'addr',
'modulePath',
Expand Down Expand Up @@ -215,7 +217,9 @@ class Symbol(object):
if moduleName != 'libmemtrail.so':
filename, lineNo = self._line.split(':', 1)
if filename != NO_FUNCTION:
return '%s [%s]' % (self._function, self._line)
if filename.startswith(self._cwd):
filename = filename[len(self._cwd):]
return '%s [%s:%s]' % (self._function, filename, lineNo)
return self._function
elif self.modulePath is not None:
return '%s+0x%x' % (self.modulePath, self.offset)
Expand Down

0 comments on commit 5664b64

Please sign in to comment.