Re: [Lldb-commits] [PATCH] D19604: Allow ObjectFilePECOFF to initialize with ARM binaries.
omjavaid requested changes to this revision. omjavaid added a comment. This revision now requires changes to proceed. Please see inline comments. Comment at: source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp:149 @@ +148,3 @@ +{ +spec.SetTriple("armv7-pc-windows"); +specs.Append(ModuleSpec(file, spec)); compnerd wrote: > This may be a bit tricky. `armv7-windows` is unsupported in LLVM/clang (and > we silently rewrite that in the clang frontend), and you need > `thumbv7-windows` (ARM NT). Though, it is possible that LLDB is unable to > handle that distinction right now. > > That said, the `pc` vendor is silly, and `unknown` sounds better to me, but > this shouldn't matter too much. > > Finally, the Windows environment defaults to `msvc` here, which has a slight > issue that it can sometimes fail to generate an assembly listing (the code > generation is correct, its just a serialization issue caused by not having > invested sufficiently in generating MASM style assembly listing). > > The safest triple would be `thumbv7-unknown-windows-itanium`. But, if lldb > is going to ensure that the code is handled as thumb, using `armv7` should be > fine. Can we recognize armv7 and armv8 independent of each other? For 32 bit arm normally we use arm-linux-gnueabi independent of instruction modes (thumb or arm) and architecture versions (v5, v5 or v7). And we right now do not specifically distinguish between thumb and arm triples. Better select arm-unknown-windows. Please also handle arm v8 case where header is MachineArm64 and triple should be like aarch64-unknown-windows. http://reviews.llvm.org/D19604 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D19086: [clang-analyzer] fix warnings emitted on lldb code base
clayborg accepted this revision. clayborg added a comment. Looks good http://reviews.llvm.org/D19086 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r268263 - I forgot to check in the test case for the changes I made to synthetic children yesterday. Do so now
Author: enrico Date: Mon May 2 12:57:14 2016 New Revision: 268263 URL: http://llvm.org/viewvc/llvm-project?rev=268263&view=rev Log: I forgot to check in the test case for the changes I made to synthetic children yesterday. Do so now Added: lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/ lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/Makefile lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/TestDataFormatterSynthType.py lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/main.cpp lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/myIntSynthProvider.py Added: lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/Makefile?rev=268263&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/Makefile (added) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/Makefile Mon May 2 12:57:14 2016 @@ -0,0 +1,5 @@ +LEVEL = ../../../make + +CXX_SOURCES := main.cpp + +include $(LEVEL)/Makefile.rules Added: lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/TestDataFormatterSynthType.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/TestDataFormatterSynthType.py?rev=268263&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/TestDataFormatterSynthType.py (added) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/TestDataFormatterSynthType.py Mon May 2 12:57:14 2016 @@ -0,0 +1,57 @@ +""" +Test lldb data formatter subsystem. +""" + +from __future__ import print_function + + + +import os, time +import lldb +from lldbsuite.test.decorators import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil + +class DataFormatterSynthTypeTestCase(TestBase): + +mydir = TestBase.compute_mydir(__file__) + +def setUp(self): +# Call super's setUp(). +TestBase.setUp(self) +# Find the line number to break at. +self.line = line_number('main.cpp', 'break here') + +@skipIfFreeBSD # llvm.org/pr20545 bogus output confuses buildbot parser +@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24462, Data formatters have problems on Windows") +def test_with_run_command(self): +"""Test using Python synthetic children provider to provide a typename.""" +self.build() +self.runCmd("file a.out", CURRENT_EXECUTABLE_SET) + +lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True) + +self.runCmd("run", RUN_SUCCEEDED) + +# The stop reason of the thread should be breakpoint. +self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, +substrs = ['stopped', + 'stop reason = breakpoint']) + +# This is the function to remove the custom formats in order to have a +# clean slate for the next test case. +def cleanup(): +self.runCmd('type format clear', check=False) +self.runCmd('type summary clear', check=False) +self.runCmd('type filter clear', check=False) +self.runCmd('type synth clear', check=False) + +# Execute the cleanup function during test case tear down. +self.addTearDownHook(cleanup) + +self.runCmd("script from myIntSynthProvider import *") +self.runCmd("type synth add -l myIntSynthProvider myInt") + +self.expect('frame variable x', substrs=['ThisTestPasses']) +self.expect('frame variable y', substrs=['ThisTestPasses']) +self.expect('frame variable z', substrs=['ThisTestPasses']) Added: lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/main.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/main.cpp?rev=268263&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/main.cpp (added) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatte
[Lldb-commits] [lldb] r268274 - Add an argument to ValueObject::GetSyntheticBase that allows for name customization on the generated value
Author: enrico Date: Mon May 2 13:13:18 2016 New Revision: 268274 URL: http://llvm.org/viewvc/llvm-project?rev=268274&view=rev Log: Add an argument to ValueObject::GetSyntheticBase that allows for name customization on the generated value Modified: lldb/trunk/include/lldb/Core/ValueObject.h lldb/trunk/source/Core/ValueObject.cpp Modified: lldb/trunk/include/lldb/Core/ValueObject.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObject.h?rev=268274&r1=268273&r2=268274&view=diff == --- lldb/trunk/include/lldb/Core/ValueObject.h (original) +++ lldb/trunk/include/lldb/Core/ValueObject.h Mon May 2 13:13:18 2016 @@ -705,7 +705,10 @@ public: ConstString name_const_str = ConstString()); virtual lldb::ValueObjectSP -GetSyntheticBase (uint32_t offset, const CompilerType& type, bool can_create); +GetSyntheticBase (uint32_t offset, + const CompilerType& type, + bool can_create, + ConstString name_const_str = ConstString()); virtual lldb::ValueObjectSP GetDynamicValue (lldb::DynamicValueType valueType); Modified: lldb/trunk/source/Core/ValueObject.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObject.cpp?rev=268274&r1=268273&r2=268274&view=diff == --- lldb/trunk/source/Core/ValueObject.cpp (original) +++ lldb/trunk/source/Core/ValueObject.cpp Mon May 2 13:13:18 2016 @@ -2227,13 +2227,19 @@ ValueObject::GetSyntheticChildAtOffset(u } ValueObjectSP -ValueObject::GetSyntheticBase (uint32_t offset, const CompilerType& type, bool can_create) +ValueObject::GetSyntheticBase (uint32_t offset, + const CompilerType& type, + bool can_create, + ConstString name_const_str) { ValueObjectSP synthetic_child_sp; -char name_str[64]; -snprintf(name_str, sizeof(name_str), "%s", type.GetTypeName().AsCString("")); -ConstString name_const_str(name_str); +if (name_const_str.IsEmpty()) +{ +char name_str[128]; +snprintf(name_str, sizeof(name_str), "base%s@%i", type.GetTypeName().AsCString(""), offset); +name_const_str.SetCString(name_str); +} // Check if we have already created a synthetic array member in this // valid object. If we have we will re-use it. ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r268303 - Add more debug logging to g_get_shared_cache_class_info_body
Author: enrico Date: Mon May 2 15:58:15 2016 New Revision: 268303 URL: http://llvm.org/viewvc/llvm-project?rev=268303&view=rev Log: Add more debug logging to g_get_shared_cache_class_info_body Modified: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp Modified: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp?rev=268303&r1=268302&r2=268303&view=diff == --- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp (original) +++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp Mon May 2 15:58:15 2016 @@ -228,7 +228,7 @@ __lldb_apple_objc_v2_get_shared_cache_cl uint32_t idx = 0; DEBUG_PRINTF ("objc_opt_ro_ptr = %p\n", objc_opt_ro_ptr); DEBUG_PRINTF ("class_infos_ptr = %p\n", class_infos_ptr); -DEBUG_PRINTF ("class_infos_byte_size = %u (%" PRIu64 " class infos)\n", class_infos_byte_size, (size_t)(class_infos_byte_size/sizeof(ClassInfo))); +DEBUG_PRINTF ("class_infos_byte_size = %u (%llu class infos)\n", class_infos_byte_size, (uint64_t)(class_infos_byte_size/sizeof(ClassInfo))); if (objc_opt_ro_ptr) { const objc_opt_t *objc_opt = (objc_opt_t *)objc_opt_ro_ptr; @@ -257,6 +257,7 @@ __lldb_apple_objc_v2_get_shared_cache_cl else clsopt = (const objc_clsopt_t*)((uint8_t *)objc_opt + objc_opt->clsopt_offset); const size_t max_class_infos = class_infos_byte_size/sizeof(ClassInfo); +DEBUG_PRINTF("max_class_infos = %llu\n", (uint64_t)max_class_infos); ClassInfo *class_infos = (ClassInfo *)class_infos_ptr; int32_t invalidEntryOffset = 0; // this is safe to do because the version field order is invariant @@ -268,13 +269,21 @@ __lldb_apple_objc_v2_get_shared_cache_cl DEBUG_PRINTF ("clsopt->capacity = %u\n", clsopt->capacity); DEBUG_PRINTF ("clsopt->mask = 0x%8.8x\n", clsopt->mask); DEBUG_PRINTF ("classOffsets = %p\n", classOffsets); +DEBUG_PRINTF("invalidEntryOffset = %d\n", invalidEntryOffset); for (uint32_t i=0; icapacity; ++i) { const int32_t clsOffset = classOffsets[i].clsOffset; +DEBUG_PRINTF("clsOffset[%u] = %u\n", i, clsOffset); if (clsOffset & 1) +{ +DEBUG_PRINTF("clsOffset & 1\n"); continue; // duplicate +} else if (clsOffset == invalidEntryOffset) +{ +DEBUG_PRINTF("clsOffset == invalidEntryOffset\n"); continue; // invalid offset +} if (class_infos && idx < max_class_infos) { @@ -288,6 +297,10 @@ __lldb_apple_objc_v2_get_shared_cache_cl h = ((h << 5) + h) + c; class_infos[idx].hash = h; } +else +{ +DEBUG_PRINTF("not(class_infos && idx < max_class_infos)\n"); +} ++idx; } ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r268307 - Import block pointers from DWARF as Clang block pointers, not as structs.
Author: spyffe Date: Mon May 2 16:15:31 2016 New Revision: 268307 URL: http://llvm.org/viewvc/llvm-project?rev=268307&view=rev Log: Import block pointers from DWARF as Clang block pointers, not as structs. Also added a data formatter that presents them as structs if you use frame variable to look at their contents. Now the blocks testcase works. Added: lldb/trunk/source/Plugins/Language/CPlusPlus/BlockPointer.cpp lldb/trunk/source/Plugins/Language/CPlusPlus/BlockPointer.h Modified: lldb/trunk/include/lldb/Symbol/ClangASTContext.h lldb/trunk/include/lldb/Symbol/CompilerType.h lldb/trunk/include/lldb/Symbol/GoASTContext.h lldb/trunk/include/lldb/Symbol/JavaASTContext.h lldb/trunk/include/lldb/Symbol/TypeSystem.h lldb/trunk/lldb.xcodeproj/project.pbxproj lldb/trunk/packages/Python/lldbsuite/test/lang/c/blocks/TestBlocks.py lldb/trunk/source/Plugins/Language/CPlusPlus/CMakeLists.txt lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp lldb/trunk/source/Symbol/ClangASTContext.cpp lldb/trunk/source/Symbol/CompilerType.cpp lldb/trunk/source/Symbol/GoASTContext.cpp lldb/trunk/source/Symbol/JavaASTContext.cpp Modified: lldb/trunk/include/lldb/Symbol/ClangASTContext.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTContext.h?rev=268307&r1=268306&r2=268307&view=diff == --- lldb/trunk/include/lldb/Symbol/ClangASTContext.h (original) +++ lldb/trunk/include/lldb/Symbol/ClangASTContext.h Mon May 2 16:15:31 2016 @@ -303,6 +303,11 @@ public: } CompilerType +CreateStructForIdentifier (const ConstString &type_name, + const std::initializer_list< std::pair < const char *, CompilerType > >& type_fields, + bool packed = false); + +CompilerType GetOrCreateStructForIdentifier (const ConstString &type_name, const std::initializer_list< std::pair < const char *, CompilerType > >& type_fields, bool packed = false); @@ -476,6 +481,9 @@ public: SetFunctionParameters (clang::FunctionDecl *function_decl, clang::ParmVarDecl **params, unsigned num_params); + +CompilerType +CreateBlockPointerType (const CompilerType &function_type); //-- // Array Types @@ -683,6 +691,9 @@ public: IsFunctionPointerType (lldb::opaque_compiler_type_t type) override; bool +IsBlockPointerType (lldb::opaque_compiler_type_t type, CompilerType *function_pointer_type_ptr) override; + +bool IsIntegerType (lldb::opaque_compiler_type_t type, bool &is_signed) override; static bool Modified: lldb/trunk/include/lldb/Symbol/CompilerType.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/CompilerType.h?rev=268307&r1=268306&r2=268307&view=diff == --- lldb/trunk/include/lldb/Symbol/CompilerType.h (original) +++ lldb/trunk/include/lldb/Symbol/CompilerType.h Mon May 2 16:15:31 2016 @@ -149,6 +149,9 @@ public: IsFunctionPointerType () const; bool +IsBlockPointerType (CompilerType *function_pointer_type_ptr) const; + +bool IsIntegerType (bool &is_signed) const; bool Modified: lldb/trunk/include/lldb/Symbol/GoASTContext.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/GoASTContext.h?rev=268307&r1=268306&r2=268307&view=diff == --- lldb/trunk/include/lldb/Symbol/GoASTContext.h (original) +++ lldb/trunk/include/lldb/Symbol/GoASTContext.h Mon May 2 16:15:31 2016 @@ -176,6 +176,8 @@ class GoASTContext : public TypeSystem CompilerType GetFunctionArgumentAtIndex(lldb::opaque_compiler_type_t type, const size_t index) override; bool IsFunctionPointerType(lldb::opaque_compiler_type_t type) override; + +bool IsBlockPointerType (lldb::opaque_compiler_type_t type, CompilerType *function_pointer_type_ptr) override; bool IsIntegerType(lldb::opaque_compiler_type_t type, bool &is_signed) override; Modified: lldb/trunk/include/lldb/Symbol/JavaASTContext.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/JavaASTContext.h?rev=268307&r1=268306&r2=268307&view=diff == --- lldb/trunk/include/lldb/Symbol/JavaASTContext.h (original) +++ lldb/trunk/include/lldb/Symbol/JavaASTContext.h Mon May 2 16:15:31 2016 @@ -121,6 +121,9 @@ public: bool IsFunctionPointerType(lldb::opaque_compiler_type_t type) override;
[Lldb-commits] [lldb] r268309 - Fix an issue where the apropos command would not print fully qualified command names for nested command objects
Author: enrico Date: Mon May 2 16:28:40 2016 New Revision: 268309 URL: http://llvm.org/viewvc/llvm-project?rev=268309&view=rev Log: Fix an issue where the apropos command would not print fully qualified command names for nested command objects rdar://problem/26020072 Added: lldb/trunk/packages/Python/lldbsuite/test/help/TestApropos.py Modified: lldb/trunk/source/Interpreter/CommandInterpreter.cpp Added: lldb/trunk/packages/Python/lldbsuite/test/help/TestApropos.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/help/TestApropos.py?rev=268309&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/help/TestApropos.py (added) +++ lldb/trunk/packages/Python/lldbsuite/test/help/TestApropos.py Mon May 2 16:28:40 2016 @@ -0,0 +1,22 @@ +""" +Test some lldb apropos commands. +""" + +from __future__ import print_function + + + +import os, time +import lldb +from lldbsuite.test.decorators import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil + +class AproposCommandTestCase(TestBase): + +mydir = TestBase.compute_mydir(__file__) + +@no_debug_info_test +def test_apropos_variable(self): +"""Test that 'apropos variable' prints the fully qualified command name""" +self.expect('apropos variable', substrs=['frame variable', 'target variable', 'watchpoint set variable']) Modified: lldb/trunk/source/Interpreter/CommandInterpreter.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CommandInterpreter.cpp?rev=268309&r1=268308&r2=268309&view=diff == --- lldb/trunk/source/Interpreter/CommandInterpreter.cpp (original) +++ lldb/trunk/source/Interpreter/CommandInterpreter.cpp Mon May 2 16:28:40 2016 @@ -2802,7 +2802,7 @@ CommandInterpreter::FindCommandsForAprop search_syntax, search_options)) { -commands_found.AppendString (command_name); +commands_found.AppendString (cmd_obj->GetCommandName()); commands_help.AppendString (cmd_obj->GetHelp()); } ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r268325 - debugserver should fflush its log stream in FileLogCallback, now it does.
Author: gclayton Date: Mon May 2 17:53:08 2016 New Revision: 268325 URL: http://llvm.org/viewvc/llvm-project?rev=268325&view=rev Log: debugserver should fflush its log stream in FileLogCallback, now it does. Modified: lldb/trunk/tools/debugserver/source/debugserver.cpp Modified: lldb/trunk/tools/debugserver/source/debugserver.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/debugserver.cpp?rev=268325&r1=268324&r2=268325&view=diff == --- lldb/trunk/tools/debugserver/source/debugserver.cpp (original) +++ lldb/trunk/tools/debugserver/source/debugserver.cpp Mon May 2 17:53:08 2016 @@ -824,8 +824,9 @@ FileLogCallback(void *baton, uint32_t fl if (baton == NULL || format == NULL) return; -::vfprintf ((FILE *)baton, format, args); -::fprintf ((FILE *)baton, "\n"); +::vfprintf((FILE *)baton, format, args); +::fprintf((FILE *)baton, "\n"); +::fflush((FILE *)baton); } ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D19604: Allow ObjectFilePECOFF to initialize with ARM binaries.
sas added a comment. @compnerd: - We don't use thumb-* triples in lldb as far as I can see. Thumb is handled just fine regardless of the triple. - `pc` vs `unknown` doesn't seem to matter either, and other code in this file uses `pc` (see a few lines above). - `msvc` vs `itanium` is also handled elsewhere, and I don't think there's a need to put it here. Furthermore, most windows binaries will probably follow the `msvc` ABI, not `itanium`, and forcing it to `itanium` without know what we're dealing with sounds wrong. @omjavaid: - I could just use `arm` instead of `armv7` but as far as I know, Windows Phone is a pure thumb environment, so the CPUs used will be armv7 and up. - I could add support for aarch64 in this file, but I've got no way of testing it at the moment, and it seems likes a bad idea to advertise support for something we can't even test. Given all of these, it seems like sticking with `armv7-pc-windows` or using `arm-pc-windows` might be the better solutions. Let me know what you guys think. http://reviews.llvm.org/D19604 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r268338 - Another little example use of scripted thread plans.
Author: jingham Date: Mon May 2 19:14:52 2016 New Revision: 268338 URL: http://llvm.org/viewvc/llvm-project?rev=268338&view=rev Log: Another little example use of scripted thread plans. Modified: lldb/trunk/examples/python/scripted_step.py Modified: lldb/trunk/examples/python/scripted_step.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/scripted_step.py?rev=268338&r1=268337&r2=268338&view=diff == --- lldb/trunk/examples/python/scripted_step.py (original) +++ lldb/trunk/examples/python/scripted_step.py Mon May 2 19:14:52 2016 @@ -184,3 +184,28 @@ class StepCheckingCondition: def should_step (self): return True +# Here's an example that steps out of the current frame, gathers some information +# and then continues. The information in this case is rax. Currently the thread +# plans are not a safe place to call lldb command-line commands, so the information +# is gathered through SB API calls. + +class FinishPrintAndContinue: +def __init__ (self, thread_plan, dict): +self.thread_plan = thread_plan +self.step_out_thread_plan = thread_plan.QueueThreadPlanForStepOut(0, True) +self.thread = self.thread_plan.GetThread() + +def explains_stop (self, event): +return False + +def should_stop (self, event): +if self.step_out_thread_plan.IsPlanComplete(): +frame_0 = self.thread.frames[0] +rax_value = frame_0.FindRegister("rax") +if rax_value.GetError().Success(): +print "RAX on exit: ", rax_value.GetValue() +else: +print "Couldn't get rax value:", rax_value.GetError().GetCString() + +self.thread_plan.SetPlanComplete(True) +return False ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D19604: Allow ObjectFilePECOFF to initialize with ARM binaries.
compnerd added a comment. The few lines above are for the x86, x86_64 targets, which traditionally use the pc vendor as a legacy label. http://reviews.llvm.org/D19604 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits