[Lldb-commits] [lldb] r257160 - Fix TestBatchMode on linux
Author: labath Date: Fri Jan 8 04:38:20 2016 New Revision: 257160 URL: http://llvm.org/viewvc/llvm-project?rev=257160&view=rev Log: Fix TestBatchMode on linux New test introduced in r257120 was failing on linux. The reason for that the regex for setting the breakpoint was being applied to the "default file", which in this case was the asm file containing the definition of the sleep() syscall (because after attach, we are stopped in the sleep function). I have changed this use the more customary way of setting the breakpoint and specifying the source file name explicitly. Modified: lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py Modified: lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py?rev=257160&r1=257159&r2=257160&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py Fri Jan 8 04:38:20 2016 @@ -19,6 +19,7 @@ class DriverBatchModeTest (TestBase): TestBase.setUp(self) # Our simple source filename. self.source = 'main.c' +self.line = line_number(self.source, 'Stop here to unset keep_waiting') self.victim = None def expect_string (self, string): @@ -141,7 +142,7 @@ class DriverBatchModeTest (TestBase): self.victim.expect("Waiting") -run_commands = ' -b -o "process attach -p %d" -o "breakpoint set -p \'Stop here to unset keep_waiting\' -N keep_waiting" -o "continue" -o "break delete keep_waiting" -o "expr keep_waiting = 0" -o "continue" ' % (victim_pid) +run_commands = ' -b -o "process attach -p %d" -o "breakpoint set --file %s --line %d -N keep_waiting" -o "continue" -o "break delete keep_waiting" -o "expr keep_waiting = 0" -o "continue" ' % (victim_pid, self.source, self.line) self.child = pexpect.spawn('%s %s %s %s' % (lldbtest_config.lldbExec, self.lldbOption, run_commands, exe)) child = self.child ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r257165 - Another fix for TestBatchMode on linux
Author: labath Date: Fri Jan 8 05:16:45 2016 New Revision: 257165 URL: http://llvm.org/viewvc/llvm-project?rev=257165&view=rev Log: Another fix for TestBatchMode on linux On locked down systems (such as our buildbot) one needs to do a special dance to allow attaching to processes. This commit adds this code to the TestBatchMode inferior. Modified: lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/main.c Modified: lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/main.c URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/main.c?rev=257165&r1=257164&r2=257165&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/main.c (original) +++ lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/main.c Fri Jan 8 05:16:45 2016 @@ -2,9 +2,26 @@ #include #include +#if defined(__linux__) +#include +#endif + int main (int argc, char **argv) { +#if defined(__linux__) +// Immediately enable any ptracer so that we can allow the stub attach +// operation to succeed. Some Linux kernels are locked down so that +// only an ancestor process can be a ptracer of a process. This disables that +// restriction. Without it, attach-related stub tests will fail. +#if defined(PR_SET_PTRACER) && defined(PR_SET_PTRACER_ANY) +// For now we execute on best effort basis. If this fails for +// some reason, so be it. +const int prctl_result = prctl(PR_SET_PTRACER, PR_SET_PTRACER_ANY, 0, 0, 0); +(void) prctl_result; +#endif +#endif + int do_crash = 0; int do_wait = 0; ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r257166 - Fix TestBatchMode for gcc
Author: labath Date: Fri Jan 8 05:23:21 2016 New Revision: 257166 URL: http://llvm.org/viewvc/llvm-project?rev=257166&view=rev Log: Fix TestBatchMode for gcc gcc by default does not accept for loop declarations in C files (one must choose C99 mode first, which we don't). Place the declaration outside the loop, to make this code more conformant. Modified: lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/main.c Modified: lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/main.c URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/main.c?rev=257166&r1=257165&r2=257166&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/main.c (original) +++ lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/main.c Fri Jan 8 05:23:21 2016 @@ -25,7 +25,8 @@ main (int argc, char **argv) int do_crash = 0; int do_wait = 0; -for (int idx = 1; idx < argc; idx++) +int idx; +for (idx = 1; idx < argc; idx++) { if (strcmp(argv[idx], "CRASH") == 0) do_crash = 1; ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D15992: Centralize the handling of attach permissions on linux in tests
labath created this revision. labath added a reviewer: clayborg. labath added a subscriber: lldb-commits. On linux we need the process to give us special permissions before we can attach to it. Previously, the code for this was copied into every file that needed it. This moves the code to a central place to reduce code duplication. http://reviews.llvm.org/D15992 Files: packages/Python/lldbsuite/test/driver/batch_mode/main.c packages/Python/lldbsuite/test/functionalities/attach_resume/main.cpp packages/Python/lldbsuite/test/functionalities/process_attach/main.cpp packages/Python/lldbsuite/test/functionalities/process_group/main.c packages/Python/lldbsuite/test/functionalities/register/main.cpp packages/Python/lldbsuite/test/functionalities/thread/create_after_attach/main.cpp packages/Python/lldbsuite/test/make/test_common.h packages/Python/lldbsuite/test/python_api/hello_world/main.c packages/Python/lldbsuite/test/tools/lldb-server/main.cpp Index: packages/Python/lldbsuite/test/tools/lldb-server/main.cpp === --- packages/Python/lldbsuite/test/tools/lldb-server/main.cpp +++ packages/Python/lldbsuite/test/tools/lldb-server/main.cpp @@ -20,10 +20,6 @@ #include #endif -#if defined(__linux__) -#include -#endif - static const char *const RETVAL_PREFIX = "retval:"; static const char *const SLEEP_PREFIX= "sleep:"; static const char *const STDERR_PREFIX = "stderr:"; @@ -210,16 +206,7 @@ int main (int argc, char **argv) { -#if defined(__linux__) -// Immediately enable any ptracer so that we can allow the stub attach -// operation to succeed. Some Linux kernels are locked down so that -// only an ancestor can be a ptracer of a process. This disables that -// restriction. Without it, attach-related stub tests will fail. -#if defined(PR_SET_PTRACER) && defined(PR_SET_PTRACER_ANY) -const int prctl_result = prctl(PR_SET_PTRACER, PR_SET_PTRACER_ANY, 0, 0, 0); -static_cast (prctl_result); -#endif -#endif + lldb_enable_attach(); std::vector threads; std::unique_ptr heap_array_up; Index: packages/Python/lldbsuite/test/python_api/hello_world/main.c === --- packages/Python/lldbsuite/test/python_api/hello_world/main.c +++ packages/Python/lldbsuite/test/python_api/hello_world/main.c @@ -1,25 +1,8 @@ #include -#if defined(__linux__) -#include -#endif - -int main(int argc, char const *argv[]) { - -#if defined(__linux__) -// Immediately enable any ptracer so that we can allow the stub attach -// operation to succeed. Some Linux kernels are locked down so that -// only an ancestor process can be a ptracer of a process. This disables that -// restriction. Without it, attach-related stub tests will fail. -#if defined(PR_SET_PTRACER) && defined(PR_SET_PTRACER_ANY) -int prctl_result; - -// For now we execute on best effort basis. If this fails for -// some reason, so be it. -prctl_result = prctl(PR_SET_PTRACER, PR_SET_PTRACER_ANY, 0, 0, 0); -(void) prctl_result; -#endif -#endif +int main(int argc, char const *argv[]) +{ +lldb_enable_attach(); printf("Hello world.\n"); // Set break point at this line. if (argc == 1) Index: packages/Python/lldbsuite/test/make/test_common.h === --- packages/Python/lldbsuite/test/make/test_common.h +++ packages/Python/lldbsuite/test/make/test_common.h @@ -17,3 +17,28 @@ // declared. This may not be necessary after MSVC 12. #include #endif + + +// On some systems (e.g., some versions of linux) it is not possible to attach to a process +// without it giving us special permissions. This defines the lldb_enable_attach macro, which +// should perform any such actions, if needed by the platform. This is a macro instead of a +// function to avoid the need for complex linking of the test programs. +#if defined(__linux__) +#include + +#if defined(PR_SET_PTRACER) && defined(PR_SET_PTRACER_ANY) +// For now we execute on best effort basis. If this fails for some reason, so be it. +#define lldb_enable_attach() \ +do\ +{ \ +const int prctl_result = prctl(PR_SET_PTRACER, PR_SET_PTRACER_ANY, 0, 0, 0); \ +(void)prctl_result; \ +} while (0) + +#endif + +#else // not linux + +#define lldb_enable_attach() + +#endif Index: packages/Python/lldbsuite/test/functionalities/thread/create_after_attach/main.cpp === --- packages/Python/lldbsuite/test/functionalities/thread/create_after_attach/main.cpp +++ pa
Re: [Lldb-commits] [PATCH] D15834: Handle hardcoded breakpoints on Windows (e.g., int3 or __debugbreak())
labath accepted this revision. labath added a reviewer: labath. labath added a comment. `__builtin_debugtrap()` indeed works (thanks Jim), but only on clang (no gcc). Since that is architecture-independent, I think we should use that and just make the test @skipIfGcc. Apart from that, the test works fine on linux after fixing the macro issue. Comment at: packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/Makefile:5 @@ +4,3 @@ + +ifneq (,$(findstring icc,$(CC))) +CFLAGS += -debug inline-debug-info Is anyone actually using icc? I think we should just remove that... Comment at: packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/TestDebugBreak.py:17 @@ +16,3 @@ +@skipIf(archs=not_in(["i386", "i686"])) +@expectedFailureAll("llvm.org/pr15936", compiler="gcc", compiler_version=["<=","4.6"]) +@expectedFailureAll(archs="arm", compiler="gcc", triple=".*-android") # gcc generates incorrect linetable I don't think these two XFAILs will be necessary now. Let's assume this will work until proven otherwise. Comment at: packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/main.c:5 @@ +4,3 @@ +#else +#define BREAKPOINT_INTRINSIC__asm__ __volatile__ ("int3"); +#endif this will generate the wrong expansion (leaves `()` hanging). I recommend using the following: `#define BREAKPOINT_INTRINSIC() ...` to make sure the parens are consumed. http://reviews.llvm.org/D15834 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D15533: Make the aarch64 lldb-server capable of debugging arm32 applications
tberghammer added a comment. @omjavaid: What is your opinion about submitting this patch in its current form with knowing that setting watchpoints from a 64bit lldb-server into 32bit inferior will fail? I think this patch is a step in the good direction to make a 64bit lldb-server capable of debugging a 32bit inferior. Considering how few arm/aarch64 (android) devices are supporting watchpoints I don't think we should block on that issue. http://reviews.llvm.org/D15533 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D15834: Handle hardcoded breakpoints on Windows (e.g., int3 or __debugbreak())
amccarth marked 3 inline comments as done. amccarth added a comment. Thanks for the Linux check Pavel. I'm running one last check and then I'll submit and keep an eye on the buildbots for the rest of the day. Comment at: packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/main.c:5 @@ +4,3 @@ +#else +#define BREAKPOINT_INTRINSIC__asm__ __volatile__ ("int3"); +#endif labath wrote: > this will generate the wrong expansion (leaves `()` hanging). I recommend > using the following: > `#define BREAKPOINT_INTRINSIC() ...` > to make sure the parens are consumed. Whoops. Nice catch. Thanks. http://reviews.llvm.org/D15834 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D15992: Centralize the handling of attach permissions on linux in tests
jingham added a subscriber: jingham. jingham added a comment. Would you mind adding a note to README-TestSuite saying that you have to call this function if you want to attach to the binary you are building as part of the testsuite. As with all docs it's likely very few will read the note, but we ought to reward the superhumanly diligent... http://reviews.llvm.org/D15992 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r257186 - Treat an embedded int3/__debugbreak() as a breakpoint on Windows, includes a cross-platform test.
Author: amccarth Date: Fri Jan 8 12:28:03 2016 New Revision: 257186 URL: http://llvm.org/viewvc/llvm-project?rev=257186&view=rev Log: Treat an embedded int3/__debugbreak() as a breakpoint on Windows, includes a cross-platform test. Added: lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/ lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/Makefile lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/TestDebugBreak.py lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/main.c Modified: lldb/trunk/source/Plugins/Process/Windows/Live/ProcessWindowsLive.cpp Added: lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/Makefile?rev=257186&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/Makefile (added) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/Makefile Fri Jan 8 12:28:03 2016 @@ -0,0 +1,5 @@ +LEVEL = ../../../make + +C_SOURCES := main.c + +include $(LEVEL)/Makefile.rules Added: lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/TestDebugBreak.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/TestDebugBreak.py?rev=257186&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/TestDebugBreak.py (added) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/TestDebugBreak.py Fri Jan 8 12:28:03 2016 @@ -0,0 +1,51 @@ +""" +Test embedded breakpoints, like `asm int 3;` in x86 or or `__debugbreak` on Windows. +""" + +from __future__ import print_function + +import os +import lldb +from lldbsuite.test.lldbtest import * +import lldbsuite.test.lldbutil as lldbutil + +class DebugBreakTestCase(TestBase): + +mydir = TestBase.compute_mydir(__file__) + +@skipIf(archs=not_in(["i386", "i686"])) +@no_debug_info_test +def test_asm_int_3(self): +"""Test that intrinsics like `__debugbreak();` and `asm {"int3"}` are treated like breakpoints.""" +self.build() +exe = os.path.join(os.getcwd(), "a.out") + +# Run the program. +target = self.dbg.CreateTarget(exe) +process = target.LaunchSimple(None, None, self.get_process_working_directory()) + +# We've hit the first stop, so grab the frame. +self.assertEqual(process.GetState(), lldb.eStateStopped) +thread = process.GetThreadAtIndex(0) +frame = thread.GetFrameAtIndex(0) + +# We should be in funciton 'bar'. +self.assertTrue(frame.IsValid()) +function_name = frame.GetFunctionName() +self.assertTrue('bar' in function_name) + +# We should be able to evaluate the parameter foo. +value = frame.EvaluateExpression('*foo') +self.assertEqual(value.GetValueAsSigned(), 42) + +# The counter should be 1 at the first stop and increase by 2 for each +# subsequent stop. +counter = 1 +while counter < 20: + value = frame.EvaluateExpression('count') + self.assertEqual(value.GetValueAsSigned(), counter) + counter += 2 + process.Continue() + +# The inferior should exit after the last iteration. +self.assertEqual(process.GetState(), lldb.eStateExited) Added: lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/main.c URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/main.c?rev=257186&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/main.c (added) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/main.c Fri Jan 8 12:28:03 2016 @@ -0,0 +1,29 @@ +#ifdef _MSC_VER +#include +#define BREAKPOINT_INTRINSIC()__debugbreak() +#else +#define BREAKPOINT_INTRINSIC()__asm__ __volatile__ ("int3") +#endif + +int +bar(int const *foo) +{ +int count = 0; +for (int i = 0; i < 10; ++i) +{ +count += 1; +BREAKPOINT_INTRINSIC(); +count += 1; +} +return *foo; +} + +int +main(int argc, char **argv) +{ +int foo = 42; +bar(&foo); +return 0; +} + + Modified: lldb/trunk/source/Plugins/Process/Windows/Live/ProcessWindowsLive.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Windows/Live/ProcessWindowsLive.cpp?rev=257186&r1=257185&r2=257186&v
Re: [Lldb-commits] [PATCH] D15684: Add note about the "thread until" command to the llvm-gdb cheatsheet.
jingham accepted this revision. jingham added a comment. This revision is now accepted and ready to land. Thanks for adding this, are you able to check it in? Otherwise I will. http://reviews.llvm.org/D15684 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D15684: Add note about the "thread until" command to the llvm-gdb cheatsheet.
jlebar added a comment. Thank you for the review! http://reviews.llvm.org/D15684 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D15684: Add note about the "thread until" command to the llvm-gdb cheatsheet.
jlebar added a comment. I just got commit access yesterday, will check in. http://reviews.llvm.org/D15684 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r257189 - Add note about the "thread until" command to the llvm-gdb cheatsheet.
Author: jlebar Date: Fri Jan 8 12:56:18 2016 New Revision: 257189 URL: http://llvm.org/viewvc/llvm-project?rev=257189&view=rev Log: Add note about the "thread until" command to the llvm-gdb cheatsheet. Differential Revision: http://reviews.llvm.org/D15684 Modified: lldb/trunk/www/lldb-gdb.html Modified: lldb/trunk/www/lldb-gdb.html URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/www/lldb-gdb.html?rev=257189&r1=257188&r2=257189&view=diff == --- lldb/trunk/www/lldb-gdb.html (original) +++ lldb/trunk/www/lldb-gdb.html Fri Jan 8 12:56:18 2016 @@ -307,6 +307,15 @@ Stop hook #1 added. +Run until we hit line 12 or control leaves the current function. + + +(gdb) until 12 + + +(lldb) thread until 12 + + ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D15684: Add note about the "thread until" command to the llvm-gdb cheatsheet.
This revision was automatically updated to reflect the committed changes. Closed by commit rL257189: Add note about the "thread until" command to the llvm-gdb cheatsheet. (authored by jlebar). Changed prior to commit: http://reviews.llvm.org/D15684?vs=43346&id=44340#toc Repository: rL LLVM http://reviews.llvm.org/D15684 Files: lldb/trunk/www/lldb-gdb.html Index: lldb/trunk/www/lldb-gdb.html === --- lldb/trunk/www/lldb-gdb.html +++ lldb/trunk/www/lldb-gdb.html @@ -307,6 +307,15 @@ Stop hook #1 added. +Run until we hit line 12 or control leaves the current function. + + +(gdb) until 12 + + +(lldb) thread until 12 + + Index: lldb/trunk/www/lldb-gdb.html === --- lldb/trunk/www/lldb-gdb.html +++ lldb/trunk/www/lldb-gdb.html @@ -307,6 +307,15 @@ Stop hook #1 added. +Run until we hit line 12 or control leaves the current function. + + +(gdb) until 12 + + +(lldb) thread until 12 + + ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D15978: Prevent infinite recursive loop in AppleObjCTrampolineHandler constructor
fjricci added a comment. Would you still like me to make the parameter change to InferiorCallMmap before merging? http://reviews.llvm.org/D15978 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D15978: Prevent infinite recursive loop in AppleObjCTrampolineHandler constructor
jingham added a comment. If you don't mind, please add the same code to the InferiorCallMunmap, and then add the same thing to InferiorCall, but that's the one that should take a parameter in case somebody does end up using the general function for something that could throw. Otherwise we'll just end up coming back to this again later... http://reviews.llvm.org/D15978 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D15978: Prevent infinite recursive loop in AppleObjCTrampolineHandler constructor
fjricci added a comment. Sounds good, will do. http://reviews.llvm.org/D15978 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D15978: Prevent infinite recursive loop in AppleObjCTrampolineHandler constructor
fjricci updated this revision to Diff 44361. fjricci added a comment. Disable exception trapping by default on all functions in InferiorCallPOSIX http://reviews.llvm.org/D15978 Files: source/Plugins/Process/Utility/InferiorCallPOSIX.cpp source/Plugins/Process/Utility/InferiorCallPOSIX.h Index: source/Plugins/Process/Utility/InferiorCallPOSIX.h === --- source/Plugins/Process/Utility/InferiorCallPOSIX.h +++ source/Plugins/Process/Utility/InferiorCallPOSIX.h @@ -31,7 +31,8 @@ bool InferiorCallMunmap(Process *proc, lldb::addr_t addr, lldb::addr_t length); -bool InferiorCall(Process *proc, const Address *address, lldb::addr_t &returned_func); +bool InferiorCall(Process *proc, const Address *address, lldb::addr_t &returned_func, + bool trap_exceptions = false); } // namespace lldb_private Index: source/Plugins/Process/Utility/InferiorCallPOSIX.cpp === --- source/Plugins/Process/Utility/InferiorCallPOSIX.cpp +++ source/Plugins/Process/Utility/InferiorCallPOSIX.cpp @@ -72,6 +72,7 @@ options.SetTryAllThreads(true); options.SetDebug (false); options.SetTimeoutUsec(50); +options.SetTrapExceptions(false); addr_t prot_arg, flags_arg = 0; if (prot == eMmapProtNone) @@ -172,6 +173,7 @@ options.SetTryAllThreads(true); options.SetDebug (false); options.SetTimeoutUsec(50); +options.SetTrapExceptions(false); AddressRange munmap_range; if (sc.GetAddressRange(range_scope, 0, use_inline_block_range, munmap_range)) @@ -214,7 +216,8 @@ bool lldb_private::InferiorCall (Process *process, const Address *address, -addr_t &returned_func) +addr_t &returned_func, +bool trap_exceptions) { Thread *thread = process->GetThreadList().GetSelectedThread().get(); if (thread == NULL || address == NULL) @@ -227,6 +230,7 @@ options.SetTryAllThreads(true); options.SetDebug (false); options.SetTimeoutUsec(50); +options.SetTrapExceptions(trap_exceptions); ClangASTContext *clang_ast_context = process->GetTarget().GetScratchClangASTContext(); CompilerType clang_void_ptr_type = clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType(); Index: source/Plugins/Process/Utility/InferiorCallPOSIX.h === --- source/Plugins/Process/Utility/InferiorCallPOSIX.h +++ source/Plugins/Process/Utility/InferiorCallPOSIX.h @@ -31,7 +31,8 @@ bool InferiorCallMunmap(Process *proc, lldb::addr_t addr, lldb::addr_t length); -bool InferiorCall(Process *proc, const Address *address, lldb::addr_t &returned_func); +bool InferiorCall(Process *proc, const Address *address, lldb::addr_t &returned_func, + bool trap_exceptions = false); } // namespace lldb_private Index: source/Plugins/Process/Utility/InferiorCallPOSIX.cpp === --- source/Plugins/Process/Utility/InferiorCallPOSIX.cpp +++ source/Plugins/Process/Utility/InferiorCallPOSIX.cpp @@ -72,6 +72,7 @@ options.SetTryAllThreads(true); options.SetDebug (false); options.SetTimeoutUsec(50); +options.SetTrapExceptions(false); addr_t prot_arg, flags_arg = 0; if (prot == eMmapProtNone) @@ -172,6 +173,7 @@ options.SetTryAllThreads(true); options.SetDebug (false); options.SetTimeoutUsec(50); +options.SetTrapExceptions(false); AddressRange munmap_range; if (sc.GetAddressRange(range_scope, 0, use_inline_block_range, munmap_range)) @@ -214,7 +216,8 @@ bool lldb_private::InferiorCall (Process *process, const Address *address, -addr_t &returned_func) +addr_t &returned_func, +bool trap_exceptions) { Thread *thread = process->GetThreadList().GetSelectedThread().get(); if (thread == NULL || address == NULL) @@ -227,6 +230,7 @@ options.SetTryAllThreads(true); options.SetDebug (false); options.SetTimeoutUsec(50); +options.SetTrapExceptions(trap_exceptions); ClangASTContext *clang_ast_context = process->GetTarget().GetScratchClangASTContext(); CompilerType clang_void_ptr_type = clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType(); ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D15978: Prevent infinite recursive loop in AppleObjCTrampolineHandler constructor
jingham accepted this revision. jingham added a comment. Great, thanks! http://reviews.llvm.org/D15978 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r257204 - Prevent infinite recursive loop in AppleObjCTrampolineHandler constructor
Author: sas Date: Fri Jan 8 14:32:35 2016 New Revision: 257204 URL: http://llvm.org/viewvc/llvm-project?rev=257204&view=rev Log: Prevent infinite recursive loop in AppleObjCTrampolineHandler constructor Summary: When we construct AppleObjCTrampolineHandler, if m_impl_fn_addr is invalid, we call CanJIT(). If the gdb remote process does not support allocating and deallocating memory, this call stack will include a call to the AppleObjCRuntime constructor. The AppleObjCRuntime constructor will then call the AppleObjCTrampolineHandler constructor, creating a recursive call loop that eventually overflows the stack and segfaults. Avoid this call loop by not constructing the AppleObjCTrampolineHandler within AppleObjCRuntime until we actually need to use it. Reviewers: clayborg, jingham Subscribers: sas, lldb-commits Differential Revision: http://reviews.llvm.org/D15978 Change by Francis Ricci Modified: lldb/trunk/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp lldb/trunk/source/Plugins/Process/Utility/InferiorCallPOSIX.h Modified: lldb/trunk/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp?rev=257204&r1=257203&r2=257204&view=diff == --- lldb/trunk/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp (original) +++ lldb/trunk/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp Fri Jan 8 14:32:35 2016 @@ -72,6 +72,7 @@ lldb_private::InferiorCallMmap (Process options.SetTryAllThreads(true); options.SetDebug (false); options.SetTimeoutUsec(50); +options.SetTrapExceptions(false); addr_t prot_arg, flags_arg = 0; if (prot == eMmapProtNone) @@ -172,6 +173,7 @@ lldb_private::InferiorCallMunmap (Proces options.SetTryAllThreads(true); options.SetDebug (false); options.SetTimeoutUsec(50); +options.SetTrapExceptions(false); AddressRange munmap_range; if (sc.GetAddressRange(range_scope, 0, use_inline_block_range, munmap_range)) @@ -214,7 +216,8 @@ lldb_private::InferiorCallMunmap (Proces bool lldb_private::InferiorCall (Process *process, const Address *address, -addr_t &returned_func) +addr_t &returned_func, +bool trap_exceptions) { Thread *thread = process->GetThreadList().GetSelectedThread().get(); if (thread == NULL || address == NULL) @@ -227,6 +230,7 @@ lldb_private::InferiorCall (Process *pro options.SetTryAllThreads(true); options.SetDebug (false); options.SetTimeoutUsec(50); +options.SetTrapExceptions(trap_exceptions); ClangASTContext *clang_ast_context = process->GetTarget().GetScratchClangASTContext(); CompilerType clang_void_ptr_type = clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType(); Modified: lldb/trunk/source/Plugins/Process/Utility/InferiorCallPOSIX.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/InferiorCallPOSIX.h?rev=257204&r1=257203&r2=257204&view=diff == --- lldb/trunk/source/Plugins/Process/Utility/InferiorCallPOSIX.h (original) +++ lldb/trunk/source/Plugins/Process/Utility/InferiorCallPOSIX.h Fri Jan 8 14:32:35 2016 @@ -31,7 +31,8 @@ bool InferiorCallMmap(Process *proc, lld bool InferiorCallMunmap(Process *proc, lldb::addr_t addr, lldb::addr_t length); -bool InferiorCall(Process *proc, const Address *address, lldb::addr_t &returned_func); +bool InferiorCall(Process *proc, const Address *address, lldb::addr_t &returned_func, + bool trap_exceptions = false); } // namespace lldb_private ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D15978: Prevent infinite recursive loop in AppleObjCTrampolineHandler constructor
sas closed this revision. sas added a comment. Committed as r257204. http://reviews.llvm.org/D15978 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r257207 - Remove XFAIL from TestThreadStates on Windows.
Author: zturner Date: Fri Jan 8 15:08:19 2016 New Revision: 257207 URL: http://llvm.org/viewvc/llvm-project?rev=257207&view=rev Log: Remove XFAIL from TestThreadStates on Windows. Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py?rev=257207&r1=257206&r2=257207&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py Fri Jan 8 15:08:19 2016 @@ -19,7 +19,6 @@ class ThreadStateTestCase(TestBase): @expectedFailureDarwin("rdar://15367566") @expectedFailureFreeBSD('llvm.org/pr15824') @expectedFailureLinux("llvm.org/pr15824") # thread states not properly maintained -@expectedFailureWindows("llvm.org/pr24668") # Breakpoints not resolved correctly def test_state_after_breakpoint(self): """Test thread state after breakpoint.""" self.build(dictionary=self.getBuildFlags(use_cpp11=False)) ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r257208 - XFAIL 2 more tests based on SWIG version.
Author: zturner Date: Fri Jan 8 15:08:24 2016 New Revision: 257208 URL: http://llvm.org/viewvc/llvm-project?rev=257208&view=rev Log: XFAIL 2 more tests based on SWIG version. There's a bug in versions of SWIG prior to 3.0.8 that prevent these tests from succeeding with Python 3.x Modified: lldb/trunk/packages/Python/lldbsuite/test/python_api/module_section/TestModuleAndSection.py lldb/trunk/packages/Python/lldbsuite/test/python_api/value/linked_list/TestValueAPILinkedList.py Modified: lldb/trunk/packages/Python/lldbsuite/test/python_api/module_section/TestModuleAndSection.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/python_api/module_section/TestModuleAndSection.py?rev=257208&r1=257207&r2=257208&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/python_api/module_section/TestModuleAndSection.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/python_api/module_section/TestModuleAndSection.py Fri Jan 8 15:08:24 2016 @@ -16,6 +16,8 @@ class ModuleAndSectionAPIsTestCase(TestB mydir = TestBase.compute_mydir(__file__) +# Py3 asserts due to a bug in SWIG. A fix for this was upstreamed into SWIG 3.0.8. +@skipIf(py_version=['>=', (3,0)], swig_version=['<', (3,0,8)]) @add_test_categories(['pyapi']) def test_module_and_section(self): """Test module and section APIs.""" Modified: lldb/trunk/packages/Python/lldbsuite/test/python_api/value/linked_list/TestValueAPILinkedList.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/python_api/value/linked_list/TestValueAPILinkedList.py?rev=257208&r1=257207&r2=257208&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/python_api/value/linked_list/TestValueAPILinkedList.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/python_api/value/linked_list/TestValueAPILinkedList.py Fri Jan 8 15:08:24 2016 @@ -25,6 +25,8 @@ class ValueAsLinkedListTestCase(TestBase # Find the line number to break at. self.line = line_number('main.cpp', '// Break at this line') +# Py3 asserts due to a bug in SWIG. A fix for this was upstreamed into SWIG 3.0.8. +@skipIf(py_version=['>=', (3,0)], swig_version=['<', (3,0,8)]) @add_test_categories(['pyapi']) def test(self): """Exercise SBValue API linked_list_iter.""" ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r257209 - Add support for the LEAVE x86 instruction to AssemblyParse_x86.
Author: jmolenda Date: Fri Jan 8 15:13:26 2016 New Revision: 257209 URL: http://llvm.org/viewvc/llvm-project?rev=257209&view=rev Log: Add support for the LEAVE x86 instruction to AssemblyParse_x86. Modified: lldb/trunk/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp Modified: lldb/trunk/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp?rev=257209&r1=257208&r2=257209&view=diff == --- lldb/trunk/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp (original) +++ lldb/trunk/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp Fri Jan 8 15:13:26 2016 @@ -155,6 +155,7 @@ private: bool mov_reg_to_local_stack_frame_p (int& regno, int& fp_offset); bool ret_pattern_p (); bool pop_rbp_pattern_p (); +bool leave_pattern_p (); bool call_next_insn_pattern_p(); uint32_t extract_4 (uint8_t *b); bool machine_regno_to_lldb_regno (int machine_regno, uint32_t& lldb_regno); @@ -492,6 +493,14 @@ AssemblyParse_x86::pop_rbp_pattern_p () return (*p == 0x5d); } +// leave [0xc9] +bool +AssemblyParse_x86::leave_pattern_p () +{ +uint8_t *p = m_cur_insn_bytes; +return (*p == 0xc9); +} + // call $0 [0xe8 0x0 0x0 0x0 0x0] bool AssemblyParse_x86::call_next_insn_pattern_p () @@ -780,8 +789,7 @@ AssemblyParse_x86::get_non_call_site_unw if (machine_regno == (int)m_machine_fp_regnum) { -row->GetCFAValue().SetIsRegisterPlusOffset (m_lldb_sp_regnum, -row->GetCFAValue().GetOffset()); +row->GetCFAValue().SetIsRegisterPlusOffset (m_lldb_sp_regnum, row->GetCFAValue().GetOffset()); } in_epilogue = true; @@ -792,12 +800,35 @@ AssemblyParse_x86::get_non_call_site_unw // we need to add a new row of instructions. if (row->GetCFAValue().GetRegisterNumber() == m_lldb_sp_regnum) { -row->GetCFAValue().SetIsRegisterPlusOffset(m_lldb_sp_regnum, -current_sp_bytes_offset_from_cfa); +row->GetCFAValue().SetIsRegisterPlusOffset (m_lldb_sp_regnum, current_sp_bytes_offset_from_cfa); row_updated = true; } } +// The LEAVE instruction moves the value from rbp into rsp and pops +// a value off the stack into rbp (restoring the caller's rbp value). +// It is the opposite of ENTER, or 'push rbp, mov rsp rbp'. +else if (leave_pattern_p ()) +{ +// We're going to copy the value in rbp into rsp, so re-set the sp offset +// based on the CFAValue. Also, adjust it to recognize that we're popping +// the saved rbp value off the stack. +current_sp_bytes_offset_from_cfa = row->GetCFAValue().GetOffset(); +current_sp_bytes_offset_from_cfa -= m_wordsize; +row->GetCFAValue().SetOffset (current_sp_bytes_offset_from_cfa); + +// rbp is restored to the caller's value +saved_registers[m_machine_fp_regnum] = false; +row->RemoveRegisterInfo (m_lldb_fp_regnum); + +// cfa is now in terms of rsp again. +row->GetCFAValue().SetIsRegisterPlusOffset (m_lldb_sp_regnum, row->GetCFAValue().GetOffset()); +row->GetCFAValue().SetOffset (current_sp_bytes_offset_from_cfa); + +in_epilogue = true; +row_updated = true; +} + else if (mov_reg_to_local_stack_frame_p (machine_regno, stack_offset) && nonvolatile_reg_p (machine_regno) && machine_regno_to_lldb_regno (machine_regno, lldb_regno) @@ -1137,15 +1168,15 @@ AssemblyParse_x86::augment_unwind_plan_f // The only case we care about is epilogue: // [0x5d] pop %rbp/%ebp // => [0xc3] ret -if (pop_rbp_pattern_p ()) +if (pop_rbp_pattern_p () || leave_pattern_p ()) { if (target->ReadMemory (m_cur_insn, prefer_file_cache, m_cur_insn_bytes, 1, error) != static_cast(-1) && ret_pattern_p ()) { row->SetOffset (offset); -row->GetCFAValue().SetIsRegisterPlusOffset ( -first_row->GetCFAValue().GetRegisterNumber(), m_wordsize); +row->GetCFAValue().SetIsRegisterPlusOffset (first_row->GetCFAValue().GetRegisterNumber(), +m_wordsize); UnwindPlan::RowSP new_row(new UnwindPlan::Row(*row)); unwind_plan.InsertRow (new_row); ___ lldb-commits mailing list lldb-commits
[Lldb-commits] [lldb] r257210 - Re-apply r257117 (reverted in r257138 temporarily),
Author: jmolenda Date: Fri Jan 8 15:40:11 2016 New Revision: 257210 URL: http://llvm.org/viewvc/llvm-project?rev=257210&view=rev Log: Re-apply r257117 (reverted in r257138 temporarily), with the one change that ThreadPlanStepOut::ThreadPlanStepOut will now only advance the return address breakpoint to the end of a source line, if we have source line debug information. It will not advance to the end of a Symbol if we lack source line information. This, or the recognition of the LEAVE instruction in r257209, would have fixed the regression that Siva was seeing. Both were good changes, so I've made both. Original commit message: Performance improvement: Change lldb so that it puts a breakpoint on the first branch instruction after a function return (or the end of a source line), instead of a breakpoint on the return address, to skip an extra stop & start of the inferior process. I changed Process::AdvanceAddressToNextBranchInstruction to not take an optional InstructionList argument - no callers are providing a cached InstructionList today, and if this function was going to do that, the right thing to do would be to fill out / use a DisassemblerSP which is a disassembler with the InstructionList for this address range. http://reviews.llvm.org/D15708 Modified: lldb/trunk/include/lldb/Target/Process.h lldb/trunk/include/lldb/Target/Thread.h lldb/trunk/include/lldb/Target/ThreadPlanStepOut.h lldb/trunk/source/Target/Process.cpp lldb/trunk/source/Target/Thread.cpp lldb/trunk/source/Target/ThreadPlanShouldStopHere.cpp lldb/trunk/source/Target/ThreadPlanStepOut.cpp lldb/trunk/source/Target/ThreadPlanStepOverRange.cpp Modified: lldb/trunk/include/lldb/Target/Process.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Process.h?rev=257210&r1=257209&r2=257210&view=diff == --- lldb/trunk/include/lldb/Target/Process.h (original) +++ lldb/trunk/include/lldb/Target/Process.h Fri Jan 8 15:40:11 2016 @@ -3149,6 +3149,34 @@ public: void ResetImageToken(size_t token); +//-- +/// Find the next branch instruction to set a breakpoint on +/// +/// When instruction stepping through a source line, instead of +/// stepping through each instruction, we can put a breakpoint on +/// the next branch instruction (within the range of instructions +/// we are stepping through) and continue the process to there, +/// yielding significant performance benefits over instruction +/// stepping. +/// +/// @param[in] default_stop_addr +/// The address of the instruction where lldb would put a +/// breakpoint normally. +/// +/// @param[in] range_bounds +/// The range which the breakpoint must be contained within. +/// Typically a source line. +/// +/// @return +/// The address of the next branch instruction, or the end of +/// the range provided in range_bounds. If there are any +/// problems with the disassembly or getting the instructions, +/// the original default_stop_addr will be returned. +//-- +Address +AdvanceAddressToNextBranchInstruction (Address default_stop_addr, + AddressRange range_bounds); + protected: void SetState (lldb::EventSP &event_sp); Modified: lldb/trunk/include/lldb/Target/Thread.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Thread.h?rev=257210&r1=257209&r2=257210&view=diff == --- lldb/trunk/include/lldb/Target/Thread.h (original) +++ lldb/trunk/include/lldb/Target/Thread.h Fri Jan 8 15:40:11 2016 @@ -888,6 +888,16 @@ public: /// @param[in] run_vote ///See standard meanings for the stop & run votes in ThreadPlan.h. /// +/// @param[in] continue_to_next_branch +///Normally this will enqueue a plan that will put a breakpoint on the return address and continue +///to there. If continue_to_next_branch is true, this is an operation not involving the user -- +///e.g. stepping "next" in a source line and we instruction stepped into another function -- +///so instead of putting a breakpoint on the return address, advance the breakpoint to the +///end of the source line that is doing the call, or until the next flow control instruction. +///If the return value from the function call is to be retrieved / displayed to the user, you must stop +///on the return address. The return value may be stored in volatile registers which are overwritten +///before the next branch instruction. +/// /// @return /// A shared pointer to the newly queued thread p
[Lldb-commits] [lldb] r257219 - Remove XFAIL from a few tests that have been fixed on Windows.
Author: zturner Date: Fri Jan 8 16:21:40 2016 New Revision: 257219 URL: http://llvm.org/viewvc/llvm-project?rev=257219&view=rev Log: Remove XFAIL from a few tests that have been fixed on Windows. Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/language_category_updates/TestDataFormatterLanguageCategoryUpdates.py lldb/trunk/packages/Python/lldbsuite/test/functionalities/inline-stepping/TestInlineStepping.py lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break_plus_condition/TestThreadSpecificBpPlusCondition.py Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/language_category_updates/TestDataFormatterLanguageCategoryUpdates.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/language_category_updates/TestDataFormatterLanguageCategoryUpdates.py?rev=257219&r1=257218&r2=257219&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/language_category_updates/TestDataFormatterLanguageCategoryUpdates.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/language_category_updates/TestDataFormatterLanguageCategoryUpdates.py Fri Jan 8 16:21:40 2016 @@ -21,7 +21,6 @@ class LanguageCategoryUpdatesTestCase(Te # Find the line number to break at. self.line = line_number('main.cpp', '// break here') -@expectedFailureWindows("llvm.org/pr24462") # Data formatters have problems on Windows def test_with_run_command(self): """Test that LLDB correctly cleans caches when language categories change.""" # This is the function to remove the custom formats in order to have a Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/inline-stepping/TestInlineStepping.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/inline-stepping/TestInlineStepping.py?rev=257219&r1=257218&r2=257219&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/inline-stepping/TestInlineStepping.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/inline-stepping/TestInlineStepping.py Fri Jan 8 16:21:40 2016 @@ -16,7 +16,6 @@ class TestInlineStepping(TestBase): @add_test_categories(['pyapi']) @expectedFailureFreeBSD('llvm.org/pr17214') @expectedFailureIcc # Not really a bug. ICC combines two inlined functions. -@expectedFailureWindows("llvm.org/pr24778") # failed 1/365 dosep runs, (i386-clang), TestInlineStepping.py:237 failed to stop at first breakpoint in main @expectedFailureAll(oslist=["linux"], archs=["i386"]) def test_with_python_api(self): Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break_plus_condition/TestThreadSpecificBpPlusCondition.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break_plus_condition/TestThreadSpecificBpPlusCondition.py?rev=257219&r1=257218&r2=257219&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break_plus_condition/TestThreadSpecificBpPlusCondition.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break_plus_condition/TestThreadSpecificBpPlusCondition.py Fri Jan 8 16:21:40 2016 @@ -20,7 +20,6 @@ class ThreadSpecificBreakPlusConditionTe @skipIfFreeBSD # test frequently times out or hangs @expectedFailureFreeBSD('llvm.org/pr18522') # hits break in another thread in testrun @add_test_categories(['pyapi']) -@expectedFailureWindows # Thread specific breakpoints cause the inferior to crash. @expectedFlakeyLinux # this test fails 6/100 dosep runs def test_python(self): """Test that we obey thread conditioned breakpoints.""" ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r257228 - Fix TestDebugBreak.py failure with gcc, for loop declarations are not allowed by default with gcc
Author: chying Date: Fri Jan 8 17:10:56 2016 New Revision: 257228 URL: http://llvm.org/viewvc/llvm-project?rev=257228&view=rev Log: Fix TestDebugBreak.py failure with gcc, for loop declarations are not allowed by default with gcc - fix buildbot breakage after r257186 - move declaration outside of for loop Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/main.c Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/main.c URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/main.c?rev=257228&r1=257227&r2=257228&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/main.c (original) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/main.c Fri Jan 8 17:10:56 2016 @@ -8,8 +8,8 @@ int bar(int const *foo) { -int count = 0; -for (int i = 0; i < 10; ++i) +int count = 0, i = 0; +for (; i < 10; ++i) { count += 1; BREAKPOINT_INTRINSIC(); ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r257229 - In the questionmark packet ("T"), print the "threads:" and "thread-pcs:"
Author: jmolenda Date: Fri Jan 8 17:16:03 2016 New Revision: 257229 URL: http://llvm.org/viewvc/llvm-project?rev=257229&view=rev Log: In the questionmark packet ("T"), print the "threads:" and "thread-pcs:" keys before we print the libdispatch queues keys (qname, qkind, qserialnum) to make it easier to read the packet by hand. No function difference, just reordering the keys in the output. Modified: lldb/trunk/tools/debugserver/source/RNBRemote.cpp Modified: lldb/trunk/tools/debugserver/source/RNBRemote.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/RNBRemote.cpp?rev=257229&r1=257228&r2=257229&view=diff == --- lldb/trunk/tools/debugserver/source/RNBRemote.cpp (original) +++ lldb/trunk/tools/debugserver/source/RNBRemote.cpp Fri Jan 8 17:16:03 2016 @@ -2700,36 +2700,6 @@ RNBRemote::SendStopReplyPacketForThread } } -thread_identifier_info_data_t thread_ident_info; -if (DNBThreadGetIdentifierInfo (pid, tid, &thread_ident_info)) -{ -if (thread_ident_info.dispatch_qaddr != 0) -{ -ostrm << "qaddr:" << std::hex << thread_ident_info.dispatch_qaddr << ';'; -const DispatchQueueOffsets *dispatch_queue_offsets = GetDispatchQueueOffsets(); -if (dispatch_queue_offsets) -{ -std::string queue_name; -uint64_t queue_width = 0; -uint64_t queue_serialnum = 0; -dispatch_queue_offsets->GetThreadQueueInfo(pid, thread_ident_info.dispatch_qaddr, queue_name, queue_width, queue_serialnum); -if (!queue_name.empty()) -{ -ostrm << "qname:"; -append_hex_value(ostrm, queue_name.data(), queue_name.size(), false); -ostrm << ';'; -} -if (queue_width == 1) -ostrm << "qkind:serial;"; -else if (queue_width > 1) -ostrm << "qkind:concurrent;"; - -if (queue_serialnum > 0) -ostrm << "qserialnum:" << DECIMAL << queue_serialnum << ';'; -} -} -} - // If a 'QListThreadsInStopReply' was sent to enable this feature, we // will send all thread IDs back in the "threads" key whose value is // a list of hex thread IDs separated by commas: @@ -2812,6 +2782,36 @@ RNBRemote::SendStopReplyPacketForThread } +thread_identifier_info_data_t thread_ident_info; +if (DNBThreadGetIdentifierInfo (pid, tid, &thread_ident_info)) +{ +if (thread_ident_info.dispatch_qaddr != 0) +{ +ostrm << "qaddr:" << std::hex << thread_ident_info.dispatch_qaddr << ';'; +const DispatchQueueOffsets *dispatch_queue_offsets = GetDispatchQueueOffsets(); +if (dispatch_queue_offsets) +{ +std::string queue_name; +uint64_t queue_width = 0; +uint64_t queue_serialnum = 0; +dispatch_queue_offsets->GetThreadQueueInfo(pid, thread_ident_info.dispatch_qaddr, queue_name, queue_width, queue_serialnum); +if (!queue_name.empty()) +{ +ostrm << "qname:"; +append_hex_value(ostrm, queue_name.data(), queue_name.size(), false); +ostrm << ';'; +} +if (queue_width == 1) +ostrm << "qkind:serial;"; +else if (queue_width > 1) +ostrm << "qkind:concurrent;"; + +if (queue_serialnum > 0) +ostrm << "qserialnum:" << DECIMAL << queue_serialnum << ';'; +} +} +} + if (g_num_reg_entries == 0) InitializeRegisters (); ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [lldb] r257228 - Fix TestDebugBreak.py failure with gcc, for loop declarations are not allowed by default with gcc
Oops! Thanks for the fix. I'd tested only with clang, which seems to apply C++ rules even with .c files. I'm curious why I didn't see this break on any of the build bots. Adrian. On Fri, Jan 8, 2016 at 3:10 PM, Ying Chen via lldb-commits < lldb-commits@lists.llvm.org> wrote: > Author: chying > Date: Fri Jan 8 17:10:56 2016 > New Revision: 257228 > > URL: http://llvm.org/viewvc/llvm-project?rev=257228&view=rev > Log: > Fix TestDebugBreak.py failure with gcc, for loop declarations are not > allowed by default with gcc > > - fix buildbot breakage after r257186 > - move declaration outside of for loop > > Modified: > > lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/main.c > > Modified: > lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/main.c > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/main.c?rev=257228&r1=257227&r2=257228&view=diff > > == > --- > lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/main.c > (original) > +++ > lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/main.c > Fri Jan 8 17:10:56 2016 > @@ -8,8 +8,8 @@ > int > bar(int const *foo) > { > -int count = 0; > -for (int i = 0; i < 10; ++i) > +int count = 0, i = 0; > +for (; i < 10; ++i) > { > count += 1; > BREAKPOINT_INTRINSIC(); > > > ___ > lldb-commits mailing list > lldb-commits@lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits > ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D16017: Fix TestMiniDump.py for Python 3
amccarth created this revision. amccarth added a reviewer: zturner. amccarth added a subscriber: lldb-commits. Under Python 3, lldb sees an extra frame on the stack, so I check that the stack has at least the number frames we expect. Python 3 doesn't have dict.iteritems(). I used a wrapper function from six to keep this portable between the two versions. http://reviews.llvm.org/D16017 Files: packages/Python/lldbsuite/test/functionalities/postmortem/minidump/TestMiniDump.py Index: packages/Python/lldbsuite/test/functionalities/postmortem/minidump/TestMiniDump.py === --- packages/Python/lldbsuite/test/functionalities/postmortem/minidump/TestMiniDump.py +++ packages/Python/lldbsuite/test/functionalities/postmortem/minidump/TestMiniDump.py @@ -3,7 +3,7 @@ """ from __future__ import print_function - +from six import iteritems import lldb @@ -83,8 +83,8 @@ thread = process.GetThreadAtIndex(0) expected_stack = { 0: 'bar', 1: 'foo', 2: 'main' } -self.assertEqual(thread.GetNumFrames(), len(expected_stack)) -for index, name in expected_stack.iteritems(): +self.assertGreaterEqual(thread.GetNumFrames(), len(expected_stack)) +for index, name in iteritems(expected_stack): frame = thread.GetFrameAtIndex(index) self.assertTrue(frame.IsValid()) function_name = frame.GetFunctionName() Index: packages/Python/lldbsuite/test/functionalities/postmortem/minidump/TestMiniDump.py === --- packages/Python/lldbsuite/test/functionalities/postmortem/minidump/TestMiniDump.py +++ packages/Python/lldbsuite/test/functionalities/postmortem/minidump/TestMiniDump.py @@ -3,7 +3,7 @@ """ from __future__ import print_function - +from six import iteritems import lldb @@ -83,8 +83,8 @@ thread = process.GetThreadAtIndex(0) expected_stack = { 0: 'bar', 1: 'foo', 2: 'main' } -self.assertEqual(thread.GetNumFrames(), len(expected_stack)) -for index, name in expected_stack.iteritems(): +self.assertGreaterEqual(thread.GetNumFrames(), len(expected_stack)) +for index, name in iteritems(expected_stack): frame = thread.GetFrameAtIndex(index) self.assertTrue(frame.IsValid()) function_name = frame.GetFunctionName() ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r257234 - Fix a thinko in the asserts in GetDynamicTypeAndAddress. It was requiring that the
Author: jingham Date: Fri Jan 8 17:44:51 2016 New Revision: 257234 URL: http://llvm.org/viewvc/llvm-project?rev=257234&view=rev Log: Fix a thinko in the asserts in GetDynamicTypeAndAddress. It was requiring that the process in the incoming value be non-null, but Value Objects created off the target don't necessarily have a process. In that case, having the targets the same is good enough. 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=257234&r1=257233&r2=257234&view=diff == --- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp (original) +++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp Fri Jan 8 17:44:51 2016 @@ -405,9 +405,18 @@ AppleObjCRuntimeV2::GetDynamicTypeAndAdd Address &address, Value::ValueType &value_type) { -// The Runtime is attached to a particular process, you shouldn't pass in a value from another process. -assert (in_value.GetProcessSP().get() == m_process); +// We should never get here with a null process... assert (m_process != NULL); + +// The Runtime is attached to a particular process, you shouldn't pass in a value from another process. +// Note, however, the process might be NULL (e.g. if the value was made with SBTarget::EvaluateExpression...) +// in which case it is sufficient if the target's match: + +Process *process = in_value.GetProcessSP().get(); +if (process) +assert (process == m_process); +else +assert (in_value.GetTargetSP().get() == m_process->CalculateTarget().get()); class_type_or_name.Clear(); value_type = Value::ValueType::eValueTypeScalar; ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r257235 - Fiddling with Pavel's fix for getting the breakpoint right when there's debug info for sleep.
Author: jingham Date: Fri Jan 8 18:08:16 2016 New Revision: 257235 URL: http://llvm.org/viewvc/llvm-project?rev=257235&view=rev Log: Fiddling with Pavel's fix for getting the breakpoint right when there's debug info for sleep. I prefer to use "-p" over using line_number and then setting by line because it's makes it possible to see what the breakpoint is at the site where you make the breakpoint. So I switched it back to -p but specified the source file as well, which is an "all within lldb" way of doing what Pavel's fix did. Modified: lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py Modified: lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py?rev=257235&r1=257234&r2=257235&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py Fri Jan 8 18:08:16 2016 @@ -19,7 +19,6 @@ class DriverBatchModeTest (TestBase): TestBase.setUp(self) # Our simple source filename. self.source = 'main.c' -self.line = line_number(self.source, 'Stop here to unset keep_waiting') self.victim = None def expect_string (self, string): @@ -142,7 +141,7 @@ class DriverBatchModeTest (TestBase): self.victim.expect("Waiting") -run_commands = ' -b -o "process attach -p %d" -o "breakpoint set --file %s --line %d -N keep_waiting" -o "continue" -o "break delete keep_waiting" -o "expr keep_waiting = 0" -o "continue" ' % (victim_pid, self.source, self.line) +run_commands = ' -b -o "process attach -p %d" -o "breakpoint set --file %s -p \'Stop here to unset keep_waiting\' -N keep_waiting" -o "continue" -o "break delete keep_waiting" -o "expr keep_waiting = 0" -o "continue" ' % (victim_pid, self.source) self.child = pexpect.spawn('%s %s %s %s' % (lldbtest_config.lldbExec, self.lldbOption, run_commands, exe)) child = self.child ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [lldb] r257228 - Fix TestDebugBreak.py failure with gcc, for loop declarations are not allowed by default with gcc
I think it's actually C99 rules, but... Jim > On Jan 8, 2016, at 3:25 PM, Adrian McCarthy via lldb-commits > wrote: > > Oops! Thanks for the fix. I'd tested only with clang, which seems to apply > C++ rules even with .c files. > > I'm curious why I didn't see this break on any of the build bots. > > Adrian. > > On Fri, Jan 8, 2016 at 3:10 PM, Ying Chen via lldb-commits > wrote: > Author: chying > Date: Fri Jan 8 17:10:56 2016 > New Revision: 257228 > > URL: http://llvm.org/viewvc/llvm-project?rev=257228&view=rev > Log: > Fix TestDebugBreak.py failure with gcc, for loop declarations are not allowed > by default with gcc > > - fix buildbot breakage after r257186 > - move declaration outside of for loop > > Modified: > > lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/main.c > > Modified: > lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/main.c > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/main.c?rev=257228&r1=257227&r2=257228&view=diff > == > --- > lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/main.c > (original) > +++ > lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/main.c > Fri Jan 8 17:10:56 2016 > @@ -8,8 +8,8 @@ > int > bar(int const *foo) > { > -int count = 0; > -for (int i = 0; i < 10; ++i) > +int count = 0, i = 0; > +for (; i < 10; ++i) > { > count += 1; > BREAKPOINT_INTRINSIC(); > > > ___ > lldb-commits mailing list > lldb-commits@lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits > > ___ > lldb-commits mailing list > lldb-commits@lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r257242 - Writing a test case for r257234 I found another place that was
Author: jingham Date: Fri Jan 8 19:20:30 2016 New Revision: 257242 URL: http://llvm.org/viewvc/llvm-project?rev=257242&view=rev Log: Writing a test case for r257234 I found another place that was assuming a ValueObject always has a process. So this is that fix and the test case. Added: lldb/trunk/packages/Python/lldbsuite/test/lang/objc/global_ptrs/ lldb/trunk/packages/Python/lldbsuite/test/lang/objc/global_ptrs/Makefile lldb/trunk/packages/Python/lldbsuite/test/lang/objc/global_ptrs/TestGlobalObjects.py lldb/trunk/packages/Python/lldbsuite/test/lang/objc/global_ptrs/main.m Modified: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp Added: lldb/trunk/packages/Python/lldbsuite/test/lang/objc/global_ptrs/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/objc/global_ptrs/Makefile?rev=257242&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/lang/objc/global_ptrs/Makefile (added) +++ lldb/trunk/packages/Python/lldbsuite/test/lang/objc/global_ptrs/Makefile Fri Jan 8 19:20:30 2016 @@ -0,0 +1,6 @@ +LEVEL = ../../../make + +OBJC_SOURCES := main.m +LDFLAGS = $(CFLAGS) -lobjc -framework Foundation + +include $(LEVEL)/Makefile.rules Added: lldb/trunk/packages/Python/lldbsuite/test/lang/objc/global_ptrs/TestGlobalObjects.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/objc/global_ptrs/TestGlobalObjects.py?rev=257242&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/lang/objc/global_ptrs/TestGlobalObjects.py (added) +++ lldb/trunk/packages/Python/lldbsuite/test/lang/objc/global_ptrs/TestGlobalObjects.py Fri Jan 8 19:20:30 2016 @@ -0,0 +1,53 @@ +"""Test that a global ObjC object found before the process is started updates correctly.""" + +from __future__ import print_function + + + +import os, time +import lldb +import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test.lldbtest import * + +class TestObjCGlobalVar(TestBase): + +mydir = TestBase.compute_mydir(__file__) + +def setUp(self): +# Call super's setUp(). +TestBase.setUp(self) +self.main_source = lldb.SBFileSpec("main.m") + +@skipUnlessDarwin +@add_test_categories(['pyapi']) +def test_with_python_api(self): +"""Test that a global ObjC object found before the process is started updates correctly.""" +self.build() +exe = os.path.join(os.getcwd(), "a.out") + +target = self.dbg.CreateTarget(exe) +self.assertTrue(target, VALID_TARGET) + +bkpt = target.BreakpointCreateBySourceRegex ('NSLog', self.main_source) +self.assertTrue(bkpt, VALID_BREAKPOINT) + +# Before we launch, make an SBValue for our global object pointer: +g_obj_ptr = target.FindFirstGlobalVariable("g_obj_ptr") +self.assertTrue(g_obj_ptr.GetError().Success(), "Made the g_obj_ptr") +self.assertTrue(g_obj_ptr.GetValueAsUnsigned(10) == 0, "g_obj_ptr is initially null") + +# Now launch the process, and do not stop at entry point. +process = target.LaunchSimple (None, None, self.get_process_working_directory()) + +self.assertTrue(process, PROCESS_IS_VALID) + +# The stop reason of the thread should be breakpoint. +threads = lldbutil.get_threads_stopped_at_breakpoint (process, bkpt) +if len(threads) != 1: +self.fail ("Failed to stop at breakpoint 1.") + +thread = threads[0] + +dyn_value = g_obj_ptr.GetDynamicValue(lldb.eDynamicCanRunTarget) +self.assertTrue(dyn_value.GetError().Success(), "Dynamic value is valid") +self.assertTrue(dyn_value.GetObjectDescription() == "Some NSString") Added: lldb/trunk/packages/Python/lldbsuite/test/lang/objc/global_ptrs/main.m URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/objc/global_ptrs/main.m?rev=257242&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/lang/objc/global_ptrs/main.m (added) +++ lldb/trunk/packages/Python/lldbsuite/test/lang/objc/global_ptrs/main.m Fri Jan 8 19:20:30 2016 @@ -0,0 +1,11 @@ +#import + +id g_obj_ptr = nil; + +int +main() +{ + g_obj_ptr = @"Some NSString"; + NSLog(@"My string was %@.", g_obj_ptr); + return 0; +} Modified: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp?rev=257242&r1=257241&r2=257242&view=diff == --- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp (original) +++ lldb/tr
Re: [Lldb-commits] [PATCH] D16017: Fix TestMiniDump.py for Python 3
What's the extra frame? Why does Python have an effect on the number of frames seen by the minidump? Something seems wrong about that. On Fri, Jan 8, 2016 at 3:41 PM Adrian McCarthy wrote: > amccarth created this revision. > amccarth added a reviewer: zturner. > amccarth added a subscriber: lldb-commits. > > Under Python 3, lldb sees an extra frame on the stack, so I check that the > stack has at least the number frames we expect. > > Python 3 doesn't have dict.iteritems(). I used a wrapper function from > six to keep this portable between the two versions. > > http://reviews.llvm.org/D16017 > > Files: > > packages/Python/lldbsuite/test/functionalities/postmortem/minidump/TestMiniDump.py > > Index: > packages/Python/lldbsuite/test/functionalities/postmortem/minidump/TestMiniDump.py > === > --- > packages/Python/lldbsuite/test/functionalities/postmortem/minidump/TestMiniDump.py > +++ > packages/Python/lldbsuite/test/functionalities/postmortem/minidump/TestMiniDump.py > @@ -3,7 +3,7 @@ > """ > > from __future__ import print_function > - > +from six import iteritems > > > import lldb > @@ -83,8 +83,8 @@ > thread = process.GetThreadAtIndex(0) > > expected_stack = { 0: 'bar', 1: 'foo', 2: 'main' } > -self.assertEqual(thread.GetNumFrames(), len(expected_stack)) > -for index, name in expected_stack.iteritems(): > +self.assertGreaterEqual(thread.GetNumFrames(), > len(expected_stack)) > +for index, name in iteritems(expected_stack): > frame = thread.GetFrameAtIndex(index) > self.assertTrue(frame.IsValid()) > function_name = frame.GetFunctionName() > > > ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits