diff options
author | Bhushan D. Attarde <Bhushan.Attarde@imgtec.com> | 2016-01-27 10:16:30 +0000 |
---|---|---|
committer | Bhushan D. Attarde <Bhushan.Attarde@imgtec.com> | 2016-01-27 10:16:30 +0000 |
commit | df5f0b448cc10e4877f319e9ddd4704fd389f418 (patch) | |
tree | 980dff3690dd64fec4c367716e67818e9707b4d0 /lldb/packages/Python/lldbsuite/test/lldbtest.py | |
parent | 5e45630edfbca796d662253ed25f0538cbfef948 (diff) | |
download | bcm5719-llvm-df5f0b448cc10e4877f319e9ddd4704fd389f418.tar.gz bcm5719-llvm-df5f0b448cc10e4877f319e9ddd4704fd389f418.zip |
[LLDB][MIPS] A small fix in GetBreakableLoadAddress() for MIPS
SUMMARY:
Get the load address for the address given by symbol and function.
Earlier, this was done for function only, this patch does it for symbol too.
This patch also adds TestAvoidBreakpointInDelaySlot.py to test this change.
Reviewers: clayborg
Subscribers: labath, zturner, mohit.bhakkad, sagar, jaydeep, lldb-commits
Differential Revision: http://reviews.llvm.org/D16049
llvm-svn: 258919
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/lldbtest.py')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/lldbtest.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py b/lldb/packages/Python/lldbsuite/test/lldbtest.py index 015615bd875..c57279c8d02 100644 --- a/lldb/packages/Python/lldbsuite/test/lldbtest.py +++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py @@ -636,6 +636,14 @@ def check_list_or_lambda(list_or_lambda, value): else: return list_or_lambda is None or value is None or list_or_lambda == value +def matchArchitectures(archs, actual_arch): + retype = type(re.compile('hello, world')) + list_passes = isinstance(archs, list) and actual_arch in archs + basestring_passes = isinstance(archs, basestring) and actual_arch == archs + regex_passes = isinstance(archs, retype) and re.match(archs, actual_arch) + + return (list_passes or basestring_passes or regex_passes) + # provide a function to xfail on defined oslist, compiler version, and archs # if none is specified for any argument, that argument won't be checked and thus means for all # for example, @@ -1029,7 +1037,7 @@ def skipUnlessHostPlatform(oslist): return unittest2.skipUnless(getHostPlatform() in oslist, "requires on of %s" % (", ".join(oslist))) -def skipUnlessArch(archlist): +def skipUnlessArch(archs): """Decorate the item to skip tests unless running on one of the listed architectures.""" def myImpl(func): if isinstance(func, type) and issubclass(func, unittest2.TestCase): @@ -1038,9 +1046,8 @@ def skipUnlessArch(archlist): @wraps(func) def wrapper(*args, **kwargs): self = args[0] - if self.getArchitecture() not in archlist: - self.skipTest("skipping for architecture %s (requires one of %s)" % - (self.getArchitecture(), ", ".join(archlist))) + if not matchArchitectures(archs, self.getArchitecture()): + self.skipTest("skipping for architecture %s" % (self.getArchitecture())) else: func(*args, **kwargs) return wrapper |