[Lldb-commits] [PATCH] D31371: Stop calling ValueObject::SetName from synthetic child providers
tberghammer added a comment. SBValue::SetName is not part of the SB API (what is the right decision IMO as an SBValue should be mostly immutable) so this issue doesn't effect it. I looked through the code in examples/synthetic/gnu_libstdcpp.py and it is always using one of the SBValue::Create* method to produce new SBValue what will create a new value object one way or the other. Considering that nobody complained about the missing SetName method at the SB API level I don't see a big need for exposing the Clone method there. At the same line if SetName/Clone isn't part of the SB API then I think we shouldn't document it at the webpage. (I will upload a fix for the spelling errors later) https://reviews.llvm.org/D31371 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D31450: Battery of NetBSD support improvements
labath added inline comments. Comment at: source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp:249 + // Initialize new thread + struct ptrace_lwpinfo info = {}; + Error error = PtraceWrapper(PT_LWPINFO, pid, &info, sizeof(info)); This is the third place i'm seeing this code. Any chance of turning it into a function? Comment at: source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp:447 +for (const auto &thread_sp : m_threads) { + static_pointer_cast(thread_sp)->SetStepping(); +} I guess you should be playing with the pt_suspend/resume here to step only the requested thread(s). Is that something you plan to do as a follow up? Repository: rL LLVM https://reviews.llvm.org/D31450 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D31073: Enable lldm-mi commands -stack-list-locals -stack-list-variables and -var-create to work only with variables in scope
ayuckhulk updated this revision to Diff 93369. ayuckhulk added a comment. Thank you for the review! I've updated the patch with requested changes: - renamed `lexical-scope` to `lexical_scope`, - renamed `TestLexicalScope.py` to `TestMiLexicalScope.py` - removed utf8 encoding string https://reviews.llvm.org/D31073 Files: packages/Python/lldbsuite/test/tools/lldb-mi/lexical_scope/Makefile packages/Python/lldbsuite/test/tools/lldb-mi/lexical_scope/TestMiLexicalScope.py packages/Python/lldbsuite/test/tools/lldb-mi/lexical_scope/main.cpp tools/lldb-mi/MICmdCmdStack.cpp tools/lldb-mi/MICmdCmdVar.cpp Index: tools/lldb-mi/MICmdCmdVar.cpp === --- tools/lldb-mi/MICmdCmdVar.cpp +++ tools/lldb-mi/MICmdCmdVar.cpp @@ -182,7 +182,7 @@ const bool bArgs = true; const bool bLocals = true; const bool bStatics = true; -const bool bInScopeOnly = false; +const bool bInScopeOnly = true; const lldb::SBValueList valueList = frame.GetVariables(bArgs, bLocals, bStatics, bInScopeOnly); value = valueList.GetFirstValueByName(rStrExpression.c_str()); Index: tools/lldb-mi/MICmdCmdStack.cpp === --- tools/lldb-mi/MICmdCmdStack.cpp +++ tools/lldb-mi/MICmdCmdStack.cpp @@ -757,7 +757,8 @@ : thread.GetSelectedFrame(); CMICmnMIValueList miValueList(true); - const MIuint maskVarTypes = CMICmnLLDBDebugSessionInfo::eVariableType_Locals; + const MIuint maskVarTypes = CMICmnLLDBDebugSessionInfo::eVariableType_Locals | + CMICmnLLDBDebugSessionInfo::eVariableType_InScope; if (!rSessionInfo.MIResponseFormVariableInfo(frame, maskVarTypes, eVarInfoFormat, miValueList)) return MIstatus::failure; @@ -929,7 +930,8 @@ CMICmnMIValueList miValueList(true); const MIuint maskVarTypes = CMICmnLLDBDebugSessionInfo::eVariableType_Arguments | - CMICmnLLDBDebugSessionInfo::eVariableType_Locals; + CMICmnLLDBDebugSessionInfo::eVariableType_Locals | + CMICmnLLDBDebugSessionInfo::eVariableType_InScope; if (!rSessionInfo.MIResponseFormVariableInfo( frame, maskVarTypes, eVarInfoFormat, miValueList, 10, true)) return MIstatus::failure; Index: packages/Python/lldbsuite/test/tools/lldb-mi/lexical_scope/main.cpp === --- packages/Python/lldbsuite/test/tools/lldb-mi/lexical_scope/main.cpp +++ packages/Python/lldbsuite/test/tools/lldb-mi/lexical_scope/main.cpp @@ -0,0 +1,33 @@ +//===-- main.cpp *- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===--===// + +void +some_func (void) +{ +} + +void test_sibling_scope (void) +{ + int a = 1; + { +int b = 2; +some_func(); // BP_first + } + { +short b = 3; +some_func(); // BP_second + } +} + +int +main (int argc, char **argv) +{ + test_sibling_scope(); + return 0; +} Index: packages/Python/lldbsuite/test/tools/lldb-mi/lexical_scope/TestMiLexicalScope.py === --- packages/Python/lldbsuite/test/tools/lldb-mi/lexical_scope/TestMiLexicalScope.py +++ packages/Python/lldbsuite/test/tools/lldb-mi/lexical_scope/TestMiLexicalScope.py @@ -0,0 +1,68 @@ +""" +Test lldb-mi -stack-list-locals -stack-list-variables and -var-create commands +for variables with the same name in sibling lexical scopes. +""" + +from __future__ import print_function + + +import lldbmi_testcase +from lldbsuite.test.decorators import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil + + +class MiLexicalScopeTestCase(lldbmi_testcase.MiTestCaseBase): + +mydir = TestBase.compute_mydir(__file__) + +@skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows +@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races +@skipIfRemote # We do not currently support remote debugging via the MI. +def test_lldbmi_var_create_in_sibling_scope(self): +"""Test that 'lldb-mi --interpreter' works with sibling lexical scopes.""" + +self.spawnLldbMi(args=None) + +# Load executable +self.runCmd("-file-exec-and-symbols %s" % self.myexe) +self.expect("\^done") + +# Breakpoint inside first scope +line = line_number('main.cpp', '// BP_first') +self.runCmd("-break-insert --file main.cpp:%d" % line) +self.expect("\^done,bkpt={number=\"\d+\"") + +# Breakpoint inside second scope +line = line_number('main.cpp', '// BP_second') +self.runCmd("-break-i
[Lldb-commits] [PATCH] D31450: Battery of NetBSD support improvements
krytarowski added inline comments. Comment at: source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp:249 + // Initialize new thread + struct ptrace_lwpinfo info = {}; + Error error = PtraceWrapper(PT_LWPINFO, pid, &info, sizeof(info)); labath wrote: > This is the third place i'm seeing this code. Any chance of turning it into a > function? Everything that touches threads will be refactored in future. I suspect that at the end this code will lost its capability to iterate threads after exec() as all of them are terminated. Here is a code that handles it in an expanded way and fore 1 thread only. Comment at: source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp:447 +for (const auto &thread_sp : m_threads) { + static_pointer_cast(thread_sp)->SetStepping(); +} labath wrote: > I guess you should be playing with the pt_suspend/resume here to step only > the requested thread(s). Is that something you plan to do as a follow up? I'm planning to reuse PT_RESUME/PT_SUSPEND to select thread/s for execution. And reuse PT_SETSTEP/PT_CLEARSTEP to mark them optionally for single-step mode. And at the end use global PT_CONTINUE as it has option to emit a signal (PT_STEP cannot send a signal). Repository: rL LLVM https://reviews.llvm.org/D31450 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D31461: Add NetBSD path for Debugging Information in Separate Files
krytarowski created this revision. krytarowski added a project: LLDB. Herald added a subscriber: aprantl. NetBSD stores debug information files in the `/usr/libdata/debug` path. This change fixes debugging distribution executables, e.g. `look`(1): $ lldb /usr/bin/look (lldb) target create "/usr/bin/look" Current executable set to '/usr/bin/look' (x86_64). (lldb) b main Breakpoint 1: where = look`main + 22 at look.c:107, address = 0x0da6 (lldb) r Process 23473 launched: '/usr/bin/look' (x86_64) Process 23473 stopped * thread #1, stop reason = breakpoint 1.1 frame #0: 0x000186600da6 look`main(argc=1, argv=0x7f7fffc7c488) at look.c:107 104 105 string = NULL; 106 file = _PATH_WORDS; -> 107 termchar = '\0'; 108 while ((ch = getopt(argc, argv, "dft:")) != -1) 109 switch(ch) { 110 case 'd': (lldb) There is no `/usr/lib/debug` path on NeBSD, so remove it from search. Sponsored by Repository: rL LLVM https://reviews.llvm.org/D31461 Files: source/Host/common/Symbols.cpp Index: source/Host/common/Symbols.cpp === --- source/Host/common/Symbols.cpp +++ source/Host/common/Symbols.cpp @@ -212,8 +212,13 @@ debug_file_search_paths.AppendIfUnique(FileSpec(".", true)); #ifndef LLVM_ON_WIN32 +#if defined(__NetBSD__) +// Add /usr/libdata/debug directory. +debug_file_search_paths.AppendIfUnique(FileSpec("/usr/libdata/debug", true)); +#else // Add /usr/lib/debug directory. debug_file_search_paths.AppendIfUnique(FileSpec("/usr/lib/debug", true)); +#endif #endif // LLVM_ON_WIN32 std::string uuid_str; Index: source/Host/common/Symbols.cpp === --- source/Host/common/Symbols.cpp +++ source/Host/common/Symbols.cpp @@ -212,8 +212,13 @@ debug_file_search_paths.AppendIfUnique(FileSpec(".", true)); #ifndef LLVM_ON_WIN32 +#if defined(__NetBSD__) +// Add /usr/libdata/debug directory. +debug_file_search_paths.AppendIfUnique(FileSpec("/usr/libdata/debug", true)); +#else // Add /usr/lib/debug directory. debug_file_search_paths.AppendIfUnique(FileSpec("/usr/lib/debug", true)); +#endif #endif // LLVM_ON_WIN32 std::string uuid_str; ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D31450: Battery of NetBSD support improvements
krytarowski added a comment. I think I will start the threading segment with proper handling of core(5) files. It looks like the simplest start point. OpenBSD uses very similar format and can catch up quickly. Repository: rL LLVM https://reviews.llvm.org/D31450 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D31450: Battery of NetBSD support improvements
kettenis added a comment. The core file reading bits look ok to me. Comment at: source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp:383 // On Linux the executable is indicated by an empty path in the entry. On // FreeBSD and on Android it is the full path to the executable. Probably should update this comment Comment at: source/Plugins/Process/elf-core/ProcessElfCore.cpp:456 +} + // Parse a FreeBSD NT_PRSTATUS note - see FreeBSD sys/procfs.h for details. Unfortunate that the note numbers are different from architecture to architecture on NetBSD. Repository: rL LLVM https://reviews.llvm.org/D31450 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D31450: Battery of NetBSD support improvements
krytarowski added inline comments. Comment at: source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp:383 // On Linux the executable is indicated by an empty path in the entry. On // FreeBSD and on Android it is the full path to the executable. kettenis wrote: > Probably should update this comment Right! Comment at: source/Plugins/Process/elf-core/ProcessElfCore.cpp:456 +} + // Parse a FreeBSD NT_PRSTATUS note - see FreeBSD sys/procfs.h for details. kettenis wrote: > Unfortunate that the note numbers are different from architecture to > architecture on NetBSD. Yes, we reuse `PT_GETREGS` and `PT_GETFPREGS` per port variables. This is placeholder to start working on amd64 with threading support. Repository: rL LLVM https://reviews.llvm.org/D31450 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D31073: Enable lldm-mi commands -stack-list-locals -stack-list-variables and -var-create to work only with variables in scope
ki.stfu accepted this revision. ki.stfu added a comment. This revision is now accepted and ready to land. Would you like me to commit it? https://reviews.llvm.org/D31073 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D31073: Enable lldm-mi commands -stack-list-locals -stack-list-variables and -var-create to work only with variables in scope
ayuckhulk added a comment. Yes, please do. https://reviews.llvm.org/D31073 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D31371: Stop calling ValueObject::SetName from synthetic child providers
> On Mar 29, 2017, at 2:06 AM, Tamas Berghammer via Phabricator > wrote: > > tberghammer added a comment. > > SBValue::SetName is not part of the SB API (what is the right decision IMO as > an SBValue should be mostly immutable) so this issue doesn't effect it. I > looked through the code in examples/synthetic/gnu_libstdcpp.py and it is > always using one of the SBValue::Create* method to produce new SBValue what > will create a new value object one way or the other. Considering that nobody > complained about the missing SetName method at the SB API level I don't see a > big need for exposing the Clone method there. At the same line if > SetName/Clone isn't part of the SB API then I think we shouldn't document it > at the webpage. Seems like vending one of the actual backing objects as a synthetic object is a reasonable thing to do (it's what you are doing internally). But if we don't allow a way to do that currently, then there's no reason to add one. Jim > > (I will upload a fix for the spelling errors later) > > > https://reviews.llvm.org/D31371 > > > ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r299020 - Move the definition of SBListener::GetSP() to SBListener.cpp.
Author: spyffe Date: Wed Mar 29 14:32:59 2017 New Revision: 299020 URL: http://llvm.org/viewvc/llvm-project?rev=299020&view=rev Log: Move the definition of SBListener::GetSP() to SBListener.cpp. This is the requirement for all functions in the public API, to eliminate weak symbol definitions. Modified: lldb/trunk/include/lldb/API/SBListener.h lldb/trunk/source/API/SBListener.cpp Modified: lldb/trunk/include/lldb/API/SBListener.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBListener.h?rev=299020&r1=299019&r2=299020&view=diff == --- lldb/trunk/include/lldb/API/SBListener.h (original) +++ lldb/trunk/include/lldb/API/SBListener.h Wed Mar 29 14:32:59 2017 @@ -89,7 +89,7 @@ protected: SBListener(const lldb::ListenerSP &listener_sp); - lldb::ListenerSP GetSP() { return m_opaque_sp; } + lldb::ListenerSP GetSP(); private: lldb_private::Listener *operator->() const; Modified: lldb/trunk/source/API/SBListener.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBListener.cpp?rev=299020&r1=299019&r2=299020&view=diff == --- lldb/trunk/source/API/SBListener.cpp (original) +++ lldb/trunk/source/API/SBListener.cpp Wed Mar 29 14:32:59 2017 @@ -302,6 +302,8 @@ bool SBListener::HandleBroadcastEvent(co return false; } +lldb::ListenerSP SBListener::GetSP() { return m_opaque_sp; } + Listener *SBListener::operator->() const { return m_opaque_sp.get(); } Listener *SBListener::get() const { return m_opaque_sp.get(); } ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D31450: Battery of NetBSD support improvements
labath added inline comments. Comment at: source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp:249 + // Initialize new thread + struct ptrace_lwpinfo info = {}; + Error error = PtraceWrapper(PT_LWPINFO, pid, &info, sizeof(info)); krytarowski wrote: > labath wrote: > > This is the third place i'm seeing this code. Any chance of turning it into > > a function? > Everything that touches threads will be refactored in future. > > I suspect that at the end this code will lost its capability to iterate > threads after exec() as all of them are terminated. > > Here is a code that handles it in an expanded way and fore 1 thread only. That's fine, but if they're identical right now, you could still merge them together, right? (A lot of the temporary things have a tendency to become permanent). Comment at: source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp:447 +for (const auto &thread_sp : m_threads) { + static_pointer_cast(thread_sp)->SetStepping(); +} krytarowski wrote: > labath wrote: > > I guess you should be playing with the pt_suspend/resume here to step only > > the requested thread(s). Is that something you plan to do as a follow up? > I'm planning to reuse PT_RESUME/PT_SUSPEND to select thread/s for execution. > > And reuse PT_SETSTEP/PT_CLEARSTEP to mark them optionally for single-step > mode. > > And at the end use global PT_CONTINUE as it has option to emit a signal > (PT_STEP cannot send a signal). Ok, as long as you're aware of that, I'm fine. Repository: rL LLVM https://reviews.llvm.org/D31450 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r299023 - Add NetBSD path for Debugging Information in Separate Files
Author: kamil Date: Wed Mar 29 14:52:24 2017 New Revision: 299023 URL: http://llvm.org/viewvc/llvm-project?rev=299023&view=rev Log: Add NetBSD path for Debugging Information in Separate Files Summary: NetBSD stores debug information files in the `/usr/libdata/debug` path. This change fixes debugging distribution executables, e.g. `look`(1): ``` $ lldb /usr/bin/look (lldb) target create "/usr/bin/look" Current executable set to '/usr/bin/look' (x86_64). (lldb) b main Breakpoint 1: where = look`main + 22 at look.c:107, address = 0x0da6 (lldb) r Process 23473 launched: '/usr/bin/look' (x86_64) Process 23473 stopped * thread #1, stop reason = breakpoint 1.1 frame #0: 0x000186600da6 look`main(argc=1, argv=0x7f7fffc7c488) at look.c:107 104 105 string = NULL; 106 file = _PATH_WORDS; -> 107 termchar = '\0'; 108 while ((ch = getopt(argc, argv, "dft:")) != -1) 109 switch(ch) { 110 case 'd': (lldb) ``` There is no `/usr/lib/debug` path on NeBSD, so remove it from search. Sponsored by Reviewers: jingham, emaste, kettenis, labath, joerg Reviewed By: labath Subscribers: aprantl, #lldb Tags: #lldb Differential Revision: https://reviews.llvm.org/D31461 Modified: lldb/trunk/source/Host/common/Symbols.cpp Modified: lldb/trunk/source/Host/common/Symbols.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Symbols.cpp?rev=299023&r1=299022&r2=299023&view=diff == --- lldb/trunk/source/Host/common/Symbols.cpp (original) +++ lldb/trunk/source/Host/common/Symbols.cpp Wed Mar 29 14:52:24 2017 @@ -212,8 +212,13 @@ FileSpec Symbols::LocateExecutableSymbol debug_file_search_paths.AppendIfUnique(FileSpec(".", true)); #ifndef LLVM_ON_WIN32 +#if defined(__NetBSD__) +// Add /usr/libdata/debug directory. +debug_file_search_paths.AppendIfUnique(FileSpec("/usr/libdata/debug", true)); +#else // Add /usr/lib/debug directory. debug_file_search_paths.AppendIfUnique(FileSpec("/usr/lib/debug", true)); +#endif #endif // LLVM_ON_WIN32 std::string uuid_str; ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D31367: Expression: add missing linkage to RuntimeDyld component
labath added a comment. We don't depend on the RuntimeDyld component of llvm directy -- we only use it indirectly through the ExecutionEngine component. Shouldn't that be reflected as a dependency in the build system somehow, so that the former can be pulled in directly ? RuntimeDyld is listed as a dependency of ExecutionEngine in lib/ExecutionEngine/LLVMBuild.txt, but that does not seem to be reflected in the cmake? Is that a bug on the llvm side? Repository: rL LLVM https://reviews.llvm.org/D31367 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D30984: Centralize libc++ test skipping logic
labath added a comment. In https://reviews.llvm.org/D30984#711806, @EricWF wrote: > I don't see anything wrong with this, but I only know libc++ and not LLDB. I'm not sure why you ended up here. I think you have too wide phabricator filter somewhere. :) > > >> libc++'s atomic does not play well with gcc on linux > > It should... Can you elaborate on this issue? I suspect this may be a libc++ > bug. It checks for `#if __has_feature(cxx_atomic)` and then aborts if it is not found. However, this is in the system libc++ on ubuntu (lldb uses system libc++ for reasons which are too long to go into right now), which is quite old. I don't see a similar check in the current trunk, so it's possible that has been fixed since then. https://reviews.llvm.org/D30984 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D30984: Centralize libc++ test skipping logic
EricWF added a comment. In https://reviews.llvm.org/D30984#713490, @labath wrote: > In https://reviews.llvm.org/D30984#711806, @EricWF wrote: > > > I don't see anything wrong with this, but I only know libc++ and not LLDB. > > > I'm not sure why you ended up here. I think you have too wide phabricator > filter somewhere. :) > > > > > > >> libc++'s atomic does not play well with gcc on linux > > > > It should... Can you elaborate on this issue? I suspect this may be a > > libc++ bug. > > It checks for `#if __has_feature(cxx_atomic)` and then aborts if it is not > found. However, this is in the system libc++ on ubuntu (lldb uses system > libc++ for reasons which are too long to go into right now), which is quite > old. I don't see a similar check in the current trunk, so it's possible that > has been fixed since then. GCC support has been present since ~2015, so I suspect the issue has since been fixed. And the libc++ version on is unbelievable old. https://reviews.llvm.org/D30984 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r299028 - Centralize libc++ test skipping logic
Author: labath Date: Wed Mar 29 16:01:14 2017 New Revision: 299028 URL: http://llvm.org/viewvc/llvm-project?rev=299028&view=rev Log: Centralize libc++ test skipping logic Summary: This aims to replace the different decorators we've had on each libc++ test with a single solution. Each libc++ will be assigned to the "libc++" category and a single central piece of code will decide whether we are actually able to run libc++ test in the given configuration by enabling or disabling the category (while giving the user the opportunity to override this). I started this effort because I wanted to get libc++ tests running on android, and none of the existing decorators worked for this use case: - skipIfGcc - incorrect, we can build libc++ executables on android with gcc (in fact, after this, we can now do it on linux as well) - lldbutil.skip_if_library_missing - this checks whether libc++.so is loaded in the proces, which fails in case of a statically linked libc++ (this makes copying executables to the remote target easier to manage). To make this work I needed to split out the pseudo_barrier code from the force-included file, as libc++'s atomic does not play well with gcc on linux, and this made every test fail, even though we need the code only in the threading tests. So far, I am only annotating one of the tests with this category. If this does not break anything, I'll proceed to update the rest. Reviewers: jingham, zturner, EricWF Subscribers: srhines, lldb-commits Differential Revision: https://reviews.llvm.org/D30984 Added: lldb/trunk/packages/Python/lldbsuite/test/make/pseudo_barrier.h Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/gcore/main.cpp lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/thread_crash/main.cpp lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/break_after_join/main.cpp lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/main.cpp lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/create_during_step/main.cpp lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/exit_during_break/main.cpp lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/main.cpp lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/multi_break/main.cpp lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/step_out/main.cpp lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/thread_exit/main.cpp lldb/trunk/packages/Python/lldbsuite/test/lldbplatformutil.py lldb/trunk/packages/Python/lldbsuite/test/make/Android.rules lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules lldb/trunk/packages/Python/lldbsuite/test/make/test_common.h lldb/trunk/packages/Python/lldbsuite/test/test_categories.py Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest.py?rev=299028&r1=299027&r2=299028&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/dotest.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py Wed Mar 29 16:01:14 2017 @@ -1061,6 +1061,29 @@ def checkCompiler(): configuration.compiler = cmd_output.split('\n')[0] print("'xcrun -find %s' returning %s" % (c, configuration.compiler)) +def canRunLibcxxTests(): +from lldbsuite.test import lldbplatformutil + +platform = lldbplatformutil.getPlatform() + +if lldbplatformutil.target_is_android() or lldbplatformutil.platformIsDarwin(): +return True, "libc++ always present" + +if platform == "linux": +if not os.path.isdir("/usr/include/c++/v1"): +return False, "Unable to find libc++ installation" +return True, "Headers found, let's hope they work" + +return False, "Don't know how to build with libc++ on %s" % platform + +def checkLibcxxSupport(): +result, reason = canRunLibcxxTests() +if result: +return # libc++ supported +if "libc++" in configuration.categoriesList: +return # libc++ category explicitly requested, let it run. +print("Libc++ tests will not be run because: " + reason) +configuration.skipCategories.append("libc++") def run_suite(): # On MacOS X, check to make sure that domain for com.apple.DebugSymbols defaults @@ -1164,6 +1187,8 @@ def run_suite(): target_platform = lldb.DBG.GetSelectedPlatform().GetTriple().split('-')[2] +checkLibcxxSupport() + # Don't do debugserver tests on everything except OS X. configuration.dont_do_debugserver_test = "linux" in tar
[Lldb-commits] [PATCH] D30984: Centralize libc++ test skipping logic
This revision was automatically updated to reflect the committed changes. Closed by commit rL299028: Centralize libc++ test skipping logic (authored by labath). Changed prior to commit: https://reviews.llvm.org/D30984?vs=91878&id=93407#toc Repository: rL LLVM https://reviews.llvm.org/D30984 Files: lldb/trunk/packages/Python/lldbsuite/test/dotest.py lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/gcore/main.cpp lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/thread_crash/main.cpp lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/break_after_join/main.cpp lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/main.cpp lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/create_during_step/main.cpp lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/exit_during_break/main.cpp lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/main.cpp lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/multi_break/main.cpp lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/step_out/main.cpp lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/thread_exit/main.cpp lldb/trunk/packages/Python/lldbsuite/test/lldbplatformutil.py lldb/trunk/packages/Python/lldbsuite/test/make/Android.rules lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules lldb/trunk/packages/Python/lldbsuite/test/make/pseudo_barrier.h lldb/trunk/packages/Python/lldbsuite/test/make/test_common.h lldb/trunk/packages/Python/lldbsuite/test/test_categories.py Index: lldb/trunk/packages/Python/lldbsuite/test/test_categories.py === --- lldb/trunk/packages/Python/lldbsuite/test/test_categories.py +++ lldb/trunk/packages/Python/lldbsuite/test/test_categories.py @@ -25,6 +25,7 @@ 'dsym': 'Tests that can be run with DSYM debug information', 'gmodules': 'Tests that can be run with -gmodules debug information', 'expression': 'Tests related to the expression parser', +'libc++': 'Test for libc++ data formatters', 'objc': 'Tests related to the Objective-C programming language support', 'pyapi': 'Tests related to the Python API', 'basic_process': 'Basic process execution sniff tests.', Index: lldb/trunk/packages/Python/lldbsuite/test/dotest.py === --- lldb/trunk/packages/Python/lldbsuite/test/dotest.py +++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py @@ -1061,6 +1061,29 @@ configuration.compiler = cmd_output.split('\n')[0] print("'xcrun -find %s' returning %s" % (c, configuration.compiler)) +def canRunLibcxxTests(): +from lldbsuite.test import lldbplatformutil + +platform = lldbplatformutil.getPlatform() + +if lldbplatformutil.target_is_android() or lldbplatformutil.platformIsDarwin(): +return True, "libc++ always present" + +if platform == "linux": +if not os.path.isdir("/usr/include/c++/v1"): +return False, "Unable to find libc++ installation" +return True, "Headers found, let's hope they work" + +return False, "Don't know how to build with libc++ on %s" % platform + +def checkLibcxxSupport(): +result, reason = canRunLibcxxTests() +if result: +return # libc++ supported +if "libc++" in configuration.categoriesList: +return # libc++ category explicitly requested, let it run. +print("Libc++ tests will not be run because: " + reason) +configuration.skipCategories.append("libc++") def run_suite(): # On MacOS X, check to make sure that domain for com.apple.DebugSymbols defaults @@ -1164,6 +1187,8 @@ target_platform = lldb.DBG.GetSelectedPlatform().GetTriple().split('-')[2] +checkLibcxxSupport() + # Don't do debugserver tests on everything except OS X. configuration.dont_do_debugserver_test = "linux" in target_platform or "freebsd" in target_platform or "windows" in target_platform Index: lldb/trunk/packages/Python/lldbsuite/test/make/test_common.h === --- lldb/trunk/packages/Python/lldbsuite/test/make/test_common.h +++ lldb/trunk/packages/Python/lldbsuite/test/make/test_common.h @@ -45,34 +45,3 @@ #define lldb_enable_attach() #endif - -#if defined(__APPLE__) && defined(LLDB_USING_LIBSTDCPP) - -// on Darwin, libstdc++ is missing , so this would cause any test to fail building -// since this header file is being included in every C-family test case, we need to not include it -// on Darwin, most tests use libc++ by default, so this will only affect tests that explicitly require libstdc++ - -#else -#ifdef __cpl
[Lldb-commits] [PATCH] D31485: Verify memory address range validity in GDBRemoteCommunicationClient
xiaobai created this revision. This aims to verify the validity of the response from the debugging server in GDBRemoteCommunicationClient::GetMemoryRegionInfo. I was working with ds2 (https://github.com/facebook/ds2) and encountered a bug that caused the server's response to have a 'size' value of 0, which caused lldb to behave incorrectly. https://reviews.llvm.org/D31485 Files: source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp Index: source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp === --- source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp +++ source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp @@ -1503,6 +1503,11 @@ } } + // We got an invalid address range back + if (!region_info.GetRange().IsValid()) { +error.SetErrorString("Server returned invalid range"); + } + // We got a valid address range back but no permissions -- which means // this is an unmapped page if (region_info.GetRange().IsValid() && saw_permissions == false) { Index: source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp === --- source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp +++ source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp @@ -1503,6 +1503,11 @@ } } + // We got an invalid address range back + if (!region_info.GetRange().IsValid()) { +error.SetErrorString("Server returned invalid range"); + } + // We got a valid address range back but no permissions -- which means // this is an unmapped page if (region_info.GetRange().IsValid() && saw_permissions == false) { ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r299040 - Mask out EXC_SYSCALL exceptions as well.
Author: jmolenda Date: Wed Mar 29 19:23:46 2017 New Revision: 299040 URL: http://llvm.org/viewvc/llvm-project?rev=299040&view=rev Log: Mask out EXC_SYSCALL exceptions as well. Modified: lldb/trunk/tools/debugserver/source/MacOSX/MachException.cpp Modified: lldb/trunk/tools/debugserver/source/MacOSX/MachException.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/MachException.cpp?rev=299040&r1=299039&r2=299040&view=diff == --- lldb/trunk/tools/debugserver/source/MacOSX/MachException.cpp (original) +++ lldb/trunk/tools/debugserver/source/MacOSX/MachException.cpp Wed Mar 29 19:23:46 2017 @@ -410,7 +410,7 @@ void MachException::Data::Dump() const { #define EXC_MASK_RESOURCE (1 << EXC_RESOURCE) #endif -#define LLDB_EXC_MASK (EXC_MASK_ALL & ~EXC_MASK_RESOURCE) +#define LLDB_EXC_MASK (EXC_MASK_ALL & ~EXC_MASK_RESOURCE & ~EXC_MASK_SYSCALL) kern_return_t MachException::PortInfo::Save(task_t task) { DNBLogThreadedIf(LOG_EXCEPTIONS | LOG_VERBOSE, ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [lldb] r298189 - Remove some dead code from DumpValueObjectOptions::PointerDepth
This is not dead code in Swift-enabled LLDB, as I just found out doing a merge. I'm going to use Default and see what breaks. Sean > On Mar 18, 2017, at 10:33 AM, Tamas Berghammer via lldb-commits > wrote: > > Author: tberghammer > Date: Sat Mar 18 12:33:00 2017 > New Revision: 298189 > > URL: http://llvm.org/viewvc/llvm-project?rev=298189&view=rev > Log: > Remove some dead code from DumpValueObjectOptions::PointerDepth > > Modified: >lldb/trunk/include/lldb/DataFormatters/DumpValueObjectOptions.h >lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp > > Modified: lldb/trunk/include/lldb/DataFormatters/DumpValueObjectOptions.h > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/DumpValueObjectOptions.h?rev=298189&r1=298188&r2=298189&view=diff > == > --- lldb/trunk/include/lldb/DataFormatters/DumpValueObjectOptions.h (original) > +++ lldb/trunk/include/lldb/DataFormatters/DumpValueObjectOptions.h Sat Mar > 18 12:33:00 2017 > @@ -27,7 +27,7 @@ namespace lldb_private { > class DumpValueObjectOptions { > public: > struct PointerDepth { > -enum class Mode { Always, Formatters, Default, Never } m_mode; > +enum class Mode { Always, Default, Never } m_mode; > uint32_t m_count; > > PointerDepth operator--() const { > @@ -37,9 +37,6 @@ public: > } > > bool CanAllowExpansion() const; > - > -bool CanAllowExpansion(bool is_root, TypeSummaryImpl *entry, > - ValueObject *valobj, const std::string &summary); > }; > > struct PointerAsArraySettings { > > Modified: lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp?rev=298189&r1=298188&r2=298189&view=diff > == > --- lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp (original) > +++ lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp Sat Mar 18 > 12:33:00 2017 > @@ -468,32 +468,11 @@ bool ValueObjectPrinter::PrintObjectDesc > return true; > } > > -bool DumpValueObjectOptions::PointerDepth::CanAllowExpansion( > -bool is_root, TypeSummaryImpl *entry, ValueObject *valobj, > -const std::string &summary) { > - switch (m_mode) { > - case Mode::Always: > -return (m_count > 0); > - case Mode::Never: > -return false; > - case Mode::Default: > -if (is_root) > - m_count = std::min(m_count, 1); > -return m_count > 0; > - case Mode::Formatters: > -if (!entry || entry->DoesPrintChildren(valobj) || summary.empty()) > - return m_count > 0; > -return false; > - } > - return false; > -} > - > bool DumpValueObjectOptions::PointerDepth::CanAllowExpansion() const { > switch (m_mode) { > case Mode::Always: > case Mode::Default: > - case Mode::Formatters: > -return (m_count > 0); > +return m_count > 0; > case Mode::Never: > return false; > } > @@ -546,8 +525,7 @@ bool ValueObjectPrinter::ShouldPrintChil > return true; > } > > - return curr_ptr_depth.CanAllowExpansion(false, entry, m_valobj, > - m_summary); > + return curr_ptr_depth.CanAllowExpansion(); > } > > return (!entry || entry->DoesPrintChildren(m_valobj) || > m_summary.empty()); > > > ___ > 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] D31451: New C++ function name parsing logic
eugene updated this revision to Diff 93438. eugene added reviewers: labath, zturner, jingham. eugene changed the visibility from "eugene (Eugene Zemtsov)" to "Public (No Login Required)". eugene changed the edit policy from "eugene (Eugene Zemtsov)" to "All Users". eugene added a subscriber: lldb-commits. eugene added a comment. Herald added a subscriber: mgorny. Improve template method parsing accuracy. https://reviews.llvm.org/D31451 Files: source/Plugins/Language/CPlusPlus/CMakeLists.txt source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.h source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.cpp source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.h unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp Index: unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp === --- unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp +++ unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp @@ -13,28 +13,132 @@ using namespace lldb_private; -TEST(CPlusPlusLanguage, MethodName) { +TEST(CPlusPlusLanguage, MethodNameParsing) { struct TestCase { std::string input; std::string context, basename, arguments, qualifiers, scope_qualified_name; }; TestCase test_cases[] = { + {"void f(int)", "", "f", "(int)", "", "f"}, + {"main(int, char *[]) ", "", "main", "(int, char *[])", "", "main"}, {"foo::bar(baz)", "foo", "bar", "(baz)", "", "foo::bar"}, + {"foo::~bar(baz)", "foo", "~bar", "(baz)", "", "foo::~bar"}, + + // Operators {"std::basic_ostream >& " "std::operator<< >" "(std::basic_ostream >&, char const*)", "std", "operator<< >", "(std::basic_ostream >&, char const*)", "", - "std::operator<< >"}}; + "std::operator<< >"}, + {"operator delete[](void*, clang::ASTContext const&, unsigned long)", "", + "operator delete[]", "(void*, clang::ASTContext const&, unsigned long)", + "", "operator delete[]"}, + {"llvm::Optional::operator bool() const", + "llvm::Optional", "operator bool", "()", "const", + "llvm::Optional::operator bool"}, + {"(anonymous namespace)::FactManager::operator[](unsigned short)", + "(anonymous namespace)::FactManager", "operator[]", "(unsigned short)", + "", "(anonymous namespace)::FactManager::operator[]"}, + {"const int& std::map>::operator[](short) const", + "std::map>", "operator[]", "(short)", "const", + "std::map>::operator[]"}, + {"CompareInsn::operator()(llvm::StringRef, InsnMatchEntry const&)", + "CompareInsn", "operator()", "(llvm::StringRef, InsnMatchEntry const&)", + "", "CompareInsn::operator()"}, + {"llvm::Optional::operator*() const &", + "llvm::Optional", "operator*", "()", "const &", + "llvm::Optional::operator*"}, + // Internal classes + {"operator<<(Cls, Cls)::Subclass::function()", + "operator<<(Cls, Cls)::Subclass", "function", "()", "", + "operator<<(Cls, Cls)::Subclass::function"}, + {"SAEC::checkFunction(context&) const::CallBack::CallBack(int)", + "SAEC::checkFunction(context&) const::CallBack", "CallBack", "(int)", "", + "SAEC::checkFunction(context&) const::CallBack::CallBack"}, + // Anonymous namespace + {"XX::(anonymous namespace)::anon_class::anon_func() const", + "XX::(anonymous namespace)::anon_class", "anon_func", "()", "const", + "XX::(anonymous namespace)::anon_class::anon_func"}, + + // Function pointers + {"string (*f(vector&&))(float)", "", "f", "(vector&&)", "", + "f"}, + {"void (*&std::_Any_data::_M_access())()", "std::_Any_data", + "_M_access", "()", "", + "std::_Any_data::_M_access"}, + {"void (*(*(*(*(*(*(*(* const&func1(int))())())())())())())())()", "", + "func1", "(int)", "", "func1"}, + + // Templates + {"void llvm::PM>::" + "addPass(llvm::VP)", + "llvm::PM>", "addPass", + "(llvm::VP)", "", + "llvm::PM>::" + "addPass"}, + {"void std::vector >" + "::_M_emplace_back_aux(Class const&)", + "std::vector >", + "_M_emplace_back_aux", "(Class const&)", "", + "std::vector >::" + "_M_emplace_back_aux"}, + {"unsigned long llvm::countTrailingOnes" + "(unsigned int, llvm::ZeroBehavior)", + "llvm", "countTrailingOnes", + "(unsigned int, llvm::ZeroBehavior)", "", + "llvm::countTrailingOnes"}, + {"std::enable_if<(10u)<(64), bool>::type llvm::isUInt<10u>(unsigned " + "long)", + "llvm", "isUInt<10u>", "(unsigned long)", "", "llvm::isUInt<10u>"}, + {"f, sizeof(B)()", "", + "f, sizeof(B)", "()", "", + "f, sizeof(B)"}}; for (const auto &test : test_cases) { CPlusPlusLanguage::MethodName method(ConstString(test.input)); -EXPECT_TRUE(method.IsValid()); -EXPECT_EQ(test.context, method.Ge
[Lldb-commits] [PATCH] D31450: Battery of NetBSD support improvements
krytarowski added inline comments. Comment at: source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp:249 + // Initialize new thread + struct ptrace_lwpinfo info = {}; + Error error = PtraceWrapper(PT_LWPINFO, pid, &info, sizeof(info)); labath wrote: > krytarowski wrote: > > labath wrote: > > > This is the third place i'm seeing this code. Any chance of turning it > > > into a function? > > Everything that touches threads will be refactored in future. > > > > I suspect that at the end this code will lost its capability to iterate > > threads after exec() as all of them are terminated. > > > > Here is a code that handles it in an expanded way and fore 1 thread only. > That's fine, but if they're identical right now, you could still merge them > together, right? (A lot of the temporary things have a tendency to become > permanent). I will merge this. Even if this is temporary solution. Repository: rL LLVM https://reviews.llvm.org/D31450 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D31485: Verify memory address range validity in GDBRemoteCommunicationClient
sas added a reviewer: clayborg. sas added a subscriber: clayborg. sas added a comment. Doing additional checking on the packets returned over the wire seems decent to me. CC'ing @clayborg to see what he thinks about it also. https://reviews.llvm.org/D31485 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits