MCPcopy Create free account
hub / github.com/fabioz/PyDev.Debugger / match_name

Method match_name

pydevd_attach_to_process/winappdbg/module.py:352–381  ·  view source on GitHub ↗

@rtype: bool @return: C{True} if the given name could refer to this module. It may not be exactly the same returned by L{get_name}.

(self, name)

Source from the content-addressed store, hash-verified

350 return modName
351
352 def match_name(self, name):
353 """
354 @rtype: bool
355 @return:
356 C{True} if the given name could refer to this module.
357 It may not be exactly the same returned by L{get_name}.
358 """
359
360 # If the given name is exactly our name, return True.
361 # Comparison is case insensitive.
362 my_name = self.get_name().lower()
363 if name.lower() == my_name:
364 return True
365
366 # If the given name is a base address, compare it with ours.
367 try:
368 base = HexInput.integer(name)
369 except ValueError:
370 base = None
371 if base is not None and base == self.get_base():
372 return True
373
374 # If the given name is a filename, convert it to a module name.
375 # Then compare it with ours, case insensitive.
376 modName = self.__filename_to_modname(name)
377 if modName.lower() == my_name:
378 return True
379
380 # No match.
381 return False
382
383 # ------------------------------------------------------------------------------
384

Callers 3

resolve_labelMethod · 0.95
_notify_load_dllMethod · 0.80

Calls 4

get_nameMethod · 0.95
get_baseMethod · 0.95
__filename_to_modnameMethod · 0.95
integerMethod · 0.45

Tested by

no test coverage detected