Re: [Lldb-commits] [PATCH] D16508: NetBSD: Define initial RegisterContextNetBSD_x86_64
krytarowski added a comment. Thank you @clayborg for your notes. I'm planning to submit new version in the coming days. Repository: rL LLVM http://reviews.llvm.org/D16508 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D16293: [cmake] Make dependencies of lldb libraries private
labath added a comment. Ping? http://reviews.llvm.org/D16293 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r258800 - [RenderScript] Provide option to specify a single allocation to print
Author: ewancrawford Date: Tue Jan 26 04:41:08 2016 New Revision: 258800 URL: http://llvm.org/viewvc/llvm-project?rev=258800&view=rev Log: [RenderScript] Provide option to specify a single allocation to print Patch replaces the 'renderscript allocation list' command flag --refresh, with a new option --id . This new option only prints the details of a single allocation with a given id, rather than printing all the allocations. Functionality from the removed '--refresh' flag will be moved into its own command in a subsequent commit. Modified: lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h Modified: lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp?rev=258800&r1=258799&r2=258800&view=diff == --- lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp (original) +++ lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp Tue Jan 26 04:41:08 2016 @@ -2870,10 +2870,11 @@ RenderScriptRuntime::DumpAllocation(Stre return true; } -// Prints infomation regarding all the currently loaded allocations. +// Prints information regarding currently loaded allocations. // These details are gathered by jitting the runtime, which has as latency. +// Index parameter specifies a single allocation ID to print, or a zero value to print them all void -RenderScriptRuntime::ListAllocations(Stream &strm, StackFrame* frame_ptr, bool recompute) +RenderScriptRuntime::ListAllocations(Stream &strm, StackFrame *frame_ptr, const uint32_t index) { strm.Printf("RenderScript Allocations:"); strm.EOL(); @@ -2881,13 +2882,14 @@ RenderScriptRuntime::ListAllocations(Str for (auto &alloc : m_allocations) { -// JIT the allocation info if we haven't done it, or the user forces us to. -bool do_refresh = alloc->shouldRefresh() || recompute; +// index will only be zero if we want to print all allocations +if (index != 0 && index != alloc->id) +continue; // JIT current allocation information -if (do_refresh && !RefreshAllocation(alloc.get(), frame_ptr)) +if (alloc->shouldRefresh() && !RefreshAllocation(alloc.get(), frame_ptr)) { -strm.Printf("Error: Couldn't evaluate details for allocation %u\n", alloc->id); +strm.Printf("Error: Couldn't evaluate details for allocation %" PRIu32 "\n", alloc->id); continue; } @@ -3926,9 +3928,7 @@ public: class CommandOptions : public Options { public: -CommandOptions(CommandInterpreter &interpreter) : Options(interpreter), m_refresh(false) -{ -} +CommandOptions(CommandInterpreter &interpreter) : Options(interpreter), m_id(0) {} ~CommandOptions() override = default; @@ -3940,8 +3940,11 @@ public: switch (short_option) { -case 'r': -m_refresh = true; +case 'i': +bool success; +m_id = StringConvert::ToUInt32(option_arg, 0, 0, &success); +if (!success) +error.SetErrorStringWithFormat("invalid integer value for option '%c'", short_option); break; default: error.SetErrorStringWithFormat("unrecognized option '%c'", short_option); @@ -3953,7 +3956,7 @@ public: void OptionParsingStarting() override { -m_refresh = false; +m_id = 0; } const OptionDefinition* @@ -3963,7 +3966,7 @@ public: } static OptionDefinition g_option_table[]; -bool m_refresh; +uint32_t m_id; }; bool @@ -3971,7 +3974,7 @@ public: { RenderScriptRuntime *runtime = static_cast(m_exe_ctx.GetProcessPtr()->GetLanguageRuntime(eLanguageTypeExtRenderScript)); -runtime->ListAllocations(result.GetOutputStream(), m_exe_ctx.GetFramePtr(), m_options.m_refresh); +runtime->ListAllocations(result.GetOutputStream(), m_exe_ctx.GetFramePtr(), m_options.m_id); result.SetStatus(eReturnStatusSuccessFinishResult); return true; } @@ -3980,13 +3983,10 @@ private: CommandOptions m_options; }; -OptionDefinition -CommandObjectRenderScriptRuntimeAllocationList::CommandOptions::g_option_table[] = -{ -{ LLDB_OPT_SET_1, false, "refresh", 'r', OptionParser::eNoArgument, NULL, NULL, 0, eArgTypeNone, - "Recompute allocation details."}, -
Re: [Lldb-commits] [PATCH] D16293: [cmake] Make dependencies of lldb libraries private
Sorry for the delay, lgtm On Tue, Jan 26, 2016 at 1:59 AM Pavel Labath wrote: > labath added a comment. > > Ping? > > > http://reviews.llvm.org/D16293 > > > > ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D16293: [cmake] Make dependencies of lldb libraries private
zturner added a comment. Sorry for the delay, lgtm http://reviews.llvm.org/D16293 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r258819 - Update for LLVM change
Author: d0k Date: Tue Jan 26 10:45:00 2016 New Revision: 258819 URL: http://llvm.org/viewvc/llvm-project?rev=258819&view=rev Log: Update for LLVM change Modified: lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp Modified: lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp?rev=258819&r1=258818&r2=258819&view=diff == --- lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp (original) +++ lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp Tue Jan 26 10:45:00 2016 @@ -11,20 +11,20 @@ // C++ Includes // Project includes #include "llvm-c/Disassembler.h" +#include "llvm/ADT/SmallString.h" #include "llvm/MC/MCAsmInfo.h" #include "llvm/MC/MCContext.h" -#include "llvm/MC/MCDisassembler.h" -#include "llvm/MC/MCExternalSymbolizer.h" +#include "llvm/MC/MCDisassembler/MCDisassembler.h" +#include "llvm/MC/MCDisassembler/MCExternalSymbolizer.h" +#include "llvm/MC/MCDisassembler/MCRelocationInfo.h" #include "llvm/MC/MCInst.h" #include "llvm/MC/MCInstPrinter.h" #include "llvm/MC/MCInstrInfo.h" #include "llvm/MC/MCRegisterInfo.h" -#include "llvm/MC/MCRelocationInfo.h" #include "llvm/MC/MCSubtargetInfo.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/TargetRegistry.h" #include "llvm/Support/TargetSelect.h" -#include "llvm/ADT/SmallString.h" // Other libraries and framework includes #include "DisassemblerLLVMC.h" Modified: lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp?rev=258819&r1=258818&r2=258819&view=diff == --- lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp (original) +++ lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp Tue Jan 26 10:45:00 2016 @@ -17,7 +17,7 @@ #include "llvm/MC/MCAsmInfo.h" #include "llvm/MC/MCInst.h" #include "llvm/MC/MCInstrInfo.h" -#include "llvm/MC/MCDisassembler.h" +#include "llvm/MC/MCDisassembler/MCDisassembler.h" #include "llvm/MC/MCRegisterInfo.h" #include "llvm/MC/MCSubtargetInfo.h" #include "llvm/MC/MCContext.h" Modified: lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp?rev=258819&r1=258818&r2=258819&view=diff == --- lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp (original) +++ lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp Tue Jan 26 10:45:00 2016 @@ -17,7 +17,7 @@ #include "llvm/MC/MCAsmInfo.h" #include "llvm/MC/MCInst.h" #include "llvm/MC/MCInstrInfo.h" -#include "llvm/MC/MCDisassembler.h" +#include "llvm/MC/MCDisassembler/MCDisassembler.h" #include "llvm/MC/MCRegisterInfo.h" #include "llvm/MC/MCSubtargetInfo.h" #include "llvm/MC/MCContext.h" ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r258821 - Revert r258546.
Author: compnerd Date: Tue Jan 26 11:43:48 2016 New Revision: 258821 URL: http://llvm.org/viewvc/llvm-project?rev=258821&view=rev Log: Revert r258546. Seems that the patch was rebased on top of another change which obsoleted the change but wasnt caught. Thanks to nbjoerg for pointing this out! Modified: lldb/trunk/source/Expression/ExpressionSourceCode.cpp lldb/trunk/source/Target/Process.cpp Modified: lldb/trunk/source/Expression/ExpressionSourceCode.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ExpressionSourceCode.cpp?rev=258821&r1=258820&r2=258821&view=diff == --- lldb/trunk/source/Expression/ExpressionSourceCode.cpp (original) +++ lldb/trunk/source/Expression/ExpressionSourceCode.cpp Tue Jan 26 11:43:48 2016 @@ -119,7 +119,6 @@ public: default: return false; } -llvm_unreachable("unhandled state"); } private: Modified: lldb/trunk/source/Target/Process.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=258821&r1=258820&r2=258821&view=diff == --- lldb/trunk/source/Target/Process.cpp (original) +++ lldb/trunk/source/Target/Process.cpp Tue Jan 26 11:43:48 2016 @@ -1501,7 +1501,6 @@ Process::IsAlive () default: return false; } -llvm_unreachable("unhandled state"); } // This static callback can be used to watch for local child processes on ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [lldb] r258546 - Silence -Wreturn-type warnings
On Sat, Jan 23, 2016 at 3:24 PM, Joerg Sonnenberger wrote: > On Fri, Jan 22, 2016 at 08:26:30PM -, Saleem Abdulrasool via > lldb-commits wrote: > > Author: compnerd > > Date: Fri Jan 22 14:26:30 2016 > > New Revision: 258546 > > > > URL: http://llvm.org/viewvc/llvm-project?rev=258546&view=rev > > Log: > > Silence -Wreturn-type warnings > > > > Address a couple of instances of -Wreturn-type warning from GCC. The > switches > > are covered, add an llvm_unreachable to the end of the functions to > silence the > > warning. NFC. > > Huh? This is wrong. A switch with a default branch should never trigger > a fall through waring. You're right. I think that this was rebased over another change and I failed to notice that this was now default'ed. Reverted in SVN r258821. > > Joerg > -- Saleem Abdulrasool compnerd (at) compnerd (dot) org ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D16284: Fix Makefile build
hans added a comment. Did this ever get committed? http://reviews.llvm.org/D16284 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [lldb] r257926 - Implement missing GoASTContext methods
Greg: Ping? On Tue, Jan 19, 2016 at 1:12 PM, Hans Wennborg wrote: > Sure. Greg, are you the code owner for this, or is there a specific > owner for Go? > > Thanks, > Hans > > On Fri, Jan 15, 2016 at 11:43 AM, Ryan Brown via lldb-commits > wrote: >> It would be nice if we could get this into 3.8 to get rid of these asserts. >> >> -- Ryan Brown >> >> On Fri, Jan 15, 2016 at 11:35 AM, Ryan Brown via lldb-commits >> wrote: >>> >>> Author: ribrdb >>> Date: Fri Jan 15 13:35:48 2016 >>> New Revision: 257926 >>> >>> URL: http://llvm.org/viewvc/llvm-project?rev=257926&view=rev >>> Log: >>> Implement missing GoASTContext methods >>> >>> Modified: >>> lldb/trunk/source/Symbol/GoASTContext.cpp >>> >>> Modified: lldb/trunk/source/Symbol/GoASTContext.cpp >>> URL: >>> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/GoASTContext.cpp?rev=257926&r1=257925&r2=257926&view=diff >>> >>> == >>> --- lldb/trunk/source/Symbol/GoASTContext.cpp (original) >>> +++ lldb/trunk/source/Symbol/GoASTContext.cpp Fri Jan 15 13:35:48 2016 >>> @@ -13,6 +13,7 @@ >>> >>> #include "lldb/Core/Module.h" >>> #include "lldb/Core/PluginManager.h" >>> +#include "lldb/Core/StreamFile.h" >>> #include "lldb/Core/UniqueCStringMap.h" >>> #include "lldb/Core/ValueObject.h" >>> #include "lldb/DataFormatters/StringPrinter.h" >>> @@ -1268,13 +1269,115 @@ GoASTContext::ConvertStringToFloatValue( >>> //-- >>> // Dumping types >>> //-- >>> +#define DEPTH_INCREMENT 2 >>> + >>> void >>> GoASTContext::DumpValue(lldb::opaque_compiler_type_t type, >>> ExecutionContext *exe_ctx, Stream *s, lldb::Format format, >>> -const DataExtractor &data, lldb::offset_t >>> data_offset, size_t data_byte_size, >>> +const DataExtractor &data, lldb::offset_t >>> data_byte_offset, size_t data_byte_size, >>> uint32_t bitfield_bit_size, uint32_t >>> bitfield_bit_offset, bool show_types, bool show_summary, >>> bool verbose, uint32_t depth) >>> { >>> -assert(false); >>> +if (IsTypedefType(type)) >>> +type = GetTypedefedType(type).GetOpaqueQualType(); >>> +if (!type) >>> +return; >>> +GoType *t = static_cast(type); >>> + >>> +if (GoStruct *st = t->GetStruct()) >>> +{ >>> +if (GetCompleteType(type)) >>> +{ >>> +uint32_t field_idx = 0; >>> +for (auto* field = st->GetField(field_idx); field != nullptr; >>> field_idx++) >>> +{ >>> +// Print the starting squiggly bracket (if this is the >>> +// first member) or comma (for member 2 and beyond) for >>> +// the struct/union/class member. >>> +if (field_idx == 0) >>> +s->PutChar('{'); >>> +else >>> +s->PutChar(','); >>> + >>> +// Indent >>> +s->Printf("\n%*s", depth + DEPTH_INCREMENT, ""); >>> + >>> +// Print the member type if requested >>> +if (show_types) >>> +{ >>> +ConstString field_type_name = >>> field->m_type.GetTypeName(); >>> +s->Printf("(%s) ", field_type_name.AsCString()); >>> +} >>> +// Print the member name and equal sign >>> +s->Printf("%s = ", field->m_name.AsCString()); >>> + >>> + >>> +// Dump the value of the member >>> +CompilerType field_type = field->m_type; >>> +field_type.DumpValue (exe_ctx, >>> + s, >>> // Stream to dump to >>> + field_type.GetFormat(), >>> // The format with which to display the member >>> + data, >>> // Data buffer containing all bytes for this type >>> + data_byte_offset + >>> field->m_byte_offset,// Offset into "data" where to grab value from >>> + >>> field->m_type.GetByteSize(exe_ctx->GetBestExecutionContextScope()), // >>> Size of this type in bytes >>> + 0, >>> // Bitfield bit size >>> + 0, >>> // Bitfield bit offset >>> + show_types, >>> // Boolean indicating if we should show the variable types >>> + show_summary, >>> // Boolean indicating if we should show a summary for the current type >>> + verbose, >>> // Verbose output? >>> + depth + DEPTH_INCREMENT); >>> // Scope depth for any types that have children >>> +} >>> + >>> +
[Lldb-commits] Buildbot numbers for week of 1/17/2016 - 1/23/2016
Hello everyone, Below are some buildbot numbers for the last week of 1/17/2016 - 1/23/2016. Thanks Galina Number of commits by project: project | commits ---+--- llvm | 315 cfe |86 lldb |46 lld |25 compiler-rt |16 libcxx|16 libcxxabi | 6 polly | 5 clang-tools-extra | 5 openmp| 2 ---+--- 522 Number of completed builds, failed builds and average build time for successful builds per active builder: buildername | completed | failed | time ---+++ clang-aarch64-lnt | 59 | 10 | 02:38:12 clang-atom-d525-fedora| 17 | 1 | 08:36:27 clang-atom-d525-fedora-rel| 69 | 5 | 01:48:57 clang-bpf-build |291 | 9 | 00:03:25 clang-cmake-aarch64-42vma |134 | 15 | 00:45:34 clang-cmake-aarch64-full | 37 || 03:58:04 clang-cmake-aarch64-quick |169 | 4 | 00:28:40 clang-cmake-armv7-a15 |155 | 6 | 00:35:17 clang-cmake-armv7-a15-full| 86 | 2 | 01:29:53 clang-cmake-armv7-a15-selfhost| 34 | 1 | 04:17:25 clang-cmake-armv7-a15-selfhost-neon | 27 || 05:36:37 clang-cmake-mips | 42 || 01:28:00 clang-cmake-mipsel| 20 || 06:59:08 clang-cmake-thumbv7-a15 |158 | 6 | 00:30:17 clang-cmake-thumbv7-a15-full-sh | 22 || 06:31:40 clang-hexagon-elf |212 | 4 | 00:17:10 clang-native-aarch64-full | 16 || 08:39:24 clang-native-arm-lnt | 91 || 01:14:41 clang-native-arm-lnt-perf | 16 || 09:52:18 clang-ppc64-elf-linux | 39 | 2 | 01:16:37 clang-ppc64-elf-linux2| 54 | 1 | 00:44:11 clang-ppc64be-linux |134 | 8 | 00:07:22 clang-ppc64be-linux-lnt | 65 | 8 | 01:01:32 clang-ppc64be-linux-multistage| 76 | 15 | 00:39:17 clang-ppc64le-linux | 95 | 95 | clang-ppc64le-linux-lnt | 28 | 14 | 02:47:49 clang-ppc64le-linux-multistage| 61 | 5 | 01:06:26 clang-sphinx-docs | 95 || 00:00:23 clang-x64-ninja-win7 |162 |151 | 00:39:16 clang-x86-win2008-selfhost| 97 | 9 | 01:14:58 clang-x86_64-darwin13-cross-arm |213 | 19 | 00:20:16 clang-x86_64-darwin13-cross-mingw32 |196 | 18 | 00:23:57 clang-x86_64-debian-fast |117 | 16 | 00:13:52 clang-x86_64-linux-abi-test |300 | 3 | 00:10:01 clang-x86_64-linux-selfhost-modules |231 | 10 | 00:16:05 libcxx-libcxxabi-arm-linux| 18 | 2 | 01:08:09 libcxx-libcxxabi-singlethreaded-x86_64-linux-debian | 14 || 00:09:56 libcxx-libcxxabi-x86_64-linux-debian | 14 | 2 | 00:10:29 libcxx-libcxxabi-x86_64-linux-debian-noexceptions | 13 | 6 | 00:10:19 libcxx-libcxxabi-x86_64-linux-ubuntu-asan | 20 | 3 | 00:07:55 libcxx-libcxxabi-x86_64-linux-ubuntu-cxx03| 19 | 6 | 00:02:56 libcxx-libcxxabi-x86_64-linux-ubuntu-cxx11| 20 || 00:04:20 libcxx-libcxxabi-x86_64-linux-ubuntu-cxx14| 20 || 00:04:28 libcxx-libcxxabi-x86_64-linux-ubuntu-cxx1z|
[Lldb-commits] [PATCH] D16615: Refactor some of the skip / xfail decorators to reuse more code.
zturner created this revision. zturner added reviewers: tfiala, labath. zturner added a subscriber: lldb-commits. Herald added subscribers: srhines, danalbert, tberghammer. This is going to be part of a larger effort to clean up some of these decorators as the code is getting really unwieldy and difficult to understand and maintain. For now, this patch: a) Changes the `skipIf` decorator to be called `decorateTest` and gives it a `mode` parameter that says whether we're skipping or xfailing. This allows the skip and xfail decorators to take the same set of arguments and use the same logic for checking the condition so that we only have 1 large and ugly function instead of 2 large and ugly functions that diverge from each other. b) Update `expectedFailureAll` and `skipIf` to call `decorateTest`, so that all existing code using those decorators go through the common code path, and so that `skipIf` and `expectedFailureAll` now support the same set of arguments. c) Change the way the skip / xfail "reason" is computed to be more friendly. d) Delete this weird code that says `if six.callable(bugnumber)` everywhere since it appears to be an invalid assumption about what a bugnumber is (i.e. always a string, never a callable). Ran the test suite before and after my CL, and the summary statistics at the end are identical in both cases. In future patches I intend to: a) Move all the decorators to another file somewhere so they are all isolated and not lost in a sea of 10,000 lines of other code. b) Remove some of them and consolidate to using the "master" decorators that can are essentially a superset of some of the existing specialized decorators. c) Add a command line option that causes the test suite to treat skips as xfails. http://reviews.llvm.org/D16615 Files: packages/Python/lldbsuite/test/functionalities/jitloader_gdb/TestJITLoaderGDB.py packages/Python/lldbsuite/test/lldbtest.py Index: packages/Python/lldbsuite/test/lldbtest.py === --- packages/Python/lldbsuite/test/lldbtest.py +++ packages/Python/lldbsuite/test/lldbtest.py @@ -512,6 +512,9 @@ # # Decorators for categorizing test cases. # +class DecorateMode: +Skip, Xfail = range(2) + from functools import wraps def add_test_categories(cat): @@ -603,7 +606,8 @@ def wrapper(*args, **kwargs): from unittest2 import case self = args[0] -if expected_fn(self): +xfail, reason = expected_fn(self) +if xfail: if configuration.results_formatter_object is not None: # Mark this test as expected to fail. configuration.results_formatter_object.handle_event( @@ -645,26 +649,21 @@ # @expectedFailureAll, xfail for all platform/compiler/arch, # @expectedFailureAll(compiler='gcc'), xfail for gcc on all platform/architecture # @expectedFailureAll(bugnumber, ["linux"], "gcc", ['>=', '4.9'], ['i386']), xfail for gcc>=4.9 on linux with i386 -def expectedFailureAll(bugnumber=None, oslist=None, hostoslist=None, compiler=None, compiler_version=None, archs=None, triple=None, debug_info=None, swig_version=None, py_version=None): -def fn(self): -oslist_passes = check_list_or_lambda(oslist, self.getPlatform()) -hostoslist_passes = check_list_or_lambda(hostoslist, getHostPlatform()) -compiler_passes = check_list_or_lambda(self.getCompiler(), compiler) and self.expectedCompilerVersion(compiler_version) -arch_passes = check_list_or_lambda(archs, self.getArchitecture()) -triple_passes = triple is None or re.match(triple, lldb.DBG.GetSelectedPlatform().GetTriple()) -debug_info_passes = check_list_or_lambda(debug_info, self.debug_info) -swig_version_passes = (swig_version is None) or (not hasattr(lldb, 'swig_version')) or (check_expected_version(swig_version[0], swig_version[1], lldb.swig_version)) -py_version_passes = (py_version is None) or check_expected_version(py_version[0], py_version[1], sys.version_info) - -return (oslist_passes and -hostoslist_passes and -compiler_passes and -arch_passes and -triple_passes and -debug_info_passes and -swig_version_passes and -py_version_passes) -return expectedFailure(fn, bugnumber) +def expectedFailureAll(bugnumber=None, + oslist=None, hostoslist=None, + compiler=None, compiler_version=None, + archs=None, triple=None, + debug_info=None, + swig_version=None, py_version=None, + remote=None): +return decorateTest(DecorateMode.Xfail, +bugnumber=bugnumber, +oslist=oslist, hostoslist=hostoslist, +compiler=compiler, compiler_ver
Re: [Lldb-commits] [PATCH] D16615: Refactor some of the skip / xfail decorators to reuse more code.
zturner updated this revision to Diff 46086. zturner added a comment. Add back the check for `six.callable`. Also added a detailed comment explaining what this atrocity actually does. Note that this problem will go away by design once we reduce some of the more superfluous decorators. http://reviews.llvm.org/D16615 Files: packages/Python/lldbsuite/test/functionalities/jitloader_gdb/TestJITLoaderGDB.py packages/Python/lldbsuite/test/lldbtest.py Index: packages/Python/lldbsuite/test/lldbtest.py === --- packages/Python/lldbsuite/test/lldbtest.py +++ packages/Python/lldbsuite/test/lldbtest.py @@ -512,6 +512,9 @@ # # Decorators for categorizing test cases. # +class DecorateMode: +Skip, Xfail = range(2) + from functools import wraps def add_test_categories(cat): @@ -603,7 +606,8 @@ def wrapper(*args, **kwargs): from unittest2 import case self = args[0] -if expected_fn(self): +xfail, reason = expected_fn(self) +if xfail: if configuration.results_formatter_object is not None: # Mark this test as expected to fail. configuration.results_formatter_object.handle_event( @@ -613,8 +617,11 @@ else: func(*args, **kwargs) return wrapper -# if bugnumber is not-callable(incluing None), that means decorator function is called with optional arguments -# return decorator in this case, so it will be used to decorating original method +# Some decorators can be called both with no arguments (e.g. @expectedFailureWindows) +# or with arguments (e.g. @expectedFailureWindows(compilers=['gcc'])). When called +# the first way, the first argument will be the actual function because decorators are +# weird like that. So this is basically a check that says "which syntax was the original +# function decorated with?" if six.callable(bugnumber): return expectedFailure_impl(bugnumber) else: @@ -645,26 +652,21 @@ # @expectedFailureAll, xfail for all platform/compiler/arch, # @expectedFailureAll(compiler='gcc'), xfail for gcc on all platform/architecture # @expectedFailureAll(bugnumber, ["linux"], "gcc", ['>=', '4.9'], ['i386']), xfail for gcc>=4.9 on linux with i386 -def expectedFailureAll(bugnumber=None, oslist=None, hostoslist=None, compiler=None, compiler_version=None, archs=None, triple=None, debug_info=None, swig_version=None, py_version=None): -def fn(self): -oslist_passes = check_list_or_lambda(oslist, self.getPlatform()) -hostoslist_passes = check_list_or_lambda(hostoslist, getHostPlatform()) -compiler_passes = check_list_or_lambda(self.getCompiler(), compiler) and self.expectedCompilerVersion(compiler_version) -arch_passes = check_list_or_lambda(archs, self.getArchitecture()) -triple_passes = triple is None or re.match(triple, lldb.DBG.GetSelectedPlatform().GetTriple()) -debug_info_passes = check_list_or_lambda(debug_info, self.debug_info) -swig_version_passes = (swig_version is None) or (not hasattr(lldb, 'swig_version')) or (check_expected_version(swig_version[0], swig_version[1], lldb.swig_version)) -py_version_passes = (py_version is None) or check_expected_version(py_version[0], py_version[1], sys.version_info) - -return (oslist_passes and -hostoslist_passes and -compiler_passes and -arch_passes and -triple_passes and -debug_info_passes and -swig_version_passes and -py_version_passes) -return expectedFailure(fn, bugnumber) +def expectedFailureAll(bugnumber=None, + oslist=None, hostoslist=None, + compiler=None, compiler_version=None, + archs=None, triple=None, + debug_info=None, + swig_version=None, py_version=None, + remote=None): +return decorateTest(DecorateMode.Xfail, +bugnumber=bugnumber, +oslist=oslist, hostoslist=hostoslist, +compiler=compiler, compiler_version=compiler_version, +archs=archs, triple=triple, +debug_info=debug_info, +swig_version=swig_version, py_version=py_version, +remote=remote) def expectedFailureDwarf(bugnumber=None): return expectedFailureAll(bugnumber=bugnumber, debug_info="dwarf") @@ -692,9 +694,7 @@ return expectedFailureCompiler('icc', None, bugnumber) def expectedFailureArch(arch, bugnumber=None): -def fn(self): -return arch in self.getArchitecture() -return expectedFailure(fn, bugnumber) +return decorateTest(DecorateMode.Xfail, archs=arch, bugnumber=bugnumber) def expec