code: def extract_filename(self):
      
      globals_gdbval = self._gdbval['f_globals'].cast(GdbCache.DICT)
      global_dict = libpython.PyDictObjectPtr(globals_gdbval)
      for key, value in global_dict.iteritems():
        if str(key.proxyval(set())) == '__file__':
          return str(value.proxyval(set()))
docs: Alternative way of getting the executed file which inspects globals.