Re: [Lldb-commits] [PATCH] D14101: Treat hostname in android URL as device id unless it matches "localhost"
labath accepted this revision. labath added a comment. This revision is now accepted and ready to land. I like this. (I assume it will work with the tcp-connected devices which have an ID like `???:port`) http://reviews.llvm.org/D14101 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r251399 - Fix race condition in process resume
Author: labath Date: Tue Oct 27 04:23:55 2015 New Revision: 251399 URL: http://llvm.org/viewvc/llvm-project?rev=251399&view=rev Log: Fix race condition in process resume Summary: Gdb-remote's async thread sent out the eBroadcastBitRunPacketSent message *before* actually sending out the continue packet. Since it's this message the actually triggers the public state transition, it could happen (and it did happen in TestAttachResume, which does an "process interrupt" right after a continue) that we attempt to stop the inferior before it was actually started (which obviously did not end well). This fixes the problem by moving the broadcast after the packet was actually sent. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D14083 Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp lldb/trunk/test/functionalities/attach_resume/TestAttachResume.py Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp?rev=251399&r1=251398&r2=251399&view=diff == --- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp (original) +++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp Tue Oct 27 04:23:55 2015 @@ -1049,7 +1049,6 @@ GDBRemoteCommunicationClient::SendContin Mutex::Locker locker(m_sequence_mutex); StateType state = eStateRunning; -BroadcastEvent(eBroadcastBitRunPacketSent, NULL); m_public_is_running.SetValue (true, eBroadcastNever); // Set the starting continue packet into "continue_packet". This packet // may change if we are interrupted and we continue after an async packet... @@ -1059,6 +1058,7 @@ GDBRemoteCommunicationClient::SendContin const auto sigint_signo = process->GetUnixSignals()->GetSignalNumberFromName("SIGINT"); bool got_async_packet = false; +bool broadcast_sent = false; while (state == eStateRunning) { @@ -1071,6 +1071,12 @@ GDBRemoteCommunicationClient::SendContin else m_interrupt_sent = false; +if (! broadcast_sent) +{ +BroadcastEvent(eBroadcastBitRunPacketSent, NULL); +broadcast_sent = true; +} + m_private_is_running.SetValue (true, eBroadcastAlways); } Modified: lldb/trunk/test/functionalities/attach_resume/TestAttachResume.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/attach_resume/TestAttachResume.py?rev=251399&r1=251398&r2=251399&view=diff == --- lldb/trunk/test/functionalities/attach_resume/TestAttachResume.py (original) +++ lldb/trunk/test/functionalities/attach_resume/TestAttachResume.py Tue Oct 27 04:23:55 2015 @@ -20,7 +20,6 @@ class AttachResumeTestCase(TestBase): @skipIfRemote @expectedFailureFreeBSD('llvm.org/pr19310') @expectedFailureWindows("llvm.org/pr24778") -@expectedFlakeyLinux('llvm.org/pr19310') def test_attach_continue_interrupt_detach(self): """Test attach/continue/interrupt/detach""" self.build() ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D14083: Fix race condition in process resume
This revision was automatically updated to reflect the committed changes. Closed by commit rL251399: Fix race condition in process resume (authored by labath). Changed prior to commit: http://reviews.llvm.org/D14083?vs=38429&id=38515#toc Repository: rL LLVM http://reviews.llvm.org/D14083 Files: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp lldb/trunk/test/functionalities/attach_resume/TestAttachResume.py Index: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp === --- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp +++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp @@ -1049,7 +1049,6 @@ Mutex::Locker locker(m_sequence_mutex); StateType state = eStateRunning; -BroadcastEvent(eBroadcastBitRunPacketSent, NULL); m_public_is_running.SetValue (true, eBroadcastNever); // Set the starting continue packet into "continue_packet". This packet // may change if we are interrupted and we continue after an async packet... @@ -1059,6 +1058,7 @@ const auto sigint_signo = process->GetUnixSignals()->GetSignalNumberFromName("SIGINT"); bool got_async_packet = false; +bool broadcast_sent = false; while (state == eStateRunning) { @@ -1071,6 +1071,12 @@ else m_interrupt_sent = false; +if (! broadcast_sent) +{ +BroadcastEvent(eBroadcastBitRunPacketSent, NULL); +broadcast_sent = true; +} + m_private_is_running.SetValue (true, eBroadcastAlways); } Index: lldb/trunk/test/functionalities/attach_resume/TestAttachResume.py === --- lldb/trunk/test/functionalities/attach_resume/TestAttachResume.py +++ lldb/trunk/test/functionalities/attach_resume/TestAttachResume.py @@ -20,7 +20,6 @@ @skipIfRemote @expectedFailureFreeBSD('llvm.org/pr19310') @expectedFailureWindows("llvm.org/pr24778") -@expectedFlakeyLinux('llvm.org/pr19310') def test_attach_continue_interrupt_detach(self): """Test attach/continue/interrupt/detach""" self.build() Index: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp === --- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp +++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp @@ -1049,7 +1049,6 @@ Mutex::Locker locker(m_sequence_mutex); StateType state = eStateRunning; -BroadcastEvent(eBroadcastBitRunPacketSent, NULL); m_public_is_running.SetValue (true, eBroadcastNever); // Set the starting continue packet into "continue_packet". This packet // may change if we are interrupted and we continue after an async packet... @@ -1059,6 +1058,7 @@ const auto sigint_signo = process->GetUnixSignals()->GetSignalNumberFromName("SIGINT"); bool got_async_packet = false; +bool broadcast_sent = false; while (state == eStateRunning) { @@ -1071,6 +1071,12 @@ else m_interrupt_sent = false; +if (! broadcast_sent) +{ +BroadcastEvent(eBroadcastBitRunPacketSent, NULL); +broadcast_sent = true; +} + m_private_is_running.SetValue (true, eBroadcastAlways); } Index: lldb/trunk/test/functionalities/attach_resume/TestAttachResume.py === --- lldb/trunk/test/functionalities/attach_resume/TestAttachResume.py +++ lldb/trunk/test/functionalities/attach_resume/TestAttachResume.py @@ -20,7 +20,6 @@ @skipIfRemote @expectedFailureFreeBSD('llvm.org/pr19310') @expectedFailureWindows("llvm.org/pr24778") -@expectedFlakeyLinux('llvm.org/pr19310') def test_attach_continue_interrupt_detach(self): """Test attach/continue/interrupt/detach""" self.build() ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r251400 - Deprecate -m/+m dotest options in favor of test categories
Author: labath Date: Tue Oct 27 04:34:34 2015 New Revision: 251400 URL: http://llvm.org/viewvc/llvm-project?rev=251400&view=rev Log: Deprecate -m/+m dotest options in favor of test categories Summary: This change deprecates -m/+m dotest options (the options are still recognized but they print an error message pointing to the new options) and adds a new lldb-mi test category instead. To just run lldb-mi tests, use '-G lldb-mi'. To skip lldb-mi tests, use '--skip-category lldb-mi'. All lldb-mi tests are marked as such using the getCategories method on the base MiTestCaseBase class and the @lldbmi_test decorator is not needed. In case one still needs to annotate a specific test function as an lldb-mi test, one can use the @add_test_categories(['lldb-mi']) decorator to achieve that. Reviewers: tfiala, dawn, ki.stfu, abidh Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D14060 Modified: lldb/trunk/test/dotest.py lldb/trunk/test/dotest_args.py lldb/trunk/test/lldbtest.py lldb/trunk/test/test_categories.py lldb/trunk/test/tools/lldb-mi/TestMiExit.py lldb/trunk/test/tools/lldb-mi/TestMiFile.py lldb/trunk/test/tools/lldb-mi/TestMiGdbSetShow.py lldb/trunk/test/tools/lldb-mi/TestMiLibraryLoaded.py lldb/trunk/test/tools/lldb-mi/TestMiPrompt.py lldb/trunk/test/tools/lldb-mi/breakpoint/TestMiBreak.py lldb/trunk/test/tools/lldb-mi/control/TestMiExec.py lldb/trunk/test/tools/lldb-mi/data/TestMiData.py lldb/trunk/test/tools/lldb-mi/interpreter/TestMiCliSupport.py lldb/trunk/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py lldb/trunk/test/tools/lldb-mi/lldbmi_testcase.py lldb/trunk/test/tools/lldb-mi/signal/TestMiSignal.py lldb/trunk/test/tools/lldb-mi/stack/TestMiStack.py lldb/trunk/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py lldb/trunk/test/tools/lldb-mi/symbol/TestMiSymbol.py lldb/trunk/test/tools/lldb-mi/syntax/TestMiSyntax.py lldb/trunk/test/tools/lldb-mi/target/TestMiTarget.py lldb/trunk/test/tools/lldb-mi/variable/TestMiGdbSetShowPrint.py lldb/trunk/test/tools/lldb-mi/variable/TestMiVar.py Modified: lldb/trunk/test/dotest.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/dotest.py?rev=251400&r1=251399&r2=251400&view=diff == --- lldb/trunk/test/dotest.py (original) +++ lldb/trunk/test/dotest.py Tue Oct 27 04:34:34 2015 @@ -84,12 +84,6 @@ class _WritelnDecorator(object): # The test suite. suite = unittest2.TestSuite() -# By default, lldb-mi tests are performed if lldb-mi can be found. -# Use @lldbmi_test decorator, defined in lldbtest.py, to mark a test as -# a lldb-mi test. -dont_do_lldbmi_test = False -just_do_lldbmi_test = False - # By default, benchmarks tests are not run. just_do_benchmarks_test = False @@ -414,14 +408,25 @@ def setupCrashInfoHook(): else: pass +def shouldSkipBecauseOfCategories(test_categories): +global useCategories, categoriesList, skipCategories + +if useCategories: +if len(test_categories) == 0 or len(categoriesList & set(test_categories)) == 0: +return True + +for category in skipCategories: +if category in test_categories: +return True + +return False + def parseOptionsAndInitTestdirs(): """Initialize the list of directories containing our unittest scripts. '-h/--help as the first option prints out usage info and exit the program. """ -global dont_do_lldbmi_test -global just_do_lldbmi_test global just_do_benchmarks_test global dont_do_dsym_test global dont_do_dwarf_test @@ -566,6 +571,11 @@ def parseOptionsAndInitTestdirs(): "functionality (-G pyapi, --skip-category pyapi) instead.") sys.exit(1) +if args.m or args.plus_m: +print("Options '-m' and '+m' have been deprecated. Please use the test category\n" + "functionality (-G lldb-mi, --skip-category lldb-mi) instead.") +sys.exit(1) + if args.plus_b: just_do_benchmarks_test = True @@ -631,15 +641,6 @@ def parseOptionsAndInitTestdirs(): if args.l: skip_long_running_test = False -if args.m: -dont_do_lldbmi_test = True - -if args.plus_m: -if dont_do_lldbmi_test: -print("Warning: -m and +m can't both be specified! Using only -m") -else: -just_do_lldbmi_test = True - if args.framework: lldbFrameworkPath = args.framework @@ -727,10 +728,6 @@ def parseOptionsAndInitTestdirs(): if do_help == True: usage(parser) -# Do not specify both '-m' and '+m' at the same time. -if dont_do_lldbmi_test and just_do_lldbmi_test: -usage(parser) - if args.no_multiprocess: no_multiprocess_test_runner = True @@ -1071,8 +1068,6 @@ def setupSysPath(): # Some of the tests can invoke the 'lldb' command d
Re: [Lldb-commits] [PATCH] D14060: Deprecate -m/+m dotest options in favor of test categories
This revision was automatically updated to reflect the committed changes. Closed by commit rL251400: Deprecate -m/+m dotest options in favor of test categories (authored by labath). Changed prior to commit: http://reviews.llvm.org/D14060?vs=38389&id=38516#toc Repository: rL LLVM http://reviews.llvm.org/D14060 Files: lldb/trunk/test/dotest.py lldb/trunk/test/dotest_args.py lldb/trunk/test/lldbtest.py lldb/trunk/test/test_categories.py lldb/trunk/test/tools/lldb-mi/TestMiExit.py lldb/trunk/test/tools/lldb-mi/TestMiFile.py lldb/trunk/test/tools/lldb-mi/TestMiGdbSetShow.py lldb/trunk/test/tools/lldb-mi/TestMiLibraryLoaded.py lldb/trunk/test/tools/lldb-mi/TestMiPrompt.py lldb/trunk/test/tools/lldb-mi/breakpoint/TestMiBreak.py lldb/trunk/test/tools/lldb-mi/control/TestMiExec.py lldb/trunk/test/tools/lldb-mi/data/TestMiData.py lldb/trunk/test/tools/lldb-mi/interpreter/TestMiCliSupport.py lldb/trunk/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py lldb/trunk/test/tools/lldb-mi/lldbmi_testcase.py lldb/trunk/test/tools/lldb-mi/signal/TestMiSignal.py lldb/trunk/test/tools/lldb-mi/stack/TestMiStack.py lldb/trunk/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py lldb/trunk/test/tools/lldb-mi/symbol/TestMiSymbol.py lldb/trunk/test/tools/lldb-mi/syntax/TestMiSyntax.py lldb/trunk/test/tools/lldb-mi/target/TestMiTarget.py lldb/trunk/test/tools/lldb-mi/variable/TestMiGdbSetShowPrint.py lldb/trunk/test/tools/lldb-mi/variable/TestMiVar.py Index: lldb/trunk/test/dotest_args.py === --- lldb/trunk/test/dotest_args.py +++ lldb/trunk/test/dotest_args.py @@ -60,8 +60,6 @@ group.add_argument('-f', metavar='filterspec', action='append', help='Specify a filter, which consists of the test class name, a dot, followed by the test method, to only admit such test into the test suite') # FIXME: Example? X('-g', 'If specified, the filterspec by -f is not exclusive, i.e., if a test module does not match the filterspec (testclass.testmethod), the whole module is still admitted to the test suite') X('-l', "Don't skip long running tests") -X('-m', "Don't do lldb-mi tests") -X('+m', "Just do lldb-mi tests. Do not specify along with '-m'", dest='plus_m') group.add_argument('-p', metavar='pattern', help='Specify a regexp filename pattern for inclusion in the test suite') group.add_argument('-X', metavar='directory', help="Exclude a directory from consideration for test discovery. -X types => if 'types' appear in the pathname components of a potential testfile, it will be ignored") group.add_argument('-G', '--category', metavar='category', action='append', dest='categoriesList', help=textwrap.dedent('''Specify categories of test cases of interest. Can be specified more than once.''')) @@ -186,6 +184,8 @@ # Deprecated on 23.10.2015. Remove completely after a grace period. D('-a') D('+a', dest='plus_a') +D('-m') +D('+m', dest='plus_m') del D group = parser.add_argument_group('Test directories') Index: lldb/trunk/test/lldbtest.py === --- lldb/trunk/test/lldbtest.py +++ lldb/trunk/test/lldbtest.py @@ -481,20 +481,6 @@ return func return impl -def lldbmi_test(func): -"""Decorate the item as a lldb-mi only test.""" -if isinstance(func, type) and issubclass(func, unittest2.TestCase): -raise Exception("@lldbmi_test can only be used to decorate a test method") -@wraps(func) -def wrapper(self, *args, **kwargs): -if lldb.dont_do_lldbmi_test: -self.skipTest("lldb-mi tests") -return func(self, *args, **kwargs) - -# Mark this function as such to separate them from lldb command line tests. -wrapper.__lldbmi_test__ = True -return wrapper - def benchmarks_test(func): """Decorate the item as a benchmarks test.""" if isinstance(func, type) and issubclass(func, unittest2.TestCase): @@ -1367,7 +1353,6 @@ self.lldbMiExec = os.environ["LLDBMI_EXEC"] else: self.lldbMiExec = None -self.dont_do_lldbmi_test = True # If we spawn an lldb process for test (via pexpect), do not load the # init file unless told otherwise. @@ -1384,19 +1369,6 @@ # used for all the test cases. self.testMethodName = self._testMethodName -# lldb-mi only test is decorated with @lldbmi_test, -# which also sets the "__lldbmi_test__" attribute of the -# function object to True. -try: -if lldb.just_do_lldbmi_test: -testMethod = getattr(self, self._testMethodName) -if getattr(testMethod, "__lldbmi_test__", False): -pass -else: -self.skipTest("non lldb-mi test") -except AttributeError: -pass - # Benchmarks
[Lldb-commits] [PATCH] D14111: Use "_$" prefix instead of "$" for dynamic checker function inserted by LLDB during expression evaluation
bhushan created this revision. bhushan added a reviewer: clayborg. bhushan added subscribers: nitesh.jain, sagar, mohit.bhakkad, jaydeep, lldb-commits. bhushan set the repository for this revision to rL LLVM. There is a issue (llvm assertion) in evaluating expressions for MIPS on Linux. (lldb) p fooptr(a,b) lldb: /home/battarde/git/llvm/lib/MC/ELFObjectWriter.cpp:791: void {anonymous}::ELFObjectWriter::computeSymbolTable(llvm::MCAssembler&, const llvm::MCAsmLayout&, const SectionIndexMapTy&, const RevGroupMapTy&, {anonymous}::ELFObjectWriter::SectionOffsetsTy&): Assertion `Local || !Symbol.isTemporary()' failed. This issue is caused due to the dynamic checker function’s name (hard-coded in LLDB in lldb\source\Expression\IRDynamicChecks.cpp) that start with “$” i.e “$__lldb_valid_pointer_check”. The symbol "$" has a special meaning for MIPS i.e it is marker for temporary symbols for MIPS. The discussion on lldb mailing list regarding this issue is at : http://lists.llvm.org/pipermail/lldb-dev/2015-October/008692.html This patch fixes this issue by using "_$" prefix instead of "$" in dymanic checker function’s name. -Bhushan Repository: rL LLVM http://reviews.llvm.org/D14111 Files: source/Expression/IRDynamicChecks.cpp Index: source/Expression/IRDynamicChecks.cpp === --- source/Expression/IRDynamicChecks.cpp +++ source/Expression/IRDynamicChecks.cpp @@ -31,12 +31,12 @@ static char ID; -#define VALID_POINTER_CHECK_NAME "$__lldb_valid_pointer_check" +#define VALID_POINTER_CHECK_NAME "_$__lldb_valid_pointer_check" #define VALID_OBJC_OBJECT_CHECK_NAME "$__lldb_objc_object_check" static const char g_valid_pointer_check_text[] = "extern \"C\" void\n" -"$__lldb_valid_pointer_check (unsigned char *$__lldb_arg_ptr)\n" +"_$__lldb_valid_pointer_check (unsigned char *$__lldb_arg_ptr)\n" "{\n" "unsigned char $__lldb_local_val = *$__lldb_arg_ptr;\n" "}"; Index: source/Expression/IRDynamicChecks.cpp === --- source/Expression/IRDynamicChecks.cpp +++ source/Expression/IRDynamicChecks.cpp @@ -31,12 +31,12 @@ static char ID; -#define VALID_POINTER_CHECK_NAME "$__lldb_valid_pointer_check" +#define VALID_POINTER_CHECK_NAME "_$__lldb_valid_pointer_check" #define VALID_OBJC_OBJECT_CHECK_NAME "$__lldb_objc_object_check" static const char g_valid_pointer_check_text[] = "extern \"C\" void\n" -"$__lldb_valid_pointer_check (unsigned char *$__lldb_arg_ptr)\n" +"_$__lldb_valid_pointer_check (unsigned char *$__lldb_arg_ptr)\n" "{\n" "unsigned char $__lldb_local_val = *$__lldb_arg_ptr;\n" "}"; ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r251402 - Some minor improvements on the symtab parsing code
Author: tberghammer Date: Tue Oct 27 05:43:27 2015 New Revision: 251402 URL: http://llvm.org/viewvc/llvm-project?rev=251402&view=rev Log: Some minor improvements on the symtab parsing code * Remove an unneccessary re-computaion on arch spec from the ELF file * Use a local cache to optimize name based section lookups in symtab parsing * Optimize C++ method basename validation with replacing a regex with hand written code These modifications reduce the time required to parse the symtab from large applications by ~25% (tested with LLDB as inferior) Differential revision: http://reviews.llvm.org/D14088 Modified: lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp Modified: lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp?rev=251402&r1=251401&r2=251402&view=diff == --- lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp (original) +++ lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp Tue Oct 27 05:43:27 2015 @@ -131,6 +131,49 @@ ReverseFindMatchingChars (const llvm::St return false; } +static bool +IsValidBasename(const llvm::StringRef& basename) +{ +// Check that the basename matches with the following regular expression or is an operator name: +// "^~?([A-Za-z_][A-Za-z_0-9]*)(<.*>)?$" +// We are using a hand written implementation because it is significantly more efficient then +// using the general purpose regular expression library. +size_t idx = 0; +if (basename.size() > 0 && basename[0] == '~') +idx = 1; + +if (basename.size() <= idx) +return false; // Empty string or "~" + +if (!std::isalpha(basename[idx]) && basename[idx] != '_') +return false; // First charater (after removing the possible '~'') isn't in [A-Za-z_] + +// Read all characters matching [A-Za-z_0-9] +++idx; +while (idx < basename.size()) +{ +if (!std::isalnum(basename[idx]) && basename[idx] != '_') +break; +++idx; +} + +// We processed all characters. It is a vaild basename. +if (idx == basename.size()) +return true; + +// Check for basename with template arguments +// TODO: Improve the quality of the validation with validating the template arguments +if (basename[idx] == '<' && basename.back() == '>') +return true; + +// Check if the basename is a vaild C++ operator name +if (!basename.startswith("operator")) +return false; + +static RegularExpression g_operator_regex("^(operator)( ?)([A-Za-z_][A-Za-z_0-9]*|\\(\\)|\\[\\]|[\\^<>=!\\/*+-]+)(<.*>)?(\\[\\])?$"); +std::string basename_str(basename.str()); +return g_operator_regex.Execute(basename_str.c_str(), nullptr); +} void CPlusPlusLanguage::MethodName::Parse() @@ -201,30 +244,8 @@ CPlusPlusLanguage::MethodName::Parse() m_parse_error = true; return; } - -//if (!m_context.empty()) -//printf (" context = '%s'\n", m_context.str().c_str()); -//if (m_basename) -//printf (" basename = '%s'\n", m_basename.GetCString()); -//if (!m_arguments.empty()) -//printf (" arguments = '%s'\n", m_arguments.str().c_str()); -//if (!m_qualifiers.empty()) -//printf ("qualifiers = '%s'\n", m_qualifiers.str().c_str()); - -// Make sure we have a valid C++ basename with optional template args -static RegularExpression g_identifier_regex("^~?([A-Za-z_][A-Za-z_0-9]*)(<.*>)?$"); -std::string basename_str(m_basename.str()); -bool basename_is_valid = g_identifier_regex.Execute (basename_str.c_str(), NULL); -if (!basename_is_valid) -{ -// Check for C++ operators -if (m_basename.startswith("operator")) -{ -static RegularExpression g_operator_regex("^(operator)( ?)([A-Za-z_][A-Za-z_0-9]*|\\(\\)|\\[\\]|[\\^<>=!\\/*+-]+)(<.*>)?(\\[\\])?$"); -basename_is_valid = g_operator_regex.Execute(basename_str.c_str(), NULL); -} -} -if (!basename_is_valid) + +if (!IsValidBasename(m_basename)) { // The C++ basename doesn't match our regular expressions so this can't // be a valid C++ method, clear everything out and indicate an error @@ -238,7 +259,6 @@ CPlusPlusLanguage::MethodName::Parse() else { m_parse_error = true; -//printf ("error: didn't find matching parens for arguments\n"); } } } Modified: lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFile
Re: [Lldb-commits] [PATCH] D14088: Some minor improvements on the symtab parsing code
This revision was automatically updated to reflect the committed changes. Closed by commit rL251402: Some minor improvements on the symtab parsing code (authored by tberghammer). Changed prior to commit: http://reviews.llvm.org/D14088?vs=38445&id=38520#toc Repository: rL LLVM http://reviews.llvm.org/D14088 Files: lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp Index: lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp === --- lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp +++ lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp @@ -131,6 +131,49 @@ return false; } +static bool +IsValidBasename(const llvm::StringRef& basename) +{ +// Check that the basename matches with the following regular expression or is an operator name: +// "^~?([A-Za-z_][A-Za-z_0-9]*)(<.*>)?$" +// We are using a hand written implementation because it is significantly more efficient then +// using the general purpose regular expression library. +size_t idx = 0; +if (basename.size() > 0 && basename[0] == '~') +idx = 1; + +if (basename.size() <= idx) +return false; // Empty string or "~" + +if (!std::isalpha(basename[idx]) && basename[idx] != '_') +return false; // First charater (after removing the possible '~'') isn't in [A-Za-z_] + +// Read all characters matching [A-Za-z_0-9] +++idx; +while (idx < basename.size()) +{ +if (!std::isalnum(basename[idx]) && basename[idx] != '_') +break; +++idx; +} + +// We processed all characters. It is a vaild basename. +if (idx == basename.size()) +return true; + +// Check for basename with template arguments +// TODO: Improve the quality of the validation with validating the template arguments +if (basename[idx] == '<' && basename.back() == '>') +return true; + +// Check if the basename is a vaild C++ operator name +if (!basename.startswith("operator")) +return false; + +static RegularExpression g_operator_regex("^(operator)( ?)([A-Za-z_][A-Za-z_0-9]*|\\(\\)|\\[\\]|[\\^<>=!\\/*+-]+)(<.*>)?(\\[\\])?$"); +std::string basename_str(basename.str()); +return g_operator_regex.Execute(basename_str.c_str(), nullptr); +} void CPlusPlusLanguage::MethodName::Parse() @@ -201,30 +244,8 @@ m_parse_error = true; return; } - -//if (!m_context.empty()) -//printf (" context = '%s'\n", m_context.str().c_str()); -//if (m_basename) -//printf (" basename = '%s'\n", m_basename.GetCString()); -//if (!m_arguments.empty()) -//printf (" arguments = '%s'\n", m_arguments.str().c_str()); -//if (!m_qualifiers.empty()) -//printf ("qualifiers = '%s'\n", m_qualifiers.str().c_str()); - -// Make sure we have a valid C++ basename with optional template args -static RegularExpression g_identifier_regex("^~?([A-Za-z_][A-Za-z_0-9]*)(<.*>)?$"); -std::string basename_str(m_basename.str()); -bool basename_is_valid = g_identifier_regex.Execute (basename_str.c_str(), NULL); -if (!basename_is_valid) -{ -// Check for C++ operators -if (m_basename.startswith("operator")) -{ -static RegularExpression g_operator_regex("^(operator)( ?)([A-Za-z_][A-Za-z_0-9]*|\\(\\)|\\[\\]|[\\^<>=!\\/*+-]+)(<.*>)?(\\[\\])?$"); -basename_is_valid = g_operator_regex.Execute(basename_str.c_str(), NULL); -} -} -if (!basename_is_valid) + +if (!IsValidBasename(m_basename)) { // The C++ basename doesn't match our regular expressions so this can't // be a valid C++ method, clear everything out and indicate an error @@ -238,7 +259,6 @@ else { m_parse_error = true; -//printf ("error: didn't find matching parens for arguments\n"); } } } Index: lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp === --- lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -11,6 +11,7 @@ #include #include +#include #include "lldb/Core/ArchSpec.h" #include "lldb/Core/DataBuffer.h" @@ -1943,6 +1944,13 @@ // makes it highly unlikely that this will collide with anything else. bool skip_oatdata_oatexec = m_file.GetFilename() == ConstString("system@framew...@boot.oat"); +ArchSpec arch; +GetArchitecture(arch); + +// Local cache to avoid doing a FindSectionByName for each sym
[Lldb-commits] [lldb] r251403 - Fix MSVC build after r251402
Author: tberghammer Date: Tue Oct 27 05:56:35 2015 New Revision: 251403 URL: http://llvm.org/viewvc/llvm-project?rev=251403&view=rev Log: Fix MSVC build after r251402 Modified: lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp Modified: lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp?rev=251403&r1=251402&r2=251403&view=diff == --- lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp (original) +++ lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp Tue Oct 27 05:56:35 2015 @@ -9,7 +9,6 @@ #include "CPlusPlusLanguage.h" -#include #include "llvm/ADT/StringRef.h" @@ -26,6 +25,8 @@ #include "LibCxx.h" #include "LibStdcpp.h" +#include +#include #include #include ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D14118: Changes for Bug 17384
tberghammer accepted this revision. tberghammer added a comment. This revision is now accepted and ready to land. Looks good with a few minor suggestions inline Comment at: source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp:578-579 @@ +577,4 @@ +} + +return; +} (nit): It isn't needed Comment at: source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h:91-95 @@ -90,1 +90,7 @@ +/// Contains AT_SYSINFO_EHDR, which means a vDSO has been +/// mapped to the address space +bool m_contains_vdso; + +lldb::addr_t m_vdso_base; + I would suggest to merge these 2 with setting m_vdso_base to LLDB_INVALID_ADDRESS if we don't have a vdso http://reviews.llvm.org/D14118 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D14111: Use "_$" prefix instead of "$" for dynamic checker function inserted by LLDB during expression evaluation
clayborg resigned from this revision. clayborg edited reviewers, added: spyffe, jingham; removed: clayborg. clayborg added a comment. Lets let Sean Callanan and Jim Ingham make sure this is good as they are the expression parser masters. Repository: rL LLVM http://reviews.llvm.org/D14111 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D14118: Changes for Bug 17384
clayborg resigned from this revision. clayborg removed a reviewer: clayborg. clayborg added a comment. I don't know anything about shared library loading on Linux. http://reviews.llvm.org/D14118 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r251416 - Fix Clang-tidy modernize-use-nullptr warnings in include/lldb/DataFormatters, Breakpoint and Utility; other minor fixes.
Author: eugenezelenko Date: Tue Oct 27 12:20:33 2015 New Revision: 251416 URL: http://llvm.org/viewvc/llvm-project?rev=251416&view=rev Log: Fix Clang-tidy modernize-use-nullptr warnings in include/lldb/DataFormatters, Breakpoint and Utility; other minor fixes. Modified: lldb/trunk/include/lldb/Breakpoint/Breakpoint.h lldb/trunk/include/lldb/Breakpoint/BreakpointLocation.h lldb/trunk/include/lldb/Breakpoint/BreakpointLocationList.h lldb/trunk/include/lldb/Breakpoint/BreakpointOptions.h lldb/trunk/include/lldb/Breakpoint/Watchpoint.h lldb/trunk/include/lldb/Breakpoint/WatchpointOptions.h lldb/trunk/include/lldb/DataFormatters/DataVisualization.h lldb/trunk/include/lldb/DataFormatters/DumpValueObjectOptions.h lldb/trunk/include/lldb/DataFormatters/FormatClasses.h lldb/trunk/include/lldb/DataFormatters/FormatManager.h lldb/trunk/include/lldb/DataFormatters/FormattersContainer.h lldb/trunk/include/lldb/DataFormatters/StringPrinter.h lldb/trunk/include/lldb/DataFormatters/TypeCategory.h lldb/trunk/include/lldb/DataFormatters/TypeCategoryMap.h lldb/trunk/include/lldb/DataFormatters/TypeSummary.h lldb/trunk/include/lldb/DataFormatters/TypeSynthetic.h lldb/trunk/include/lldb/Utility/Iterable.h lldb/trunk/include/lldb/Utility/SharingPtr.h Modified: lldb/trunk/include/lldb/Breakpoint/Breakpoint.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Breakpoint/Breakpoint.h?rev=251416&r1=251415&r2=251416&view=diff == --- lldb/trunk/include/lldb/Breakpoint/Breakpoint.h (original) +++ lldb/trunk/include/lldb/Breakpoint/Breakpoint.h Tue Oct 27 12:20:33 2015 @@ -12,7 +12,10 @@ // C Includes // C++ Includes +#include +#include #include +#include // Other libraries and framework includes // Project includes @@ -81,7 +84,6 @@ class Breakpoint: public Stoppoint { public: - static const ConstString & GetEventIdentifier (); @@ -142,7 +144,6 @@ public: GetEventDataFromEvent (const Event *event_sp); private: - lldb::BreakpointEventType m_breakpoint_event; lldb::BreakpointSP m_new_breakpoint_sp; BreakpointLocationCollection m_locations; @@ -153,7 +154,7 @@ public: class BreakpointPrecondition { public: -virtual ~BreakpointPrecondition() {} +virtual ~BreakpointPrecondition() = default; virtual bool EvaluatePrecondition(StoppointCallbackContext &context); @@ -287,8 +288,8 @@ public: ///Returns a pointer to the new location. //-- lldb::BreakpointLocationSP -AddLocation (const Address &addr, - bool *new_location = NULL); +AddLocation(const Address &addr, +bool *new_location = nullptr); //-- /// Find a breakpoint location by Address. @@ -297,7 +298,7 @@ public: ///The Address specifying the location. /// @return ///Returns a shared pointer to the location at \a addr. The pointer -///in the shared pointer will be NULL if there is no location at that address. +///in the shared pointer will be nullptr if there is no location at that address. //-- lldb::BreakpointLocationSP FindLocationByAddress (const Address &addr); @@ -321,7 +322,7 @@ public: ///The ID specifying the location. /// @return ///Returns a shared pointer to the location with ID \a bp_loc_id. The pointer -///in the shared pointer will be NULL if there is no location with that ID. +///in the shared pointer will be nullptr if there is no location with that ID. //-- lldb::BreakpointLocationSP FindLocationByID (lldb::break_id_t bp_loc_id); @@ -334,7 +335,7 @@ public: /// /// @return /// Returns a shared pointer to the location with index \a -/// index. The shared pointer might contain NULL if \a index is +/// index. The shared pointer might contain nullptr if \a index is /// greater than then number of actual locations. //-- lldb::BreakpointLocationSP @@ -482,7 +483,7 @@ public: /// /// @param[in] condition ///The condition expression to evaluate when the breakpoint is hit. -///Pass in NULL to clear the condition. +///Pass in nullptr to clear the condition. //-- void SetCondition (const char *condition); @@ -490,7 +491,7 @@ public: /// Return a pointer to the text of the condition expression. /// /// @return -///
Re: [Lldb-commits] [PATCH] D14118: Changes for Bug 17384
ovyalov accepted this revision. ovyalov added a comment. Looks good - minor comments. Comment at: source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp:513 @@ +512,3 @@ +{ +FileSpec file_spec; +file_spec.SetFile("[vdso]", false); Please combine these 2 lines - FileSpec file_spec("[vdso]", false); Comment at: test/functionalities/inferior-assert/TestInferiorAssert.py:161 @@ -162,1 +160,3 @@ pc_backup_offset = 0 +if "i386" in self.getArchitecture(): +if lastframeID == frame.GetFrameID(): Could you store result of "i386" in self.getArchitecture() as temp variable outside of frames's loop? http://reviews.llvm.org/D14118 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D14101: Treat hostname in android URL as device id unless it matches "localhost"
ovyalov added a comment. In http://reviews.llvm.org/D14101#275946, @labath wrote: > I like this. (I assume it will work with the tcp-connected devices which have > an ID like `???:port`) Yes - definitely. http://reviews.llvm.org/D14101 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r251417 - Add Socket::Create factory method which uses socket protocol to find an appropriate implementation class.
Author: ovyalov Date: Tue Oct 27 12:32:01 2015 New Revision: 251417 URL: http://llvm.org/viewvc/llvm-project?rev=251417&view=rev Log: Add Socket::Create factory method which uses socket protocol to find an appropriate implementation class. http://reviews.llvm.org/D14085 Modified: lldb/trunk/include/lldb/Host/Socket.h lldb/trunk/include/lldb/Host/common/UDPSocket.h lldb/trunk/source/Host/common/Socket.cpp lldb/trunk/tools/lldb-server/Acceptor.cpp lldb/trunk/tools/lldb-server/Acceptor.h Modified: lldb/trunk/include/lldb/Host/Socket.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/Socket.h?rev=251417&r1=251416&r2=251417&view=diff == --- lldb/trunk/include/lldb/Host/Socket.h (original) +++ lldb/trunk/include/lldb/Host/Socket.h Tue Oct 27 12:32:01 2015 @@ -10,6 +10,7 @@ #ifndef liblldb_Host_Socket_h_ #define liblldb_Host_Socket_h_ +#include #include #include "lldb/lldb-private.h" @@ -53,6 +54,8 @@ public: ~Socket() override; +static std::unique_ptr Create(const SocketProtocol protocol, bool child_processes_inherit, Error &error); + virtual Error Connect(llvm::StringRef name) = 0; virtual Error Listen(llvm::StringRef name, int backlog) = 0; virtual Error Accept(llvm::StringRef name, bool child_processes_inherit, Socket *&socket) = 0; Modified: lldb/trunk/include/lldb/Host/common/UDPSocket.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/common/UDPSocket.h?rev=251417&r1=251416&r2=251417&view=diff == --- lldb/trunk/include/lldb/Host/common/UDPSocket.h (original) +++ lldb/trunk/include/lldb/Host/common/UDPSocket.h Tue Oct 27 12:32:01 2015 @@ -17,11 +17,11 @@ namespace lldb_private class UDPSocket: public Socket { public: -static Error Connect(llvm::StringRef name, bool child_processes_inherit, Socket *&send_socket, Socket *&recv_socket); +UDPSocket(bool child_processes_inherit, Error &error); +static Error Connect(llvm::StringRef name, bool child_processes_inherit, Socket *&send_socket, Socket *&recv_socket); private: UDPSocket(NativeSocket socket); -UDPSocket(bool child_processes_inherit, Error &error); size_t Send(const void *buf, const size_t num_bytes) override; Error Connect(llvm::StringRef name) override; Modified: lldb/trunk/source/Host/common/Socket.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Socket.cpp?rev=251417&r1=251416&r2=251417&view=diff == --- lldb/trunk/source/Host/common/Socket.cpp (original) +++ lldb/trunk/source/Host/common/Socket.cpp Tue Oct 27 12:32:01 2015 @@ -86,6 +86,41 @@ Socket::~Socket() Close(); } +std::unique_ptr Socket::Create(const SocketProtocol protocol, bool child_processes_inherit, Error &error) +{ +error.Clear(); + +std::unique_ptr socket_up; +switch (protocol) +{ +case ProtocolTcp: +socket_up.reset(new TCPSocket(child_processes_inherit, error)); +break; +case ProtocolUdp: +socket_up.reset(new UDPSocket(child_processes_inherit, error)); +break; +case ProtocolUnixDomain: +#ifndef LLDB_DISABLE_POSIX +socket_up.reset(new DomainSocket(child_processes_inherit, error)); +#else +error.SetErrorString("Unix domain sockets are not supported on this platform."); +#endif +break; +case ProtocolUnixAbstract: +#ifdef __linux__ +socket_up.reset(new AbstractSocket(child_processes_inherit, error)); +#else +error.SetErrorString("Abstract domain sockets are not supported on this platform."); +#endif +break; +} + +if (error.Fail()) +socket_up.reset(); + +return socket_up; +} + Error Socket::TcpConnect(llvm::StringRef host_and_port, bool child_processes_inherit, Socket *&socket) { Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_COMMUNICATION)); @@ -93,7 +128,7 @@ Error Socket::TcpConnect(llvm::StringRef log->Printf ("Socket::%s (host/port = %s)", __FUNCTION__, host_and_port.data()); Error error; -std::unique_ptr connect_socket(new TCPSocket(child_processes_inherit, error)); +std::unique_ptr connect_socket(Create(ProtocolTcp, child_processes_inherit, error)); if (error.Fail()) return error; @@ -161,25 +196,21 @@ Error Socket::UdpConnect(llvm::StringRef Error Socket::UnixDomainConnect(llvm::StringRef name, bool child_processes_inherit, Socket *&socket) { Error error; -#ifndef LLDB_DISABLE_POSIX -std::unique_ptr connect_socket(new DomainSocket(child_processes_inherit, error)); +std::unique_ptr connect_socket(Create(ProtocolUnixDomain, child_processes_inherit, error)); if (error.Fail()) return error; error = co
Re: [Lldb-commits] [PATCH] D14085: Add Socket::Create factory method which uses socket protocol to find an appropriate implementation class.
ovyalov closed this revision. ovyalov added a comment. Files: /lldb/trunk/include/lldb/Host/Socket.h /lldb/trunk/include/lldb/Host/common/UDPSocket.h /lldb/trunk/source/Host/common/Socket.cpp /lldb/trunk/tools/lldb-server/Acceptor.cpp /lldb/trunk/tools/lldb-server/Acceptor.h Users: ovyalov (Author) http://reviews.llvm.org/rL251417 http://reviews.llvm.org/D14085 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r251421 - Add a file in Makefile build which is present in CMake build.
Author: abidh Date: Tue Oct 27 12:39:22 2015 New Revision: 251421 URL: http://llvm.org/viewvc/llvm-project?rev=251421&view=rev Log: Add a file in Makefile build which is present in CMake build. Since 219143, this file is missing from Makefile build. Committed as obvious. Modified: lldb/trunk/source/Host/Makefile Modified: lldb/trunk/source/Host/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/Makefile?rev=251421&r1=251420&r2=251421&view=diff == --- lldb/trunk/source/Host/Makefile (original) +++ lldb/trunk/source/Host/Makefile Tue Oct 27 12:39:22 2015 @@ -50,6 +50,7 @@ endif ifeq ($(HOST_OS),MingW) $(eval $(call DIR_SOURCES,windows)) +SOURCES += posix/ConnectionFileDescriptorPosix.cpp endif ifeq ($(HOST_OS),Android) ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r251422 - Treat hostname in android URL as device id unless it matches "localhost".
Author: ovyalov Date: Tue Oct 27 12:41:34 2015 New Revision: 251422 URL: http://llvm.org/viewvc/llvm-project?rev=251422&view=rev Log: Treat hostname in android URL as device id unless it matches "localhost". http://reviews.llvm.org/D14101 Modified: lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.cpp lldb/trunk/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp Modified: lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.cpp?rev=251422&r1=251421&r2=251422&view=diff == --- lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.cpp (original) +++ lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.cpp Tue Oct 27 12:41:34 2015 @@ -196,7 +196,7 @@ PlatformAndroid::ConnectRemote(Args& arg return Error("URL is null."); if (!UriParser::Parse(url, scheme, host, port, path)) return Error("Invalid URL: %s", url); -if (scheme == "adb") +if (host != "localhost") m_device_id = host; auto error = PlatformLinux::ConnectRemote(args); Modified: lldb/trunk/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp?rev=251422&r1=251421&r2=251422&view=diff == --- lldb/trunk/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp (original) +++ lldb/trunk/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp Tue Oct 27 12:41:34 2015 @@ -126,7 +126,7 @@ PlatformAndroidRemoteGDBServer::ConnectR return Error("URL is null."); if (!UriParser::Parse (url, scheme, host, remote_port, path)) return Error("Invalid URL: %s", url); -if (scheme == "adb") +if (host != "localhost") m_device_id = host; std::string connect_url; ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D14101: Treat hostname in android URL as device id unless it matches "localhost"
ovyalov closed this revision. ovyalov added a comment. Submitted as http://reviews.llvm.org/rL251422 http://reviews.llvm.org/D14101 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r251426 - Include to fix build errors.
Author: abidh Date: Tue Oct 27 12:56:23 2015 New Revision: 251426 URL: http://llvm.org/viewvc/llvm-project?rev=251426&view=rev Log: Include to fix build errors. This file uses things like fprintf and stderr and is the right header to include. I was getting build errors without it. Modified: lldb/trunk/source/Core/CxaDemangle.cpp Modified: lldb/trunk/source/Core/CxaDemangle.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/CxaDemangle.cpp?rev=251426&r1=251425&r2=251426&view=diff == --- lldb/trunk/source/Core/CxaDemangle.cpp (original) +++ lldb/trunk/source/Core/CxaDemangle.cpp Tue Oct 27 12:56:23 2015 @@ -13,6 +13,7 @@ // - Included win32.h for snprintf implementation for MSVC // - Removed constexpr member initialization for MSVC // - Changed argument to alignas() to a literal for MSVC +// - Include for fprintf, stderr like entities. //-- #if defined(_MSC_VER) @@ -40,6 +41,7 @@ #include #include #include +#include namespace lldb_private { ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D14126: Make lldb-gdbserver to take explicit socket scheme as command line argument
ovyalov created this revision. ovyalov added a reviewer: clayborg. ovyalov added a subscriber: lldb-commits. Make lldb-gdbserver to take explicit socket scheme as command line argument - so lldb gdb-server uses the same socket type as platform does. http://reviews.llvm.org/D14126 Files: source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.h tools/lldb-server/Acceptor.cpp tools/lldb-server/Acceptor.h tools/lldb-server/lldb-platform.cpp Index: tools/lldb-server/lldb-platform.cpp === --- tools/lldb-server/lldb-platform.cpp +++ tools/lldb-server/lldb-platform.cpp @@ -315,7 +315,8 @@ } do { -GDBRemoteCommunicationServerPlatform platform(acceptor_up->GetSocketProtocol()); +GDBRemoteCommunicationServerPlatform platform(acceptor_up->GetSocketProtocol(), + acceptor_up->GetSocketScheme()); if (port_offset > 0) platform.SetPortOffset(port_offset); Index: tools/lldb-server/Acceptor.h === --- tools/lldb-server/Acceptor.h +++ tools/lldb-server/Acceptor.h @@ -42,6 +42,9 @@ Socket::SocketProtocol GetSocketProtocol() const; +const char* +GetSocketScheme() const; + // Returns either TCP port number as string or domain socket path. // Empty string is returned in case of error. std::string Index: tools/lldb-server/Acceptor.cpp === --- tools/lldb-server/Acceptor.cpp +++ tools/lldb-server/Acceptor.cpp @@ -37,7 +37,8 @@ {"unix-abstract", Socket::ProtocolUnixAbstract}, }; -bool FindProtocolByScheme(const char* scheme, Socket::SocketProtocol& protocol) +bool +FindProtocolByScheme(const char* scheme, Socket::SocketProtocol& protocol) { for (auto s: socket_schemes) { @@ -50,6 +51,17 @@ return false; } +const char* +FindSchemeByProtocol(const Socket::SocketProtocol protocol) +{ +for (auto s: socket_schemes) +{ +if (s.m_protocol == protocol) +return s.m_scheme; +} +return nullptr; +} + } Error @@ -78,6 +90,12 @@ return m_listener_socket_up->GetSocketProtocol(); } +const char* +Acceptor::GetSocketScheme() const +{ +return FindSchemeByProtocol(GetSocketProtocol()); +} + std::string Acceptor::GetLocalSocketId() const { Index: source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.h === --- source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.h +++ source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.h @@ -29,7 +29,8 @@ public: typedef std::map PortMap; -GDBRemoteCommunicationServerPlatform(const Socket::SocketProtocol socket_protocol); +GDBRemoteCommunicationServerPlatform(const Socket::SocketProtocol socket_protocol, + const char* socket_scheme); ~GDBRemoteCommunicationServerPlatform() override; @@ -67,6 +68,7 @@ protected: const Socket::SocketProtocol m_socket_protocol; +const char* m_socket_scheme; // not owned. Mutex m_spawned_pids_mutex; std::set m_spawned_pids; lldb::PlatformSP m_platform_sp; Index: source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp === --- source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp +++ source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp @@ -46,9 +46,11 @@ //-- // GDBRemoteCommunicationServerPlatform constructor //-- -GDBRemoteCommunicationServerPlatform::GDBRemoteCommunicationServerPlatform(const Socket::SocketProtocol socket_protocol) : +GDBRemoteCommunicationServerPlatform::GDBRemoteCommunicationServerPlatform(const Socket::SocketProtocol socket_protocol, + const char* socket_scheme) : GDBRemoteCommunicationServerCommon ("gdb-remote.server", "gdb-remote.server.rx_packet"), m_socket_protocol(socket_protocol), +m_socket_scheme(socket_scheme), m_spawned_pids_mutex (Mutex::eMutexTypeRecursive), m_platform_sp (Platform::GetHostPlatform ()), m_port_map (), @@ -150,6 +152,7 @@ std::ostringstream url; uint16_t* port_ptr = &port; +url << m_socket_scheme << "://"; if (m_socket_protocol == Socket::ProtocolTcp) url << platform_ip << ":" << port; else ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman
[Lldb-commits] [PATCH] D14127: Use accept4 workaround for MIPS Android build.
chaoren created this revision. chaoren added reviewers: chying, ovyalov. chaoren added a subscriber: lldb-commits. Herald added subscribers: srhines, danalbert, tberghammer, aemerson. Similar to http://reviews.llvm.org/rL242319, which was for ARM. http://reviews.llvm.org/D14127 Files: cmake/platforms/Android.cmake source/Host/common/Socket.cpp Index: source/Host/common/Socket.cpp === --- source/Host/common/Socket.cpp +++ source/Host/common/Socket.cpp @@ -40,11 +40,11 @@ #include #include #include -#if defined(ANDROID_ARM_BUILD_STATIC) +#if defined(ANDROID_ARM_BUILD_STATIC) || defined(ANDROID_MIPS_BUILD_STATIC) #include #include #include -#endif // ANDROID_ARM_BUILD_STATIC +#endif // ANDROID_ARM_BUILD_STATIC || ANDROID_MIPS_BUILD_STATIC #endif // __ANDROID_NDK__ using namespace lldb; @@ -457,7 +457,7 @@ Error& error) { error.Clear(); -#if defined(ANDROID_ARM_BUILD_STATIC) +#if defined(ANDROID_ARM_BUILD_STATIC) || defined(ANDROID_MIPS_BUILD_STATIC) // Temporary workaround for statically linking Android lldb-server with the // latest API. int fd = syscall(__NR_accept, sockfd, addr, addrlen); Index: cmake/platforms/Android.cmake === --- cmake/platforms/Android.cmake +++ cmake/platforms/Android.cmake @@ -115,6 +115,10 @@ list( APPEND LLDB_SYSTEM_LIBS atomic ) set( LLDB_SYSTEM_LIBS ${LLDB_SYSTEM_LIBS} CACHE INTERNAL "" FORCE ) endif() + if( LLVM_BUILD_STATIC ) + # Temporary workaround for static linking with the latest API. + set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -DANDROID_MIPS_BUILD_STATIC" ) + endif() endif() if( NOT LLVM_BUILD_STATIC ) Index: source/Host/common/Socket.cpp === --- source/Host/common/Socket.cpp +++ source/Host/common/Socket.cpp @@ -40,11 +40,11 @@ #include #include #include -#if defined(ANDROID_ARM_BUILD_STATIC) +#if defined(ANDROID_ARM_BUILD_STATIC) || defined(ANDROID_MIPS_BUILD_STATIC) #include #include #include -#endif // ANDROID_ARM_BUILD_STATIC +#endif // ANDROID_ARM_BUILD_STATIC || ANDROID_MIPS_BUILD_STATIC #endif // __ANDROID_NDK__ using namespace lldb; @@ -457,7 +457,7 @@ Error& error) { error.Clear(); -#if defined(ANDROID_ARM_BUILD_STATIC) +#if defined(ANDROID_ARM_BUILD_STATIC) || defined(ANDROID_MIPS_BUILD_STATIC) // Temporary workaround for statically linking Android lldb-server with the // latest API. int fd = syscall(__NR_accept, sockfd, addr, addrlen); Index: cmake/platforms/Android.cmake === --- cmake/platforms/Android.cmake +++ cmake/platforms/Android.cmake @@ -115,6 +115,10 @@ list( APPEND LLDB_SYSTEM_LIBS atomic ) set( LLDB_SYSTEM_LIBS ${LLDB_SYSTEM_LIBS} CACHE INTERNAL "" FORCE ) endif() + if( LLVM_BUILD_STATIC ) + # Temporary workaround for static linking with the latest API. + set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -DANDROID_MIPS_BUILD_STATIC" ) + endif() endif() if( NOT LLVM_BUILD_STATIC ) ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r251439 - Use accept4 workaround for MIPS Android build.
Author: chaoren Date: Tue Oct 27 14:17:35 2015 New Revision: 251439 URL: http://llvm.org/viewvc/llvm-project?rev=251439&view=rev Log: Use accept4 workaround for MIPS Android build. Summary: Similar to http://reviews.llvm.org/rL242319, which was for ARM. Reviewers: chying, ovyalov Subscribers: aemerson, tberghammer, danalbert, srhines, lldb-commits Differential Revision: http://reviews.llvm.org/D14127 Modified: lldb/trunk/cmake/platforms/Android.cmake lldb/trunk/source/Host/common/Socket.cpp Modified: lldb/trunk/cmake/platforms/Android.cmake URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/platforms/Android.cmake?rev=251439&r1=251438&r2=251439&view=diff == --- lldb/trunk/cmake/platforms/Android.cmake (original) +++ lldb/trunk/cmake/platforms/Android.cmake Tue Oct 27 14:17:35 2015 @@ -115,6 +115,10 @@ elseif( ANDROID_ABI STREQUAL "mips" ) list( APPEND LLDB_SYSTEM_LIBS atomic ) set( LLDB_SYSTEM_LIBS ${LLDB_SYSTEM_LIBS} CACHE INTERNAL "" FORCE ) endif() + if( LLVM_BUILD_STATIC ) + # Temporary workaround for static linking with the latest API. + set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -DANDROID_MIPS_BUILD_STATIC" ) + endif() endif() if( NOT LLVM_BUILD_STATIC ) Modified: lldb/trunk/source/Host/common/Socket.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Socket.cpp?rev=251439&r1=251438&r2=251439&view=diff == --- lldb/trunk/source/Host/common/Socket.cpp (original) +++ lldb/trunk/source/Host/common/Socket.cpp Tue Oct 27 14:17:35 2015 @@ -40,11 +40,11 @@ #include #include #include -#if defined(ANDROID_ARM_BUILD_STATIC) +#if defined(ANDROID_ARM_BUILD_STATIC) || defined(ANDROID_MIPS_BUILD_STATIC) #include #include #include -#endif // ANDROID_ARM_BUILD_STATIC +#endif // ANDROID_ARM_BUILD_STATIC || ANDROID_MIPS_BUILD_STATIC #endif // __ANDROID_NDK__ using namespace lldb; @@ -457,7 +457,7 @@ Socket::AcceptSocket(NativeSocket sockfd Error& error) { error.Clear(); -#if defined(ANDROID_ARM_BUILD_STATIC) +#if defined(ANDROID_ARM_BUILD_STATIC) || defined(ANDROID_MIPS_BUILD_STATIC) // Temporary workaround for statically linking Android lldb-server with the // latest API. int fd = syscall(__NR_accept, sockfd, addr, addrlen); ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D14127: Use accept4 workaround for MIPS Android build.
This revision was automatically updated to reflect the committed changes. Closed by commit rL251439: Use accept4 workaround for MIPS Android build. (authored by chaoren). Changed prior to commit: http://reviews.llvm.org/D14127?vs=38581&id=38582#toc Repository: rL LLVM http://reviews.llvm.org/D14127 Files: lldb/trunk/cmake/platforms/Android.cmake lldb/trunk/source/Host/common/Socket.cpp Index: lldb/trunk/source/Host/common/Socket.cpp === --- lldb/trunk/source/Host/common/Socket.cpp +++ lldb/trunk/source/Host/common/Socket.cpp @@ -40,11 +40,11 @@ #include #include #include -#if defined(ANDROID_ARM_BUILD_STATIC) +#if defined(ANDROID_ARM_BUILD_STATIC) || defined(ANDROID_MIPS_BUILD_STATIC) #include #include #include -#endif // ANDROID_ARM_BUILD_STATIC +#endif // ANDROID_ARM_BUILD_STATIC || ANDROID_MIPS_BUILD_STATIC #endif // __ANDROID_NDK__ using namespace lldb; @@ -457,7 +457,7 @@ Error& error) { error.Clear(); -#if defined(ANDROID_ARM_BUILD_STATIC) +#if defined(ANDROID_ARM_BUILD_STATIC) || defined(ANDROID_MIPS_BUILD_STATIC) // Temporary workaround for statically linking Android lldb-server with the // latest API. int fd = syscall(__NR_accept, sockfd, addr, addrlen); Index: lldb/trunk/cmake/platforms/Android.cmake === --- lldb/trunk/cmake/platforms/Android.cmake +++ lldb/trunk/cmake/platforms/Android.cmake @@ -115,6 +115,10 @@ list( APPEND LLDB_SYSTEM_LIBS atomic ) set( LLDB_SYSTEM_LIBS ${LLDB_SYSTEM_LIBS} CACHE INTERNAL "" FORCE ) endif() + if( LLVM_BUILD_STATIC ) + # Temporary workaround for static linking with the latest API. + set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -DANDROID_MIPS_BUILD_STATIC" ) + endif() endif() if( NOT LLVM_BUILD_STATIC ) Index: lldb/trunk/source/Host/common/Socket.cpp === --- lldb/trunk/source/Host/common/Socket.cpp +++ lldb/trunk/source/Host/common/Socket.cpp @@ -40,11 +40,11 @@ #include #include #include -#if defined(ANDROID_ARM_BUILD_STATIC) +#if defined(ANDROID_ARM_BUILD_STATIC) || defined(ANDROID_MIPS_BUILD_STATIC) #include #include #include -#endif // ANDROID_ARM_BUILD_STATIC +#endif // ANDROID_ARM_BUILD_STATIC || ANDROID_MIPS_BUILD_STATIC #endif // __ANDROID_NDK__ using namespace lldb; @@ -457,7 +457,7 @@ Error& error) { error.Clear(); -#if defined(ANDROID_ARM_BUILD_STATIC) +#if defined(ANDROID_ARM_BUILD_STATIC) || defined(ANDROID_MIPS_BUILD_STATIC) // Temporary workaround for statically linking Android lldb-server with the // latest API. int fd = syscall(__NR_accept, sockfd, addr, addrlen); Index: lldb/trunk/cmake/platforms/Android.cmake === --- lldb/trunk/cmake/platforms/Android.cmake +++ lldb/trunk/cmake/platforms/Android.cmake @@ -115,6 +115,10 @@ list( APPEND LLDB_SYSTEM_LIBS atomic ) set( LLDB_SYSTEM_LIBS ${LLDB_SYSTEM_LIBS} CACHE INTERNAL "" FORCE ) endif() + if( LLVM_BUILD_STATIC ) + # Temporary workaround for static linking with the latest API. + set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -DANDROID_MIPS_BUILD_STATIC" ) + endif() endif() if( NOT LLVM_BUILD_STATIC ) ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D14126: Make lldb-gdbserver to take explicit socket scheme as command line argument
clayborg requested changes to this revision. clayborg added a comment. This revision now requires changes to proceed. Need to make a copy of socket_scheme in GDBRemoteCommunicationServerPlatform (save it to a std::string). Comment at: source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.h:71 @@ -69,2 +70,3 @@ const Socket::SocketProtocol m_socket_protocol; +const char* m_socket_scheme; // not owned. Mutex m_spawned_pids_mutex; We should make a copy in a std::string here. http://reviews.llvm.org/D14126 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D14126: Make lldb-gdbserver to take explicit socket scheme as command line argument
ovyalov updated this revision to Diff 38588. ovyalov added a comment. Addressed review comments - please take another look. http://reviews.llvm.org/D14126 Files: source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.h tools/lldb-server/Acceptor.cpp tools/lldb-server/Acceptor.h tools/lldb-server/lldb-platform.cpp Index: tools/lldb-server/lldb-platform.cpp === --- tools/lldb-server/lldb-platform.cpp +++ tools/lldb-server/lldb-platform.cpp @@ -315,7 +315,8 @@ } do { -GDBRemoteCommunicationServerPlatform platform(acceptor_up->GetSocketProtocol()); +GDBRemoteCommunicationServerPlatform platform(acceptor_up->GetSocketProtocol(), + acceptor_up->GetSocketScheme()); if (port_offset > 0) platform.SetPortOffset(port_offset); Index: tools/lldb-server/Acceptor.h === --- tools/lldb-server/Acceptor.h +++ tools/lldb-server/Acceptor.h @@ -42,6 +42,9 @@ Socket::SocketProtocol GetSocketProtocol() const; +const char* +GetSocketScheme() const; + // Returns either TCP port number as string or domain socket path. // Empty string is returned in case of error. std::string Index: tools/lldb-server/Acceptor.cpp === --- tools/lldb-server/Acceptor.cpp +++ tools/lldb-server/Acceptor.cpp @@ -37,7 +37,8 @@ {"unix-abstract", Socket::ProtocolUnixAbstract}, }; -bool FindProtocolByScheme(const char* scheme, Socket::SocketProtocol& protocol) +bool +FindProtocolByScheme(const char* scheme, Socket::SocketProtocol& protocol) { for (auto s: socket_schemes) { @@ -50,6 +51,17 @@ return false; } +const char* +FindSchemeByProtocol(const Socket::SocketProtocol protocol) +{ +for (auto s: socket_schemes) +{ +if (s.m_protocol == protocol) +return s.m_scheme; +} +return nullptr; +} + } Error @@ -78,6 +90,12 @@ return m_listener_socket_up->GetSocketProtocol(); } +const char* +Acceptor::GetSocketScheme() const +{ +return FindSchemeByProtocol(GetSocketProtocol()); +} + std::string Acceptor::GetLocalSocketId() const { Index: source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.h === --- source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.h +++ source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.h @@ -29,7 +29,8 @@ public: typedef std::map PortMap; -GDBRemoteCommunicationServerPlatform(const Socket::SocketProtocol socket_protocol); +GDBRemoteCommunicationServerPlatform(const Socket::SocketProtocol socket_protocol, + const char* socket_scheme); ~GDBRemoteCommunicationServerPlatform() override; @@ -67,6 +68,7 @@ protected: const Socket::SocketProtocol m_socket_protocol; +const std::string m_socket_scheme; Mutex m_spawned_pids_mutex; std::set m_spawned_pids; lldb::PlatformSP m_platform_sp; Index: source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp === --- source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp +++ source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp @@ -46,9 +46,11 @@ //-- // GDBRemoteCommunicationServerPlatform constructor //-- -GDBRemoteCommunicationServerPlatform::GDBRemoteCommunicationServerPlatform(const Socket::SocketProtocol socket_protocol) : +GDBRemoteCommunicationServerPlatform::GDBRemoteCommunicationServerPlatform(const Socket::SocketProtocol socket_protocol, + const char* socket_scheme) : GDBRemoteCommunicationServerCommon ("gdb-remote.server", "gdb-remote.server.rx_packet"), m_socket_protocol(socket_protocol), +m_socket_scheme(socket_scheme), m_spawned_pids_mutex (Mutex::eMutexTypeRecursive), m_platform_sp (Platform::GetHostPlatform ()), m_port_map (), @@ -150,6 +152,7 @@ std::ostringstream url; uint16_t* port_ptr = &port; +url << m_socket_scheme << "://"; if (m_socket_protocol == Socket::ProtocolTcp) url << platform_ip << ":" << port; else ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D14131: Preparation for making a Python package out of lldb's Python code
zturner created this revision. zturner added reviewers: clayborg, tfiala. zturner added a subscriber: lldb-commits. See the thread in lldb-dev for context. After this patch, the remaining piece of work is to literally move `lldb/test` to `lldb/packages/Python/lldbsuite/test` and apply 1 or 2 fixups at places marked in this patch. http://reviews.llvm.org/D14131 Files: packages/Python/lldbsuite/__init__.py packages/Python/lldbsuite/test/__init__.py test/dosep.py test/dotest.py test/use_lldb_suite.py use_lldb_suite_root.py Index: use_lldb_suite_root.py === --- use_lldb_suite_root.py +++ use_lldb_suite_root.py @@ -11,5 +11,12 @@ for module_dir in module_dirs: module_dir = os.path.join(third_party_modules_dir, module_dir) sys.path.insert(0, module_dir) + +def add_lldbsuite_packages_dir(lldb_root): +packages_dir = os.path.join(lldb_root, "packages", "Python") +sys.path.insert(0, packages_dir) + lldb_root = os.path.dirname(inspect.getfile(inspect.currentframe())) + add_third_party_module_dirs(lldb_root) +add_lldbsuite_packages_dir(lldb_root) Index: test/use_lldb_suite.py === --- test/use_lldb_suite.py +++ test/use_lldb_suite.py @@ -19,4 +19,4 @@ import imp module = imp.find_module("use_lldb_suite_root", [lldb_root]) if module is not None: -imp.load_module("use_lldb_suite_root", *module) \ No newline at end of file +imp.load_module("use_lldb_suite_root", *module) Index: test/dotest.py === --- test/dotest.py +++ test/dotest.py @@ -1048,6 +1048,8 @@ # Set up the LLDB_SRC environment variable, so that the tests can locate # the LLDB source code. +# When this changes over to a package instead of a standalone script, this +# will be `lldbsuite.lldb_root` os.environ["LLDB_SRC"] = os.path.join(scriptPath, os.pardir) pluginPath = os.path.join(scriptPath, 'plugins') @@ -1063,6 +1065,8 @@ # to "import lldbgdbserverutils" from the lldb-server tests # This is the root of the lldb git/svn checkout +# When this changes over to a package instead of a standalone script, this +# will be `lldbsuite.lldb_root` lldbRootDirectory = os.path.abspath(os.path.join(scriptPath, os.pardir)) # Some of the tests can invoke the 'lldb' command directly. @@ -1294,6 +1298,7 @@ def disabledynamics(): +import lldb ci = lldb.DBG.GetCommandInterpreter() res = lldb.SBCommandReturnObject() ci.HandleCommand("setting set target.prefer-dynamic-value no-dynamic-values", res, False) @@ -1301,6 +1306,7 @@ raise Exception('disabling dynamic type support failed') def lldbLoggings(): +import lldb """Check and do lldb loggings if necessary.""" # Turn on logging for debugging purposes if ${LLDB_LOG} environment variable is @@ -1366,6 +1372,7 @@ sys.exit(0) def exitTestSuite(exitCode = None): +import lldb lldb.SBDebugger.Terminate() if exitCode: sys.exit(exitCode) @@ -1378,7 +1385,58 @@ # test runner return not (is_inferior_test_runner or no_multiprocess_test_runner) -if __name__ == "__main__": +def run_suite(): +global just_do_benchmarks_test +global dont_do_dsym_test +global dont_do_dwarf_test +global dont_do_dwo_test +global blacklist +global blacklistConfig +global categoriesList +global validCategories +global useCategories +global skipCategories +global lldbFrameworkPath +global configFile +global archs +global compilers +global count +global dumpSysPath +global bmExecutable +global bmBreakpointSpec +global bmIterationCount +global failed +global failfast +global filters +global fs4all +global ignore +global progress_bar +global runHooks +global skip_build_and_cleanup +global skip_long_running_test +global noHeaders +global parsable +global regexp +global rdir +global sdir_name +global svn_silent +global verbose +global testdirs +global lldb_platform_name +global lldb_platform_url +global lldb_platform_working_dir +global setCrashInfoHook +global is_inferior_test_runner +global multiprocess_test_subdir +global num_threads +global output_on_success +global no_multiprocess_test_runner +global test_runner_name +global results_filename +global results_formatter_name +global results_formatter_options +global results_port + # On MacOS X, check to make sure that domain for com.apple.DebugSymbols defaults # does not exist before proceeding to running the test suite. if sys.platform.startswith("darwin"): @@ -1976,3 +2034,6 @@ # Exiting. exitTestSuite(failed) + +if __name_
Re: [Lldb-commits] [PATCH] D14131: Preparation for making a Python package out of lldb's Python code
zturner updated this revision to Diff 38595. zturner added a comment. Moved `progress.py` from `lldb/test` to `lldb/third_party`. This seems to be a third party module that had also snuck into the test folder. It's used by both `unittest2` and `dosep.py` so it has to be in `third_party` to be usable from both. http://reviews.llvm.org/D14131 Files: packages/Python/lldbsuite/__init__.py packages/Python/lldbsuite/test/__init__.py test/dosep.py test/dotest.py test/progress.py test/use_lldb_suite.py third_party/Python/module/progress/progress.py use_lldb_suite_root.py Index: use_lldb_suite_root.py === --- use_lldb_suite_root.py +++ use_lldb_suite_root.py @@ -11,5 +11,12 @@ for module_dir in module_dirs: module_dir = os.path.join(third_party_modules_dir, module_dir) sys.path.insert(0, module_dir) + +def add_lldbsuite_packages_dir(lldb_root): +packages_dir = os.path.join(lldb_root, "packages", "Python") +sys.path.insert(0, packages_dir) + lldb_root = os.path.dirname(inspect.getfile(inspect.currentframe())) + add_third_party_module_dirs(lldb_root) +add_lldbsuite_packages_dir(lldb_root) Index: third_party/Python/module/progress/progress.py === --- /dev/null +++ third_party/Python/module/progress/progress.py @@ -0,0 +1,154 @@ +#!/usr/bin/python + +from __future__ import print_function + +import use_lldb_suite +import six + +import sys +import time + +class ProgressBar(object): +"""ProgressBar class holds the options of the progress bar. +The options are: +start State from which start the progress. For example, if start is +5 and the end is 10, the progress of this state is 50% +end State in which the progress has terminated. +width -- +fillString to use for "filled" used to represent the progress +blank String to use for "filled" used to represent remaining space. +format Format +incremental +""" +light_block = six.unichr(0x2591).encode("utf-8") +solid_block = six.unichr(0x2588).encode("utf-8") +solid_right_arrow = six.unichr(0x25BA).encode("utf-8") + +def __init__(self, + start=0, + end=10, + width=12, + fill=six.unichr(0x25C9).encode("utf-8"), + blank=six.unichr(0x25CC).encode("utf-8"), + marker=six.unichr(0x25CE).encode("utf-8"), + format='[%(fill)s%(marker)s%(blank)s] %(progress)s%%', + incremental=True): +super(ProgressBar, self).__init__() + +self.start = start +self.end = end +self.width = width +self.fill = fill +self.blank = blank +self.marker = marker +self.format = format +self.incremental = incremental +self.step = 100 / float(width) #fix +self.reset() + +def __add__(self, increment): +increment = self._get_progress(increment) +if 100 > self.progress + increment: +self.progress += increment +else: +self.progress = 100 +return self + +def complete(self): +self.progress = 100 +return self + +def __str__(self): +progressed = int(self.progress / self.step) #fix +fill = progressed * self.fill +blank = (self.width - progressed) * self.blank +return self.format % {'fill': fill, 'blank': blank, 'marker': self.marker, 'progress': int(self.progress)} + +__repr__ = __str__ + +def _get_progress(self, increment): +return float(increment * 100) / self.end + +def reset(self): +"""Resets the current progress to the start point""" +self.progress = self._get_progress(self.start) +return self + + +class AnimatedProgressBar(ProgressBar): +"""Extends ProgressBar to allow you to use it straighforward on a script. +Accepts an extra keyword argument named `stdout` (by default use sys.stdout) +and may be any file-object to which send the progress status. +""" +def __init__(self, + start=0, + end=10, + width=12, + fill=six.unichr(0x25C9).encode("utf-8"), + blank=six.unichr(0x25CC).encode("utf-8"), + marker=six.unichr(0x25CE).encode("utf-8"), + format='[%(fill)s%(marker)s%(blank)s] %(progress)s%%', + incremental=True, + stdout=sys.stdout): +super(AnimatedProgressBar, self).__init__(start,end,width,fill,blank,marker,format,incremental) +self.stdout = stdout + +def show_progress(self): +if hasattr(self.stdout, 'isatty') and self.stdout.isatty(): +self.stdout.write('\r') +else: +self.stdout.write('\n') +self.stdout.write
[Lldb-commits] [lldb] r251457 - Fix editline unindentation code for more recent libedits.
Author: tfiala Date: Tue Oct 27 16:53:39 2015 New Revision: 251457 URL: http://llvm.org/viewvc/llvm-project?rev=251457&view=rev Log: Fix editline unindentation code for more recent libedits. This code was modifying the cursor and then expecting the editline API call to see the effect for the next operation. This is misusing the API. Newer editlines break on this code, fixed by this. Modified: lldb/trunk/source/Host/common/Editline.cpp Modified: lldb/trunk/source/Host/common/Editline.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Editline.cpp?rev=251457&r1=251456&r2=251457&view=diff == --- lldb/trunk/source/Host/common/Editline.cpp (original) +++ lldb/trunk/source/Host/common/Editline.cpp Tue Oct 27 16:53:39 2015 @@ -886,8 +886,11 @@ Editline::FixIndentationCommand (int ch) } else if (indent_correction < 0) { -info->cursor = info->buffer - indent_correction; -el_wdeletestr (m_editline, -indent_correction); +// Delete characters for the unindentation AND including the character we just added. +el_wdeletestr (m_editline, -indent_correction + 1); + +// Rewrite the character that caused the unindentation. +el_winsertstr (m_editline, inserted); } info->cursor = info->buffer + cursor_position + indent_correction; return CC_REFRESH; ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D14131: Preparation for making a Python package out of lldb's Python code
zturner updated this revision to Diff 38600. zturner added a comment. Fixed `lldbsuite` module initialization. I'm having to do this all by eye / memory since this code isn't actually exercised yet until the move actually happens. http://reviews.llvm.org/D14131 Files: packages/Python/lldbsuite/__init__.py packages/Python/lldbsuite/test/__init__.py test/dosep.py test/dotest.py test/progress.py test/use_lldb_suite.py third_party/Python/module/progress/progress.py use_lldb_suite_root.py Index: use_lldb_suite_root.py === --- use_lldb_suite_root.py +++ use_lldb_suite_root.py @@ -11,5 +11,12 @@ for module_dir in module_dirs: module_dir = os.path.join(third_party_modules_dir, module_dir) sys.path.insert(0, module_dir) + +def add_lldbsuite_packages_dir(lldb_root): +packages_dir = os.path.join(lldb_root, "packages", "Python") +sys.path.insert(0, packages_dir) + lldb_root = os.path.dirname(inspect.getfile(inspect.currentframe())) + add_third_party_module_dirs(lldb_root) +add_lldbsuite_packages_dir(lldb_root) Index: third_party/Python/module/progress/progress.py === --- /dev/null +++ third_party/Python/module/progress/progress.py @@ -0,0 +1,154 @@ +#!/usr/bin/python + +from __future__ import print_function + +import use_lldb_suite +import six + +import sys +import time + +class ProgressBar(object): +"""ProgressBar class holds the options of the progress bar. +The options are: +start State from which start the progress. For example, if start is +5 and the end is 10, the progress of this state is 50% +end State in which the progress has terminated. +width -- +fillString to use for "filled" used to represent the progress +blank String to use for "filled" used to represent remaining space. +format Format +incremental +""" +light_block = six.unichr(0x2591).encode("utf-8") +solid_block = six.unichr(0x2588).encode("utf-8") +solid_right_arrow = six.unichr(0x25BA).encode("utf-8") + +def __init__(self, + start=0, + end=10, + width=12, + fill=six.unichr(0x25C9).encode("utf-8"), + blank=six.unichr(0x25CC).encode("utf-8"), + marker=six.unichr(0x25CE).encode("utf-8"), + format='[%(fill)s%(marker)s%(blank)s] %(progress)s%%', + incremental=True): +super(ProgressBar, self).__init__() + +self.start = start +self.end = end +self.width = width +self.fill = fill +self.blank = blank +self.marker = marker +self.format = format +self.incremental = incremental +self.step = 100 / float(width) #fix +self.reset() + +def __add__(self, increment): +increment = self._get_progress(increment) +if 100 > self.progress + increment: +self.progress += increment +else: +self.progress = 100 +return self + +def complete(self): +self.progress = 100 +return self + +def __str__(self): +progressed = int(self.progress / self.step) #fix +fill = progressed * self.fill +blank = (self.width - progressed) * self.blank +return self.format % {'fill': fill, 'blank': blank, 'marker': self.marker, 'progress': int(self.progress)} + +__repr__ = __str__ + +def _get_progress(self, increment): +return float(increment * 100) / self.end + +def reset(self): +"""Resets the current progress to the start point""" +self.progress = self._get_progress(self.start) +return self + + +class AnimatedProgressBar(ProgressBar): +"""Extends ProgressBar to allow you to use it straighforward on a script. +Accepts an extra keyword argument named `stdout` (by default use sys.stdout) +and may be any file-object to which send the progress status. +""" +def __init__(self, + start=0, + end=10, + width=12, + fill=six.unichr(0x25C9).encode("utf-8"), + blank=six.unichr(0x25CC).encode("utf-8"), + marker=six.unichr(0x25CE).encode("utf-8"), + format='[%(fill)s%(marker)s%(blank)s] %(progress)s%%', + incremental=True, + stdout=sys.stdout): +super(AnimatedProgressBar, self).__init__(start,end,width,fill,blank,marker,format,incremental) +self.stdout = stdout + +def show_progress(self): +if hasattr(self.stdout, 'isatty') and self.stdout.isatty(): +self.stdout.write('\r') +else: +self.stdout.write('\n') +self.stdout.write(str(self)) +self.stdout.flush() + +class ProgressWithEvents(AnimatedProgre
Re: [Lldb-commits] [PATCH] D14131: Preparation for making a Python package out of lldb's Python code
tfiala accepted this revision. tfiala added a comment. This revision is now accepted and ready to land. LGTM. http://reviews.llvm.org/D14131 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] LLVM buildmaster will be restarted tonight
Hello everyone, LLVM buildmaster will be restarted after 7 PM Pacific time today. Thanks Galina ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r251460 - Preparation for turning lldbsuite into a Python package.
Author: zturner Date: Tue Oct 27 17:33:47 2015 New Revision: 251460 URL: http://llvm.org/viewvc/llvm-project?rev=251460&view=rev Log: Preparation for turning lldbsuite into a Python package. The idea behind this patch is to expose the meat of LLDB's Python infrastructure (test suite, scripts, etc) as a single package. This makes reusability and code sharing among sub-packages easy. Differential Revision: http://reviews.llvm.org/D14131 Added: lldb/trunk/packages/ lldb/trunk/packages/Python/ lldb/trunk/packages/Python/lldbsuite/ lldb/trunk/packages/Python/lldbsuite/__init__.py - copied, changed from r251457, lldb/trunk/test/use_lldb_suite.py lldb/trunk/packages/Python/lldbsuite/test/ lldb/trunk/packages/Python/lldbsuite/test/__init__.py lldb/trunk/third_party/Python/module/progress/ lldb/trunk/third_party/Python/module/progress/progress.py (contents, props changed) - copied, changed from r251457, lldb/trunk/test/progress.py Removed: lldb/trunk/test/progress.py Modified: lldb/trunk/test/dosep.py lldb/trunk/test/dotest.py lldb/trunk/test/use_lldb_suite.py lldb/trunk/use_lldb_suite_root.py Copied: lldb/trunk/packages/Python/lldbsuite/__init__.py (from r251457, lldb/trunk/test/use_lldb_suite.py) URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/__init__.py?p2=lldb/trunk/packages/Python/lldbsuite/__init__.py&p1=lldb/trunk/test/use_lldb_suite.py&r1=251457&r2=251460&rev=251460&view=diff == --- lldb/trunk/test/use_lldb_suite.py (original) +++ lldb/trunk/packages/Python/lldbsuite/__init__.py Tue Oct 27 17:33:47 2015 @@ -1,22 +1,20 @@ -import inspect -import os -import sys - -def find_lldb_root(): -lldb_root = os.path.dirname(inspect.getfile(inspect.currentframe())) -while True: -lldb_root = os.path.dirname(lldb_root) -if lldb_root is None: -return None - -test_path = os.path.join(lldb_root, "lldb.root") -if os.path.isfile(test_path): -return lldb_root -return None - -lldb_root = find_lldb_root() -if lldb_root is not None: -import imp -module = imp.find_module("use_lldb_suite_root", [lldb_root]) -if module is not None: -imp.load_module("use_lldb_suite_root", *module) \ No newline at end of file +# Module level initialization for the `lldbsuite` module. + +import inspect +import os +import sys + +def find_lldb_root(): +lldb_root = os.path.dirname(inspect.getfile(inspect.currentframe())) +while True: +lldb_root = os.path.dirname(lldb_root) +if lldb_root is None: +return None + +test_path = os.path.join(lldb_root, "lldb.root") +if os.path.isfile(test_path): +return lldb_root +return None + +# lldbsuite.lldb_root refers to the root of the git/svn source checkout +lldb_root = find_lldb_root() Added: lldb/trunk/packages/Python/lldbsuite/test/__init__.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/__init__.py?rev=251460&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/__init__.py (added) +++ lldb/trunk/packages/Python/lldbsuite/test/__init__.py Tue Oct 27 17:33:47 2015 @@ -0,0 +1 @@ +# Module level initialization for the `lldbsuite.test` module. Modified: lldb/trunk/test/dosep.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/dosep.py?rev=251460&r1=251459&r2=251460&view=diff == --- lldb/trunk/test/dosep.py (original) +++ lldb/trunk/test/dosep.py Tue Oct 27 17:33:47 2015 @@ -1205,7 +1205,7 @@ def adjust_inferior_options(dotest_argv) # every dotest invocation from creating its own directory import datetime # The windows platforms don't like ':' in the pathname. -timestamp_started = datetime.datetime.now().strftime("%F-%H_%M_%S") +timestamp_started = datetime.datetime.now().strftime("%Y-%m-%d-%H_%M_%S") dotest_argv.append('-s') dotest_argv.append(timestamp_started) dotest_options.s = timestamp_started Modified: lldb/trunk/test/dotest.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/dotest.py?rev=251460&r1=251459&r2=251460&view=diff == --- lldb/trunk/test/dotest.py (original) +++ lldb/trunk/test/dotest.py Tue Oct 27 17:33:47 2015 @@ -1048,6 +1048,8 @@ def setupSysPath(): # Set up the LLDB_SRC environment variable, so that the tests can locate # the LLDB source code. +# When this changes over to a package instead of a standalone script, this +# will be `lldbsuite.lldb_root` os.environ["LLDB_SRC"] = os.path.join(scriptPath, os.pardir) pluginPath = os.path.join(scriptPath, 'plugins') @@ -1063,6 +1065,8
Re: [Lldb-commits] [PATCH] D14131: Preparation for making a Python package out of lldb's Python code
This revision was automatically updated to reflect the committed changes. Closed by commit rL251460: Preparation for turning lldbsuite into a Python package. (authored by zturner). Changed prior to commit: http://reviews.llvm.org/D14131?vs=38600&id=38606#toc Repository: rL LLVM http://reviews.llvm.org/D14131 Files: lldb/trunk/packages/Python/lldbsuite/__init__.py lldb/trunk/packages/Python/lldbsuite/test/__init__.py lldb/trunk/test/dosep.py lldb/trunk/test/dotest.py lldb/trunk/test/progress.py lldb/trunk/test/use_lldb_suite.py lldb/trunk/third_party/Python/module/progress/progress.py lldb/trunk/use_lldb_suite_root.py Index: lldb/trunk/test/use_lldb_suite.py === --- lldb/trunk/test/use_lldb_suite.py +++ lldb/trunk/test/use_lldb_suite.py @@ -19,4 +19,4 @@ import imp module = imp.find_module("use_lldb_suite_root", [lldb_root]) if module is not None: -imp.load_module("use_lldb_suite_root", *module) \ No newline at end of file +imp.load_module("use_lldb_suite_root", *module) Index: lldb/trunk/test/dosep.py === --- lldb/trunk/test/dosep.py +++ lldb/trunk/test/dosep.py @@ -1205,7 +1205,7 @@ # every dotest invocation from creating its own directory import datetime # The windows platforms don't like ':' in the pathname. -timestamp_started = datetime.datetime.now().strftime("%F-%H_%M_%S") +timestamp_started = datetime.datetime.now().strftime("%Y-%m-%d-%H_%M_%S") dotest_argv.append('-s') dotest_argv.append(timestamp_started) dotest_options.s = timestamp_started Index: lldb/trunk/test/dotest.py === --- lldb/trunk/test/dotest.py +++ lldb/trunk/test/dotest.py @@ -1048,6 +1048,8 @@ # Set up the LLDB_SRC environment variable, so that the tests can locate # the LLDB source code. +# When this changes over to a package instead of a standalone script, this +# will be `lldbsuite.lldb_root` os.environ["LLDB_SRC"] = os.path.join(scriptPath, os.pardir) pluginPath = os.path.join(scriptPath, 'plugins') @@ -1063,6 +1065,8 @@ # to "import lldbgdbserverutils" from the lldb-server tests # This is the root of the lldb git/svn checkout +# When this changes over to a package instead of a standalone script, this +# will be `lldbsuite.lldb_root` lldbRootDirectory = os.path.abspath(os.path.join(scriptPath, os.pardir)) # Some of the tests can invoke the 'lldb' command directly. @@ -1294,13 +1298,15 @@ def disabledynamics(): +import lldb ci = lldb.DBG.GetCommandInterpreter() res = lldb.SBCommandReturnObject() ci.HandleCommand("setting set target.prefer-dynamic-value no-dynamic-values", res, False) if not res.Succeeded(): raise Exception('disabling dynamic type support failed') def lldbLoggings(): +import lldb """Check and do lldb loggings if necessary.""" # Turn on logging for debugging purposes if ${LLDB_LOG} environment variable is @@ -1366,6 +1372,7 @@ sys.exit(0) def exitTestSuite(exitCode = None): +import lldb lldb.SBDebugger.Terminate() if exitCode: sys.exit(exitCode) @@ -1378,7 +1385,58 @@ # test runner return not (is_inferior_test_runner or no_multiprocess_test_runner) -if __name__ == "__main__": +def run_suite(): +global just_do_benchmarks_test +global dont_do_dsym_test +global dont_do_dwarf_test +global dont_do_dwo_test +global blacklist +global blacklistConfig +global categoriesList +global validCategories +global useCategories +global skipCategories +global lldbFrameworkPath +global configFile +global archs +global compilers +global count +global dumpSysPath +global bmExecutable +global bmBreakpointSpec +global bmIterationCount +global failed +global failfast +global filters +global fs4all +global ignore +global progress_bar +global runHooks +global skip_build_and_cleanup +global skip_long_running_test +global noHeaders +global parsable +global regexp +global rdir +global sdir_name +global svn_silent +global verbose +global testdirs +global lldb_platform_name +global lldb_platform_url +global lldb_platform_working_dir +global setCrashInfoHook +global is_inferior_test_runner +global multiprocess_test_subdir +global num_threads +global output_on_success +global no_multiprocess_test_runner +global test_runner_name +global results_filename +global results_formatter_name +global results_formatter_options +global results_port + # On MacOS X, check to make sure that domain for com.apple.DebugSymbols defaults #
[Lldb-commits] [lldb] r251462 - Fix line endings to be LF instead of CRLF.
Author: zturner Date: Tue Oct 27 17:54:46 2015 New Revision: 251462 URL: http://llvm.org/viewvc/llvm-project?rev=251462&view=rev Log: Fix line endings to be LF instead of CRLF. Modified: lldb/trunk/packages/Python/lldbsuite/__init__.py lldb/trunk/packages/Python/lldbsuite/test/__init__.py Modified: lldb/trunk/packages/Python/lldbsuite/__init__.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/__init__.py?rev=251462&r1=251461&r2=251462&view=diff == --- lldb/trunk/packages/Python/lldbsuite/__init__.py (original) +++ lldb/trunk/packages/Python/lldbsuite/__init__.py Tue Oct 27 17:54:46 2015 @@ -1,20 +1,20 @@ -# Module level initialization for the `lldbsuite` module. - -import inspect -import os -import sys - -def find_lldb_root(): -lldb_root = os.path.dirname(inspect.getfile(inspect.currentframe())) -while True: -lldb_root = os.path.dirname(lldb_root) -if lldb_root is None: -return None - -test_path = os.path.join(lldb_root, "lldb.root") -if os.path.isfile(test_path): -return lldb_root -return None - -# lldbsuite.lldb_root refers to the root of the git/svn source checkout -lldb_root = find_lldb_root() +# Module level initialization for the `lldbsuite` module. + +import inspect +import os +import sys + +def find_lldb_root(): +lldb_root = os.path.dirname(inspect.getfile(inspect.currentframe())) +while True: +lldb_root = os.path.dirname(lldb_root) +if lldb_root is None: +return None + +test_path = os.path.join(lldb_root, "lldb.root") +if os.path.isfile(test_path): +return lldb_root +return None + +# lldbsuite.lldb_root refers to the root of the git/svn source checkout +lldb_root = find_lldb_root() Modified: lldb/trunk/packages/Python/lldbsuite/test/__init__.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/__init__.py?rev=251462&r1=251461&r2=251462&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/__init__.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/__init__.py Tue Oct 27 17:54:46 2015 @@ -1 +1 @@ -# Module level initialization for the `lldbsuite.test` module. +# Module level initialization for the `lldbsuite.test` module. ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r251470 - Fix Clang-tidy modernize-use-nullptr warnings in some files in include/lldb/Core; other minor fixes.
Author: eugenezelenko Date: Tue Oct 27 19:18:41 2015 New Revision: 251470 URL: http://llvm.org/viewvc/llvm-project?rev=251470&view=rev Log: Fix Clang-tidy modernize-use-nullptr warnings in some files in include/lldb/Core; other minor fixes. Modified: lldb/trunk/include/lldb/Core/Address.h lldb/trunk/include/lldb/Core/AddressRange.h lldb/trunk/include/lldb/Core/Broadcaster.h lldb/trunk/include/lldb/Core/Communication.h lldb/trunk/include/lldb/Core/ConstString.h lldb/trunk/include/lldb/Core/DataExtractor.h lldb/trunk/include/lldb/Core/Debugger.h lldb/trunk/include/lldb/Core/Event.h lldb/trunk/include/lldb/Core/FormatEntity.h lldb/trunk/include/lldb/Core/IOHandler.h lldb/trunk/include/lldb/Core/Listener.h lldb/trunk/include/lldb/Core/MappedHash.h lldb/trunk/include/lldb/Core/Module.h lldb/trunk/include/lldb/Core/ModuleList.h Modified: lldb/trunk/include/lldb/Core/Address.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Address.h?rev=251470&r1=251469&r2=251470&view=diff == --- lldb/trunk/include/lldb/Core/Address.h (original) +++ lldb/trunk/include/lldb/Core/Address.h Tue Oct 27 19:18:41 2015 @@ -13,6 +13,7 @@ // C Includes // C++ Includes #include + // Other libraries and framework includes // Project includes #include "lldb/lldb-private.h" @@ -108,7 +109,6 @@ public: { } - //-- /// Copy constructor /// @@ -176,6 +176,7 @@ public: const Address& operator= (const Address& rhs); #endif + //-- /// Clear the object's state. /// @@ -216,7 +217,7 @@ public: class ModulePointerAndOffsetLessThanFunctionObject { public: -ModulePointerAndOffsetLessThanFunctionObject () {} +ModulePointerAndOffsetLessThanFunctionObject() = default; bool operator() (const Address& a, const Address& b) const @@ -355,7 +356,7 @@ public: bool IsSectionOffset() const { -return IsValid() && (GetSection().get() != NULL); +return IsValid() && (GetSection().get() != nullptr); } //-- @@ -375,7 +376,6 @@ public: return m_offset != LLDB_INVALID_ADDRESS; } - //-- /// Get the memory cost of this object. /// @@ -508,6 +508,7 @@ public: { m_section_wp.reset(); } + //-- /// Reconstruct a symbol context from an address. /// @@ -567,10 +568,8 @@ protected: //-- bool SectionWasDeletedPrivate() const; - }; - //-- // NOTE: Be careful using this operator. It can correctly compare two // addresses from the same Module correctly. It can't compare two @@ -587,12 +586,9 @@ protected: //-- bool operator< (const Address& lhs, const Address& rhs); bool operator> (const Address& lhs, const Address& rhs); - - - bool operator== (const Address& lhs, const Address& rhs); bool operator!= (const Address& lhs, const Address& rhs); } // namespace lldb_private -#endif // liblldb_Address_h_ +#endif // liblldb_Address_h_ Modified: lldb/trunk/include/lldb/Core/AddressRange.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/AddressRange.h?rev=251470&r1=251469&r2=251470&view=diff == --- lldb/trunk/include/lldb/Core/AddressRange.h (original) +++ lldb/trunk/include/lldb/Core/AddressRange.h Tue Oct 27 19:18:41 2015 @@ -10,6 +10,10 @@ #ifndef liblldb_AddressRange_h_ #define liblldb_AddressRange_h_ +// C Includes +// C++ Includes +// Other libraries and framework includes +// Project includes #include "lldb/Core/Address.h" namespace lldb_private { @@ -62,7 +66,7 @@ public: /// @param[in] section_list /// A list of sections, one of which may contain the \a vaddr. //-- -AddressRange (lldb::addr_t file_addr, lldb::addr_t byte_size, const SectionList *section_list = NULL); +AddressRange(lldb::addr_t file_addr, lldb::addr_t byte_size, const SectionList *section_list = nullptr); //-- /// Construct with a Address object address and byte size. @@ -281,4 +285,4 @@ protected: } // namespace lldb_private -#endif // liblldb_AddressRange_h_ +#endif // liblldb_AddressRange_h_ Modified: lldb/trunk/include/l
Re: [Lldb-commits] [PATCH] D14037: Reuse native curses(8) library on NetBSD
akat1 added a subscriber: akat1. akat1 added a comment. I've compiled it successfully on: Distributor ID: Ubuntu Description:Ubuntu 14.04.3 LTS Release:14.04 Codename: trusty Linux AAH 3.13.0-46-generic #75-Ubuntu SMP Tue Feb 10 15:24:04 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux Repository: rL LLVM http://reviews.llvm.org/D14037 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D14042: Add more NetBSD platform glue for lldb
akat1 added a subscriber: akat1. akat1 added a comment. I've compiled it successfully on: Distributor ID: Ubuntu Description:Ubuntu 14.04.3 LTS Release:14.04 Codename: trusty Linux AAH 3.13.0-46-generic #75-Ubuntu SMP Tue Feb 10 15:24:04 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux Repository: rL LLVM http://reviews.llvm.org/D14042 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits