#NEWLINE# @ wrap_exceptions #NEWLINE# def memory_maps( self ) : #NEWLINE# #INDENT# def toaddr( start , end ) : #NEWLINE# #INDENT# return ( '%s-%s' % ( hex ( start ) [ 2 : ] . strip ( 'L' ) , hex ( end ) [ 2 : ] . strip ( 'L' ) ) ) #NEWLINE# #UNINDENT# procfs_path = self . _procfs_path #NEWLINE# retlist = [ ] #NEWLINE# rawlist = cext . proc_memory_maps ( self . pid , procfs_path ) #NEWLINE# hit_enoent = False #NEWLINE# for item in rawlist : #NEWLINE# #INDENT# ( addr , addrsize , perm , name , rss , anon , locked ) = item #NEWLINE# addr = toaddr ( addr , addrsize ) #NEWLINE# if ( not name . startswith ( '[' ) ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# name = os . readlink ( ( '%s/%s/path/%s' % ( procfs_path , self . pid , name ) ) ) #NEWLINE# #UNINDENT# except OSError as err : #NEWLINE# #INDENT# if ( err . errno == errno . ENOENT ) : #NEWLINE# #INDENT# name = ( '%s/%s/path/%s' % ( procfs_path , self . pid , name ) ) #NEWLINE# hit_enoent = True #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# retlist . append ( ( addr , perm , name , locked , anon , locked ) ) #NEWLINE# #UNINDENT# if hit_enoent : #NEWLINE# #INDENT# os . stat ( ( '%s/%s' % ( procfs_path , self . pid ) ) ) #NEWLINE# #UNINDENT# return retlist