[Lldb-commits] [lldb] r285858 - Fix typo which broke debugging on older OSX systems after r285172.
Author: dperchik Date: Wed Nov 2 15:57:34 2016 New Revision: 285858 URL: http://llvm.org/viewvc/llvm-project?rev=285858=rev Log: Fix typo which broke debugging on older OSX systems after r285172. Reviewed by: jasonmolenda Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D26260 Modified: lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp Modified: lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp?rev=285858=285857=285858=diff == --- lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp (original) +++ lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp Wed Nov 2 15:57:34 2016 @@ -1137,7 +1137,7 @@ bool DynamicLoaderDarwin::UseDYLDSPI(Pro // macOS 10.12 and newer if (os_type == llvm::Triple::MacOSX && -(major >= 10 || (major == 10 && minor >= 12))) { +(major > 10 || (major == 10 && minor >= 12))) { use_new_spi_interface = true; } ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D26260: Fix typo which broke debugging on older OSX systems after r285172.
dawn created this revision. dawn added a reviewer: jasonmolenda. dawn added a subscriber: lldb-commits. dawn set the repository for this revision to rL LLVM. Clearly ">=" was meant to be ">". :) Repository: rL LLVM https://reviews.llvm.org/D26260 Files: source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp Index: source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp === --- source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp +++ source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp @@ -1137,7 +1137,7 @@ // macOS 10.12 and newer if (os_type == llvm::Triple::MacOSX && -(major >= 10 || (major == 10 && minor >= 12))) { +(major > 10 || (major == 10 && minor >= 12))) { use_new_spi_interface = true; } Index: source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp === --- source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp +++ source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp @@ -1137,7 +1137,7 @@ // macOS 10.12 and newer if (os_type == llvm::Triple::MacOSX && -(major >= 10 || (major == 10 && minor >= 12))) { +(major > 10 || (major == 10 && minor >= 12))) { use_new_spi_interface = true; } ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r283031 - [lldb-mi] Fix prompt which can get inserted in the middle of program output in lldb-mi
Author: dperchik Date: Sat Oct 1 05:37:56 2016 New Revision: 283031 URL: http://llvm.org/viewvc/llvm-project?rev=283031=rev Log: [lldb-mi] Fix prompt which can get inserted in the middle of program output in lldb-mi Summary: The code added in svn r264332 causes "(lldb) " to be printed in the middle of program console output. This fix restores the behavior for non-Windows platforms to before the patch. Reviewers: ted, zturner, clayborg Subscribers: amccarth, lldb-commits Differential Revision: http://reviews.llvm.org/D25137 Modified: lldb/trunk/source/Core/IOHandler.cpp Modified: lldb/trunk/source/Core/IOHandler.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/IOHandler.cpp?rev=283031=283030=283031=diff == --- lldb/trunk/source/Core/IOHandler.cpp (original) +++ lldb/trunk/source/Core/IOHandler.cpp Sat Oct 1 05:37:56 2016 @@ -590,8 +590,8 @@ void IOHandlerEditline::PrintAsync(Strea else #endif { -const char *prompt = GetPrompt(); #ifdef _MSC_VER +const char *prompt = GetPrompt(); if (prompt) { // Back up over previous prompt using Windows API CONSOLE_SCREEN_BUFFER_INFO screen_buffer_info; @@ -605,9 +605,11 @@ void IOHandlerEditline::PrintAsync(Strea } #endif IOHandler::PrintAsync(stream, s, len); +#ifdef _MSC_VER if (prompt) IOHandler::PrintAsync(GetOutputStreamFile().get(), prompt, strlen(prompt)); +#endif } } ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D25137: [lldbmi] Fix prompt which can get inserted in the middle of lldb-mi output
dawn created this revision. dawn added reviewers: ted, zturner, clayborg. dawn added subscribers: amccarth, lldb-commits. dawn set the repository for this revision to rL LLVM. The code added in svn trunk 264332 causes "(lldb)" to be printed in the middle of program console output. This fix restores the behavior for non-Windows platforms to before the patch. From a C++ program with the following source: ... printf("\n#Break: Function parameters - arrays"); printf("\n#Evaluate:A[0]-C[0] + (A[1]-C[1])*1000 #ExpectedEval:%d", 1001); printf("\n#Evaluate:FuncArr(C,B) #ExpectedEval:%d", RES); printf("\n#Evaluate:A[0]-C[0] + (A[1]-C[1])*1000 + 0 #ExpectedEval:%d", 0); printf("\n#Evaluate:ref[0] + ref[1]*10 #ExpectedEval:%d", 65); printf("\n#Evaluate:FuncArrRet(7,8) #ExpectedLike:deferred"); ... produce the following output on iOS: #Break: Function parameters - arrays #Evaluate:A[0]-C[0] + (A[1]-C[1])*1000 #ExpectedEval:1001 #Evaluate:FuncArr(C,B) #ExpectedEval:4321 #Evaluate:A[0]-C[0] + (A[1]-C[1])*1000 + 0 #ExpectedEval:0 #Evaluate:ref[0] + ref[1]*10 #ExpectedEval:65 #Evalua(lldb) te:FuncArrRet(7,8) #ExpectedLike:deferred ... Note the "(lldb) " inserted into the program output of the 6th print statement. Repository: rL LLVM https://reviews.llvm.org/D25137 Files: source/Core/IOHandler.cpp Index: source/Core/IOHandler.cpp === --- source/Core/IOHandler.cpp +++ source/Core/IOHandler.cpp @@ -590,8 +590,8 @@ else #endif { +#ifdef _MSC_VER const char *prompt = GetPrompt(); -#ifdef _MSC_VER if (prompt) { // Back up over previous prompt using Windows API CONSOLE_SCREEN_BUFFER_INFO screen_buffer_info; @@ -605,9 +605,11 @@ } #endif IOHandler::PrintAsync(stream, s, len); +#ifdef _MSC_VER if (prompt) IOHandler::PrintAsync(GetOutputStreamFile().get(), prompt, strlen(prompt)); +#endif } } Index: source/Core/IOHandler.cpp === --- source/Core/IOHandler.cpp +++ source/Core/IOHandler.cpp @@ -590,8 +590,8 @@ else #endif { +#ifdef _MSC_VER const char *prompt = GetPrompt(); -#ifdef _MSC_VER if (prompt) { // Back up over previous prompt using Windows API CONSOLE_SCREEN_BUFFER_INFO screen_buffer_info; @@ -605,9 +605,11 @@ } #endif IOHandler::PrintAsync(stream, s, len); +#ifdef _MSC_VER if (prompt) IOHandler::PrintAsync(GetOutputStreamFile().get(), prompt, strlen(prompt)); +#endif } } ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r282941 - Fix comment - Module::PrepareForFunctionNameLookup should be Module::LookupInfo::LookupInfo.
Author: dperchik Date: Fri Sep 30 15:38:33 2016 New Revision: 282941 URL: http://llvm.org/viewvc/llvm-project?rev=282941=rev Log: Fix comment - Module::PrepareForFunctionNameLookup should be Module::LookupInfo::LookupInfo. Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp lldb/trunk/source/Symbol/Symtab.cpp Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=282941=282940=282941=diff == --- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original) +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Fri Sep 30 15:38:33 2016 @@ -2395,7 +2395,7 @@ SymbolFileDWARF::FindFunctions(const Con name.AsCString()); // eFunctionNameTypeAuto should be pre-resolved by a call to - // Module::PrepareForFunctionNameLookup() + // Module::LookupInfo::LookupInfo() assert((name_type_mask & eFunctionNameTypeAuto) == 0); Log *log(LogChannelDWARF::GetLogIfAll(DWARF_LOG_LOOKUPS)); Modified: lldb/trunk/source/Symbol/Symtab.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Symtab.cpp?rev=282941=282940=282941=diff == --- lldb/trunk/source/Symbol/Symtab.cpp (original) +++ lldb/trunk/source/Symbol/Symtab.cpp Fri Sep 30 15:38:33 2016 @@ -1069,7 +1069,7 @@ size_t Symtab::FindFunctionSymbols(const const char *name_cstr = name.GetCString(); // eFunctionNameTypeAuto should be pre-resolved by a call to - // Module::PrepareForFunctionNameLookup() + // Module::LookupInfo::LookupInfo() assert((name_type_mask & eFunctionNameTypeAuto) == 0); if (name_type_mask & (eFunctionNameTypeBase | eFunctionNameTypeFull)) { ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D17274: improve readability and performance of ClangExpressionParser::FindFunctionInModule
dawn accepted this revision. dawn added a comment. This revision is now accepted and ready to land. lgtm other than nitpick on formatting. And sorry for delayed review - been sick. Comment at: source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp:559-560 @@ -558,5 +558,4 @@ -static bool FindFunctionInModule (ConstString _name, - llvm::Module *module, - const char *orig_name) +static bool +FindFunctionInModule(ConstString _name, llvm::Module *module, const char *orig_name) { ldrumm wrote: > jingham wrote: > > Don't make this kind of change, please. As long as the arguments fit in > > 120 characters we don't have a rule one way or the other about how to write > > argument lists like this. But changing them just because they look better > > to you results in unnecessary churn. Moreover, this is changing it away > > from the way all the other functions in this source file are written, so it > > ends up looking odd. > This change is made by clang-fomat using the rules in the lldb .clang-format > file. > > I'm willing to revert this part of the commit, but seeing as this change is > essentially a refactoring of the whole method, it feels natural to also > format the prototype while I’m at it. Please just keep the space before the params and the return type on a separate line. Sadly, we can't use clang-format for function decls/defs in lldb because it doesn't support the lldb-style here, so the formatting of this must be done manually :( http://reviews.llvm.org/D17274 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D12809: Better scheme to lookup alternate mangled name when looking up function address.
dawn added a comment. @spyffe I think this review is waiting on you since you had previously rejected it. Can you please have a look? It continues to show up on my "Blocking Others" list and there's nothing more I can do on my side. Please review or resign out of curtesy to sivachandra??? Thanks in advance. @sivachandra If spyffe (or anyone for that matter) doesn't respond in a reasonable time frame, I would say it's safe to assume he is inactive and you can go ahead and commit based on my acceptance. This patch has been on review for months - you've given folks more than enough time to voice any objections. That said, it would be nice to get at least one other person's eyes on this. http://reviews.llvm.org/D12809 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D12809: Better scheme to lookup alternate mangled name when looking up function address.
dawn added a reviewer: clayborg. dawn added a subscriber: clayborg. dawn added a comment. Adding Greg - he is an excellent reviewer and quite responsive (poor guy - ends up with way more than his fair share of reviews as a result :( ). @clayborg would you be willing to be a 2nd pair of eyes here? http://reviews.llvm.org/D12809 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D15593: Add support for "source info" and use it to fix MI's -symbol-list-lines.
dawn added a comment. In http://reviews.llvm.org/D15593#319670, @clayborg wrote: > ... in the future when adding things for MI, please add an API in the > lldb::SB layer to do what you need. Thanks for not asking me to do that as part of this patch. > Text scraping is really not the solution we should be adding into the code. > Other people using MI are going to see this kind of code and think it is what > they should do when implementing/fixing new/existing MI commands. I agree that MI should have used the SB layer - did anyone ask the authors about that? Because as you say, the text scraping has now become a precedent for MI commands. > We have an API for a debugger that we are trying to make with the lldb::SB > layer, so we should use it and stop ANY form of text scraping in the future. > I think an API'ized version of what you are requesting here -- all line table > entries for a given source file -- should be available from SBTarget and a > future modification to MICmdCmdSymbol.cpp should switch over to using it. +100. Except that I think it should only apply to new code - bug fixes like this shouldn't be held back because of preexisting code. Rewriting lldb-mi to use the SB layer would be a great project for an intern or someone who wants to get familiar with lldb. We should keep that in mind if/when folks on lldb-dev ask about how they can help out. Repository: rL LLVM http://reviews.llvm.org/D15593 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D15904: Fix tests after svn r256863 - can someone please commit?
dawn created this revision. dawn added a reviewer: lldb-commits. dawn added a subscriber: lldb-commits. dawn set the repository for this revision to rL LLVM. This patch includes missed changes that should have gone in with r256863, but I can't get to svn at lldb.org at the moment (is it down?), so if someone else can, please commit these for me, and update http://reviews.llvm.org/D15593 to include the commit. Thanks! Intended commit message was: Apply missed changes from svn r256863 "Add support for "source info" and use it to fix MI's -symbol-list-lines.". Differential Revision: http://reviews.llvm.org/D15593 Repository: rL LLVM http://reviews.llvm.org/D15904 Files: packages/Python/lldbsuite/test/help/TestHelp.py packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py tools/lldb-mi/MICmdCmdSymbol.cpp Index: tools/lldb-mi/MICmdCmdSymbol.cpp === --- tools/lldb-mi/MICmdCmdSymbol.cpp +++ tools/lldb-mi/MICmdCmdSymbol.cpp @@ -106,8 +106,8 @@ { // Match LineEntry using regex. static MIUtilParse::CRegexParser g_lineentry_header_regex( -"^ *Lines for file (.+) in compilation unit (.+) in `(.+)$"); -// ^1=file ^2=cu^3=module +"^ *Lines found for file (.+) in compilation unit (.+) in `(.+)$"); +// ^1=file ^2=cu^3=module MIUtilParse::CRegexParser::Match match(4); Index: packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py === --- packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py +++ packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py @@ -63,11 +63,11 @@ # Test that -symbol-list-lines fails when file doesn't exist self.runCmd("-symbol-list-lines unknown_file") -self.expect("\^error,message=\"warning: No source filenames matched 'unknown_file'\. error: no source filenames matched any command arguments \"") +self.expect("\^error,message=\"error: No source filenames matched 'unknown_file'\. \"") # Test that -symbol-list-lines fails when file is specified using relative path self.runCmd("-symbol-list-lines ./main.cpp") -self.expect("\^error,message=\"warning: No source filenames matched '\./main\.cpp'\. error: no source filenames matched any command arguments \"") +self.expect("\^error,message=\"error: No source filenames matched '\./main\.cpp'\. \"") # Test that -symbol-list-lines works when file is specified using absolute path import os @@ -77,4 +77,4 @@ # Test that -symbol-list-lines fails when file doesn't exist self.runCmd("-symbol-list-lines unknown_dir/main.cpp") -self.expect("\^error,message=\"warning: No source filenames matched 'unknown_dir/main\.cpp'\. error: no source filenames matched any command arguments \"") +self.expect("\^error,message=\"error: No source filenames matched 'unknown_dir/main\.cpp'\. \"") Index: packages/Python/lldbsuite/test/help/TestHelp.py === --- packages/Python/lldbsuite/test/help/TestHelp.py +++ packages/Python/lldbsuite/test/help/TestHelp.py @@ -134,10 +134,10 @@ @no_debug_info_test def test_help_image_du_line_should_work(self): -"""Command 'help image du line' is not ambiguous and should work.""" +"""Command 'help image du line-table' is not ambiguous and should work.""" # 'image' is an alias for 'target modules'. self.expect("help image du line", -substrs = ['Dump the line table for one or more files']) +substrs = ['Dump the line table for one or more compilation units']) @no_debug_info_test def test_help_target_variable_syntax(self): Index: tools/lldb-mi/MICmdCmdSymbol.cpp === --- tools/lldb-mi/MICmdCmdSymbol.cpp +++ tools/lldb-mi/MICmdCmdSymbol.cpp @@ -106,8 +106,8 @@ { // Match LineEntry using regex. static MIUtilParse::CRegexParser g_lineentry_header_regex( -"^ *Lines for file (.+) in compilation unit (.+) in `(.+)$"); -// ^1=file ^2=cu^3=module +"^ *Lines found for file (.+) in compilation unit (.+) in `(.+)$"); +// ^1=file ^2=cu^3=module MIUtilParse::CRegexParser::Match match(4); Index: packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py === --- packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py +++ packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py @@ -63,11 +63,11 @@ # Test that -symbol-list-lines fails when file doesn't exist
Re: [Lldb-commits] [PATCH] D15593: Add support for "source info" and use it to fix MI's -symbol-list-lines.
dawn added a comment. Amended patch was posted to http://reviews.llvm.org/D15593 - hopefully someone who can get to llvm.org will commit. Repository: rL LLVM http://reviews.llvm.org/D15593 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D15593: Add support for "source info" and use it to fix MI's -symbol-list-lines.
dawn added a comment. I forgot to commit updated changes to the tests: MiSymbolTestCase.test_lldbmi_symbol_list_lines_file HelpCommandTestCase.test_help_image_du_line_should_work so they are failing now, but svn at llvm.org appears to be down at the moment. I'll commit those changes as soon as svn is back up... Repository: rL LLVM http://reviews.llvm.org/D15593 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r256877 - Apply missed changes from svn r256863 "Add support for "source info" and use it to fix MI's -symbol-list-lines.".
Author: dperchik Date: Tue Jan 5 18:03:43 2016 New Revision: 256877 URL: http://llvm.org/viewvc/llvm-project?rev=256877=rev Log: Apply missed changes from svn r256863 "Add support for "source info" and use it to fix MI's -symbol-list-lines.". Patch is part of Differential Revision: http://reviews.llvm.org/D15593 Differential Revision: http://reviews.llvm.org/D15904 Modified: lldb/trunk/packages/Python/lldbsuite/test/help/TestHelp.py lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py lldb/trunk/tools/lldb-mi/MICmdCmdSymbol.cpp Modified: lldb/trunk/packages/Python/lldbsuite/test/help/TestHelp.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/help/TestHelp.py?rev=256877=256876=256877=diff == --- lldb/trunk/packages/Python/lldbsuite/test/help/TestHelp.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/help/TestHelp.py Tue Jan 5 18:03:43 2016 @@ -134,10 +134,10 @@ class HelpCommandTestCase(TestBase): @no_debug_info_test def test_help_image_du_line_should_work(self): -"""Command 'help image du line' is not ambiguous and should work.""" +"""Command 'help image du line-table' is not ambiguous and should work.""" # 'image' is an alias for 'target modules'. self.expect("help image du line", -substrs = ['Dump the line table for one or more files']) +substrs = ['Dump the line table for one or more compilation units']) @no_debug_info_test def test_help_target_variable_syntax(self): Modified: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py?rev=256877=256876=256877=diff == --- lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py Tue Jan 5 18:03:43 2016 @@ -63,11 +63,11 @@ class MiSymbolTestCase(lldbmi_testcase.M # Test that -symbol-list-lines fails when file doesn't exist self.runCmd("-symbol-list-lines unknown_file") -self.expect("\^error,message=\"warning: No source filenames matched 'unknown_file'\. error: no source filenames matched any command arguments \"") +self.expect("\^error,message=\"error: No source filenames matched 'unknown_file'\. \"") # Test that -symbol-list-lines fails when file is specified using relative path self.runCmd("-symbol-list-lines ./main.cpp") -self.expect("\^error,message=\"warning: No source filenames matched '\./main\.cpp'\. error: no source filenames matched any command arguments \"") +self.expect("\^error,message=\"error: No source filenames matched '\./main\.cpp'\. \"") # Test that -symbol-list-lines works when file is specified using absolute path import os @@ -77,4 +77,4 @@ class MiSymbolTestCase(lldbmi_testcase.M # Test that -symbol-list-lines fails when file doesn't exist self.runCmd("-symbol-list-lines unknown_dir/main.cpp") -self.expect("\^error,message=\"warning: No source filenames matched 'unknown_dir/main\.cpp'\. error: no source filenames matched any command arguments \"") +self.expect("\^error,message=\"error: No source filenames matched 'unknown_dir/main\.cpp'\. \"") Modified: lldb/trunk/tools/lldb-mi/MICmdCmdSymbol.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmdCmdSymbol.cpp?rev=256877=256876=256877=diff == --- lldb/trunk/tools/lldb-mi/MICmdCmdSymbol.cpp (original) +++ lldb/trunk/tools/lldb-mi/MICmdCmdSymbol.cpp Tue Jan 5 18:03:43 2016 @@ -106,8 +106,8 @@ ParseLLDBLineAddressHeader(const char *i { // Match LineEntry using regex. static MIUtilParse::CRegexParser g_lineentry_header_regex( -"^ *Lines for file (.+) in compilation unit (.+) in `(.+)$"); -// ^1=file ^2=cu^3=module +"^ *Lines found for file (.+) in compilation unit (.+) in `(.+)$"); +// ^1=file ^2=cu^3=module MIUtilParse::CRegexParser::Match match(4); ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D15593: Add support for "source info" and use it to fix MI's -symbol-list-lines.
dawn added a comment. Amended patch was committed in svn r256877 (svn at lldb.org is back up now) Repository: rL LLVM http://reviews.llvm.org/D15593 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r256863 - Add support for "source info" and use it to fix MI's -symbol-list-lines.
Author: dperchik Date: Tue Jan 5 13:51:51 2016 New Revision: 256863 URL: http://llvm.org/viewvc/llvm-project?rev=256863=rev Log: Add support for "source info" and use it to fix MI's -symbol-list-lines. This patch adds support the command 'source info' as follows: (lldb) help source info Display source line information (as specified) based on the current executable's debug info. Syntax: source info Command Options Usage: source info [-c ] [-s ] [-f ] [-l ] [-e ] source info [-c ] [-s ] [-n ] source info [-c ] [-a ] -a ( --address ) Lookup the address and display the source information for the corresponding file and line. -c ( --count ) The number of line entries to display. -e ( --end-line ) The line number at which to stop displaying lines. -f ( --file ) The file from which to display source. -l ( --line ) The line number at which to start the displaying lines. -n ( --name ) The name of a function whose source to display. -s ( --shlib ) Look up the source in the given module or shared library (can be specified more than once). For example: (lldb) source info --file x.h Lines for file x.h in compilation unit x.cpp in `x [0x00010d00-0x00010d10): /Users/dawn/tmp/./x.h:10 [0x00010d10-0x00010d1b): /Users/dawn/tmp/./x.h:10 The new options are used to fix the MI command: -symbol-list-lines which didn't work for header files because it called: target modules dump line-table which only dumps line tables for a compilation unit. The patch also fixes a bug in the error reporting when no files were supplied to the command. Previously you'd get: (lldb) target modules dump line-table error: Syntax: error: no source filenames matched any command arguments Now you get: error: file option must be specified. Reviewed by: clayborg, jingham, ki.stfu Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D15593 Modified: lldb/trunk/packages/Python/lldbsuite/test/help/TestHelp.py lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/symbol_list_lines_inline_test.h lldb/trunk/source/Commands/CommandObjectSource.cpp lldb/trunk/source/Commands/CommandObjectTarget.cpp lldb/trunk/tools/lldb-mi/MICmdCmdSymbol.cpp Modified: lldb/trunk/packages/Python/lldbsuite/test/help/TestHelp.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/help/TestHelp.py?rev=256863=256862=256863=diff == --- lldb/trunk/packages/Python/lldbsuite/test/help/TestHelp.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/help/TestHelp.py Tue Jan 5 13:51:51 2016 @@ -137,7 +137,7 @@ class HelpCommandTestCase(TestBase): """Command 'help image du line' is not ambiguous and should work.""" # 'image' is an alias for 'target modules'. self.expect("help image du line", -substrs = ['Dump the line table for one or more compilation units']) +substrs = ['Dump the line table for one or more files']) @no_debug_info_test def test_help_target_variable_syntax(self): Modified: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py?rev=256863=256862=256863=diff == --- lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py Tue Jan 5 13:51:51 2016 @@ -48,12 +48,19 @@ class MiSymbolTestCase(lldbmi_testcase.M eline = line_number('symbol_list_lines_inline_test2.cpp', '// END_gfunc2') self.runCmd("-symbol-list-lines symbol_list_lines_inline_test2.cpp") self.expect("\^done,lines=\[\{pc=\"0x[0-9a-f]+\",line=\"%d\"\}(,\{pc=\"0x[0-9a-f]+\",line=\"3\d\"\})*,\{pc=\"0x[0-9a-f]+\",line=\"%d\"\}(,\{pc=\"0x[0-9a-f]+\",line=\"3\d\"\})*\]" % (sline, eline)) -##FIXME: This doesn't work for symbol_list_lines_inline_test.cpp due to clang bug llvm.org/pr24716 +##FIXME: This doesn't work for symbol_list_lines_inline_test.cpp due to clang bug llvm.org/pr24716 (fixed in newer versions of clang) ##sline = line_number('symbol_list_lines_inline_test.cpp', '// FUNC_gfunc') ##eline = line_number('symbol_list_lines_inline_test.cpp', '// STRUCT_s')
Re: [Lldb-commits] [PATCH] D15593: Enhance "target modules dump line " and use it to fix MI's -symbol-list-lines.
dawn added a comment. In http://reviews.llvm.org/D15593#313342, @clayborg wrote: > Dawn, if you don't understand what I asked you to do, Sorry for late reply - been recovering from minor surgery. I have a new patch, but I've not yet gone through all of Ilia's additional comments - will probably go ahead and upload anyway just to give you all a glimpse, as I fear there will be a few more rounds before this patch is ready. > As this already does exactly what you are doing. We will need to modify > CompileUnit::ResolveSymbolContext() to accept the "line" argument being zero. > It will return an "sc_list" of all matches, inside each symbol context will > be the LineEntry that you need. I didn't do this because I added support for additional options which were supported by 'source list', and needed access to the options during the loop which collects the lines. I hope you'll agree that this was the right approach after seeing the patch. Repository: rL LLVM http://reviews.llvm.org/D15593 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D15593: Enhance "target modules dump line " and use it to fix MI's -symbol-list-lines.
dawn marked 4 inline comments as done. dawn added a comment. Replies to Ilia's comments... Comment at: source/Commands/CommandObjectTarget.cpp:1543 @@ +1542,3 @@ +continue; +CompileUnit *cu = cu_sp.get(); +const FileSpecList _file_list = cu->GetSupportFiles(); ki.stfu wrote: > That's no problem. Just replace s/cu/cu_sp/ on lines #1544, #1565, #1580, > #1594, and then use cu_sp.get() on line #1586. this no longer applies to the most recent patch. Comment at: source/Commands/CommandObjectTarget.cpp:2689 @@ +2688,3 @@ +break; +} + ki.stfu wrote: > nit: you forgot the dot did I forget a dot? Comment at: tools/lldb-mi/MICmdCmdSymbol.cpp:226 @@ -225,3 @@ -// Skip entries which don't match the desired source. -if (strWantFile != strFile) -continue; ki.stfu wrote: > Is strWantFile needed? Seems it's an auxiliary variable. It's no longer needed with the new code, because you'll never get a file that isn't what was asked for. Repository: rL LLVM http://reviews.llvm.org/D15593 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D15593: Enhance "target modules dump line " and use it to fix MI's -symbol-list-lines.
dawn updated this revision to Diff 43152. dawn marked an inline comment as done. dawn added a comment. Updated patch with suggestions from Ilia's review (thanks Ilia!). Repository: rL LLVM http://reviews.llvm.org/D15593 Files: packages/Python/lldbsuite/test/help/TestHelp.py packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py packages/Python/lldbsuite/test/tools/lldb-mi/symbol/symbol_list_lines_inline_test.h source/Commands/CommandObjectTarget.cpp tools/lldb-mi/MICmdCmdSymbol.cpp Index: tools/lldb-mi/MICmdCmdSymbol.cpp === --- tools/lldb-mi/MICmdCmdSymbol.cpp +++ tools/lldb-mi/MICmdCmdSymbol.cpp @@ -82,11 +82,7 @@ CMICMDBASE_GETOPTION(pArgFile, File, m_constStrArgNameFile); const CMIUtilString (pArgFile->GetValue()); -// FIXME: this won't work for header files! To try and use existing -// commands to get this to work for header files would be too slow. -// Instead, this code should be rewritten to use APIs and/or support -// should be added to lldb which would work for header files. -const CMIUtilString strCmd(CMIUtilString::Format("target modules dump line-table \"%s\"", strFilePath.AddSlashes().c_str())); +const CMIUtilString strCmd(CMIUtilString::Format("target modules dump lines --compile-unit-only false --explicit-matches-only true --show-raw false \"%s\"", strFilePath.AddSlashes().c_str())); CMICmnLLDBDebugSessionInfo (CMICmnLLDBDebugSessionInfo::Instance()); const lldb::ReturnStatus rtn = rSessionInfo.GetDebugger().GetCommandInterpreter().HandleCommand(strCmd.c_str(), m_lldbResult); @@ -110,10 +106,10 @@ { // Match LineEntry using regex. static MIUtilParse::CRegexParser g_lineentry_header_regex( -"^ *Line table for (.+) in `(.+)$"); -// ^1=file ^2=module +"^ *Lines for file (.+) in compilation unit (.+) in `(.+)$"); +// ^1=file ^2=cu^3=module -MIUtilParse::CRegexParser::Match match(3); +MIUtilParse::CRegexParser::Match match(4); const bool ok = g_lineentry_header_regex.Execute(input, match); if (ok) @@ -146,12 +142,12 @@ // Match LineEntry using regex. static MIUtilParse::CRegexParser g_lineentry_nocol_regex( -"^ *(0x[0-9a-fA-F]+): (.+):([0-9]+)$"); +"^ *\\[(0x[0-9a-fA-F]+)-(0x[0-9a-fA-F]+)\\): (.+):([0-9]+)$"); static MIUtilParse::CRegexParser g_lineentry_col_regex( -"^ *(0x[0-9a-fA-F]+): (.+):([0-9]+):[0-9]+$"); -// ^1=addr ^2=f ^3=line ^4=:col(opt) +"^ *\\[(0x[0-9a-fA-F]+)-(0x[0-9a-fA-F]+)\\): (.+):([0-9]+):[0-9]+$"); +// ^1=start ^2=end ^3=f ^4=line ^5=:col(opt) -MIUtilParse::CRegexParser::Match match(5); +MIUtilParse::CRegexParser::Match match(6); // First try matching the LineEntry with the column, // then try without the column. @@ -160,8 +156,8 @@ if (ok) { addr = match.GetMatchAtIndex(1); -file = match.GetMatchAtIndex(2); -line = match.GetMatchAtIndex(3); +file = match.GetMatchAtIndex(3); +line = match.GetMatchAtIndex(4); } return ok; } @@ -222,10 +218,6 @@ if (!ParseLLDBLineAddressEntry(rLine.c_str(), strAddr, strFile, strLine)) continue; -// Skip entries which don't match the desired source. -if (strWantFile != strFile) -continue; - const CMICmnMIValueConst miValueConst(strAddr); const CMICmnMIValueResult miValueResult("pc", miValueConst); CMICmnMIValueTuple miValueTuple(miValueResult); Index: source/Commands/CommandObjectTarget.cpp === --- source/Commands/CommandObjectTarget.cpp +++ source/Commands/CommandObjectTarget.cpp @@ -1485,39 +1485,118 @@ } static uint32_t -DumpCompileUnitLineTable (CommandInterpreter , - Stream , - Module *module, - const FileSpec _spec, - bool load_addresses) +DumpFileLines (CommandInterpreter , + Stream , + Module *module, + const FileSpec _spec, + bool load_addresses, + bool compile_unit_only, + bool explicit_matches_only, + bool show_raw) { uint32_t num_matches = 0; if (module) { -SymbolContextList sc_list; -num_matches = module->ResolveSymbolContextsForFileSpec (file_spec, -0, -false, -eSymbolContextCompUnit, -sc_list); +if (compile_unit_only == true
Re: [Lldb-commits] [PATCH] D15593: Enhance "target modules dump line " and use it to fix MI's -symbol-list-lines.
dawn marked 6 inline comments as done. dawn added a comment. > clang-format your changes please (there are many deviations from the coding > style) I've made some fixes even though the code is no longer consistent with the rest of the file. Alas. I would love to run all of lldb through clang-format, but as we've seen, there are several options which still need to be added before we can do that (mostly relating to the formatting function declarations). Comment at: source/Commands/CommandObjectTarget.cpp:1510 @@ -1503,2 +1509,3 @@ -for (uint32_t i=0; init: fix indentation This is the original code, and is consistent with the coding style of the rest of the file. It bothers me too that lldb is so schizophrenic about its coding style, but unless we fix all of lldb, I think it's best to just try and follow the style of the code around you. Does anyone else have an opinion about this? I'll go ahead and change it, only because I see I that the new code I added didn't follow this style (oops). Comment at: source/Commands/CommandObjectTarget.cpp:1541-1542 @@ +1540,4 @@ +CompUnitSP cu_sp(module->GetCompileUnitAtIndex(i)); +if (!cu_sp) +continue; +CompileUnit *cu = cu_sp.get(); ki.stfu wrote: > Isn't it always false? Code elsewhere checks for it, so I assume there are cases when cu_sp can be null. Example in source/Core/SearchFilter.cpp: for (size_t i = 0; i < num_comp_units; i++) { CompUnitSP cu_sp (module_sp->GetCompileUnitAtIndex (i)); if (cu_sp) { Better safe than sorry. Comment at: source/Commands/CommandObjectTarget.cpp:1543 @@ +1542,3 @@ +continue; +CompileUnit *cu = cu_sp.get(); +const FileSpecList _file_list = cu->GetSupportFiles(); ki.stfu wrote: > You don't need a raw pointer here, just use cu_sp.get() on line #1587 There are 5 uses of cu in this code, so I think it's cleaner to have a variable. Comment at: source/Commands/CommandObjectTarget.cpp:1594-1596 @@ +1593,5 @@ +// Anymore after this one? +start_idx++; +start_idx = cu->FindLineEntry(start_idx, line, _file_spec, + /*exact=*/true, _entry); +} while (start_idx != UINT32_MAX); ki.stfu wrote: > combine it together: > ``` > cu->FindLineEntry(start_idx + 1, ...) > ``` I'd love to have a guideline as to when to wrap lines - lldb is all over the place about this. I've tended to try to keep lines to 100. Repository: rL LLVM http://reviews.llvm.org/D15593 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D15593: Add "target modules dump line-entries " command and use it to fix MI's -symbol-list-lines.
dawn updated this revision to Diff 43076. dawn added a comment. Updated patch to include changes to TestHelp.py. Repository: rL LLVM http://reviews.llvm.org/D15593 Files: packages/Python/lldbsuite/test/help/TestHelp.py packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py packages/Python/lldbsuite/test/tools/lldb-mi/symbol/symbol_list_lines_inline_test.h source/Commands/CommandObjectTarget.cpp tools/lldb-mi/MICmdCmdSymbol.cpp Index: tools/lldb-mi/MICmdCmdSymbol.cpp === --- tools/lldb-mi/MICmdCmdSymbol.cpp +++ tools/lldb-mi/MICmdCmdSymbol.cpp @@ -82,11 +82,7 @@ CMICMDBASE_GETOPTION(pArgFile, File, m_constStrArgNameFile); const CMIUtilString (pArgFile->GetValue()); -// FIXME: this won't work for header files! To try and use existing -// commands to get this to work for header files would be too slow. -// Instead, this code should be rewritten to use APIs and/or support -// should be added to lldb which would work for header files. -const CMIUtilString strCmd(CMIUtilString::Format("target modules dump line-table \"%s\"", strFilePath.AddSlashes().c_str())); +const CMIUtilString strCmd(CMIUtilString::Format("target modules dump line-entries \"%s\"", strFilePath.AddSlashes().c_str())); CMICmnLLDBDebugSessionInfo (CMICmnLLDBDebugSessionInfo::Instance()); const lldb::ReturnStatus rtn = rSessionInfo.GetDebugger().GetCommandInterpreter().HandleCommand(strCmd.c_str(), m_lldbResult); @@ -110,10 +106,10 @@ { // Match LineEntry using regex. static MIUtilParse::CRegexParser g_lineentry_header_regex( -"^ *Line table for (.+) in `(.+)$"); -// ^1=file ^2=module +"^ *Lines for file (.+) in compilation unit (.+) in `(.+)$"); +// ^1=file ^2=cu^3=module -MIUtilParse::CRegexParser::Match match(3); +MIUtilParse::CRegexParser::Match match(4); const bool ok = g_lineentry_header_regex.Execute(input, match); if (ok) @@ -146,12 +142,12 @@ // Match LineEntry using regex. static MIUtilParse::CRegexParser g_lineentry_nocol_regex( -"^ *(0x[0-9a-fA-F]+): (.+):([0-9]+)$"); +"^ *\\[(0x[0-9a-fA-F]+)-(0x[0-9a-fA-F]+)\\): (.+):([0-9]+)$"); static MIUtilParse::CRegexParser g_lineentry_col_regex( -"^ *(0x[0-9a-fA-F]+): (.+):([0-9]+):[0-9]+$"); -// ^1=addr ^2=f ^3=line ^4=:col(opt) +"^ *\\[(0x[0-9a-fA-F]+)-(0x[0-9a-fA-F]+)\\): (.+):([0-9]+):[0-9]+$"); +// ^1=start ^2=end ^3=f ^4=line ^5=:col(opt) -MIUtilParse::CRegexParser::Match match(5); +MIUtilParse::CRegexParser::Match match(6); // First try matching the LineEntry with the column, // then try without the column. @@ -160,8 +156,8 @@ if (ok) { addr = match.GetMatchAtIndex(1); -file = match.GetMatchAtIndex(2); -line = match.GetMatchAtIndex(3); +file = match.GetMatchAtIndex(3); +line = match.GetMatchAtIndex(4); } return ok; } @@ -222,10 +218,6 @@ if (!ParseLLDBLineAddressEntry(rLine.c_str(), strAddr, strFile, strLine)) continue; -// Skip entries which don't match the desired source. -if (strWantFile != strFile) -continue; - const CMICmnMIValueConst miValueConst(strAddr); const CMICmnMIValueResult miValueResult("pc", miValueConst); CMICmnMIValueTuple miValueTuple(miValueResult); Index: source/Commands/CommandObjectTarget.cpp === --- source/Commands/CommandObjectTarget.cpp +++ source/Commands/CommandObjectTarget.cpp @@ -1524,6 +1524,91 @@ return num_matches; } +static uint32_t +DumpFileLineEntries (CommandInterpreter , + Stream , + Module *module, + const FileSpec _spec, + bool load_addresses) +{ +uint32_t num_matches = 0; +if (module) +{ +// Look through all the compilation units (CUs) for ones that contain +// lines of code from this source file. +assert(file_spec.GetFilename().AsCString()); +bool has_path = (file_spec.GetDirectory().AsCString() != 0); +int ncus = module->GetNumCompileUnits(); +for (int i = 0; i < ncus; i++) +{ +// Look for a matching source file in this CU. +CompUnitSP cu_sp(module->GetCompileUnitAtIndex(i)); +if (!cu_sp) +continue; +CompileUnit *cu = cu_sp.get(); +const FileSpecList _file_list = cu->GetSupportFiles(); +size_t file_idx = cu_file_list.FindFileIndex(0, file_spec, has_path); +if (file_idx == UINT32_MAX) +// No such file in this CU. +continue; + +//
[Lldb-commits] [PATCH] D15593: Add "target modules dump line-entries " command and use it to fix MI's -symbol-list-lines.
dawn created this revision. dawn added reviewers: clayborg, ki.stfu, abidh. dawn added a subscriber: lldb-commits. dawn set the repository for this revision to rL LLVM. This adds support for the new command: target modules dump line-entries which dumps the line entries found for 'file' for all CUs in all modules. This command is used to fix the MI command: -symbol-list-lines which didn't work for header files because it called: target modules dump line-table which only dumps line tables for a compilation unit. Repository: rL LLVM http://reviews.llvm.org/D15593 Files: packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py packages/Python/lldbsuite/test/tools/lldb-mi/symbol/symbol_list_lines_inline_test.h source/Commands/CommandObjectTarget.cpp tools/lldb-mi/MICmdCmdSymbol.cpp Index: tools/lldb-mi/MICmdCmdSymbol.cpp === --- tools/lldb-mi/MICmdCmdSymbol.cpp +++ tools/lldb-mi/MICmdCmdSymbol.cpp @@ -82,11 +82,7 @@ CMICMDBASE_GETOPTION(pArgFile, File, m_constStrArgNameFile); const CMIUtilString (pArgFile->GetValue()); -// FIXME: this won't work for header files! To try and use existing -// commands to get this to work for header files would be too slow. -// Instead, this code should be rewritten to use APIs and/or support -// should be added to lldb which would work for header files. -const CMIUtilString strCmd(CMIUtilString::Format("target modules dump line-table \"%s\"", strFilePath.AddSlashes().c_str())); +const CMIUtilString strCmd(CMIUtilString::Format("target modules dump line-entries \"%s\"", strFilePath.AddSlashes().c_str())); CMICmnLLDBDebugSessionInfo (CMICmnLLDBDebugSessionInfo::Instance()); const lldb::ReturnStatus rtn = rSessionInfo.GetDebugger().GetCommandInterpreter().HandleCommand(strCmd.c_str(), m_lldbResult); @@ -110,10 +106,10 @@ { // Match LineEntry using regex. static MIUtilParse::CRegexParser g_lineentry_header_regex( -"^ *Line table for (.+) in `(.+)$"); -// ^1=file ^2=module +"^ *Lines for file (.+) in compilation unit (.+) in `(.+)$"); +// ^1=file ^2=cu^3=module -MIUtilParse::CRegexParser::Match match(3); +MIUtilParse::CRegexParser::Match match(4); const bool ok = g_lineentry_header_regex.Execute(input, match); if (ok) @@ -146,12 +142,12 @@ // Match LineEntry using regex. static MIUtilParse::CRegexParser g_lineentry_nocol_regex( -"^ *(0x[0-9a-fA-F]+): (.+):([0-9]+)$"); +"^ *\\[(0x[0-9a-fA-F]+)-(0x[0-9a-fA-F]+)\\): (.+):([0-9]+)$"); static MIUtilParse::CRegexParser g_lineentry_col_regex( -"^ *(0x[0-9a-fA-F]+): (.+):([0-9]+):[0-9]+$"); -// ^1=addr ^2=f ^3=line ^4=:col(opt) +"^ *\\[(0x[0-9a-fA-F]+)-(0x[0-9a-fA-F]+)\\): (.+):([0-9]+):[0-9]+$"); +// ^1=start ^2=end ^3=f ^4=line ^5=:col(opt) -MIUtilParse::CRegexParser::Match match(5); +MIUtilParse::CRegexParser::Match match(6); // First try matching the LineEntry with the column, // then try without the column. @@ -160,8 +156,8 @@ if (ok) { addr = match.GetMatchAtIndex(1); -file = match.GetMatchAtIndex(2); -line = match.GetMatchAtIndex(3); +file = match.GetMatchAtIndex(3); +line = match.GetMatchAtIndex(4); } return ok; } @@ -222,10 +218,6 @@ if (!ParseLLDBLineAddressEntry(rLine.c_str(), strAddr, strFile, strLine)) continue; -// Skip entries which don't match the desired source. -if (strWantFile != strFile) -continue; - const CMICmnMIValueConst miValueConst(strAddr); const CMICmnMIValueResult miValueResult("pc", miValueConst); CMICmnMIValueTuple miValueTuple(miValueResult); Index: source/Commands/CommandObjectTarget.cpp === --- source/Commands/CommandObjectTarget.cpp +++ source/Commands/CommandObjectTarget.cpp @@ -1524,6 +1524,91 @@ return num_matches; } +static uint32_t +DumpFileLineEntries (CommandInterpreter , + Stream , + Module *module, + const FileSpec _spec, + bool load_addresses) +{ +uint32_t num_matches = 0; +if (module) +{ +// Look through all the compilation units (CUs) for ones that contain +// lines of code from this source file. +assert(file_spec.GetFilename().AsCString()); +bool has_path = (file_spec.GetDirectory().AsCString() != 0); +int ncus = module->GetNumCompileUnits(); +for (int i = 0; i < ncus; i++) +{ +// Look for a matching source file in this CU. +CompUnitSP cu_sp(module->GetCompileUnitAtIndex(i)); +if
Re: [Lldb-commits] [PATCH] D15593: Enhance "target modules dump line " and use it to fix MI's -symbol-list-lines.
dawn retitled this revision from "Add "target modules dump line-entries " command and use it to fix MI's -symbol-list-lines." to "Enhance "target modules dump line " and use it to fix MI's -symbol-list-lines.". dawn updated the summary for this revision. dawn updated this revision to Diff 43103. Repository: rL LLVM http://reviews.llvm.org/D15593 Files: packages/Python/lldbsuite/test/help/TestHelp.py packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py packages/Python/lldbsuite/test/tools/lldb-mi/symbol/symbol_list_lines_inline_test.h source/Commands/CommandObjectTarget.cpp tools/lldb-mi/MICmdCmdSymbol.cpp Index: tools/lldb-mi/MICmdCmdSymbol.cpp === --- tools/lldb-mi/MICmdCmdSymbol.cpp +++ tools/lldb-mi/MICmdCmdSymbol.cpp @@ -82,11 +82,7 @@ CMICMDBASE_GETOPTION(pArgFile, File, m_constStrArgNameFile); const CMIUtilString (pArgFile->GetValue()); -// FIXME: this won't work for header files! To try and use existing -// commands to get this to work for header files would be too slow. -// Instead, this code should be rewritten to use APIs and/or support -// should be added to lldb which would work for header files. -const CMIUtilString strCmd(CMIUtilString::Format("target modules dump line-table \"%s\"", strFilePath.AddSlashes().c_str())); +const CMIUtilString strCmd(CMIUtilString::Format("target modules dump lines -u false -e true -r false \"%s\"", strFilePath.AddSlashes().c_str())); CMICmnLLDBDebugSessionInfo (CMICmnLLDBDebugSessionInfo::Instance()); const lldb::ReturnStatus rtn = rSessionInfo.GetDebugger().GetCommandInterpreter().HandleCommand(strCmd.c_str(), m_lldbResult); @@ -110,10 +106,10 @@ { // Match LineEntry using regex. static MIUtilParse::CRegexParser g_lineentry_header_regex( -"^ *Line table for (.+) in `(.+)$"); -// ^1=file ^2=module +"^ *Lines for file (.+) in compilation unit (.+) in `(.+)$"); +// ^1=file ^2=cu^3=module -MIUtilParse::CRegexParser::Match match(3); +MIUtilParse::CRegexParser::Match match(4); const bool ok = g_lineentry_header_regex.Execute(input, match); if (ok) @@ -146,12 +142,12 @@ // Match LineEntry using regex. static MIUtilParse::CRegexParser g_lineentry_nocol_regex( -"^ *(0x[0-9a-fA-F]+): (.+):([0-9]+)$"); +"^ *\\[(0x[0-9a-fA-F]+)-(0x[0-9a-fA-F]+)\\): (.+):([0-9]+)$"); static MIUtilParse::CRegexParser g_lineentry_col_regex( -"^ *(0x[0-9a-fA-F]+): (.+):([0-9]+):[0-9]+$"); -// ^1=addr ^2=f ^3=line ^4=:col(opt) +"^ *\\[(0x[0-9a-fA-F]+)-(0x[0-9a-fA-F]+)\\): (.+):([0-9]+):[0-9]+$"); +// ^1=start ^2=end ^3=f ^4=line ^5=:col(opt) -MIUtilParse::CRegexParser::Match match(5); +MIUtilParse::CRegexParser::Match match(6); // First try matching the LineEntry with the column, // then try without the column. @@ -160,8 +156,8 @@ if (ok) { addr = match.GetMatchAtIndex(1); -file = match.GetMatchAtIndex(2); -line = match.GetMatchAtIndex(3); +file = match.GetMatchAtIndex(3); +line = match.GetMatchAtIndex(4); } return ok; } @@ -222,10 +218,6 @@ if (!ParseLLDBLineAddressEntry(rLine.c_str(), strAddr, strFile, strLine)) continue; -// Skip entries which don't match the desired source. -if (strWantFile != strFile) -continue; - const CMICmnMIValueConst miValueConst(strAddr); const CMICmnMIValueResult miValueResult("pc", miValueConst); CMICmnMIValueTuple miValueTuple(miValueResult); Index: source/Commands/CommandObjectTarget.cpp === --- source/Commands/CommandObjectTarget.cpp +++ source/Commands/CommandObjectTarget.cpp @@ -1485,39 +1485,120 @@ } static uint32_t -DumpCompileUnitLineTable (CommandInterpreter , - Stream , - Module *module, - const FileSpec _spec, - bool load_addresses) +DumpFileLines (CommandInterpreter , + Stream , + Module *module, + const FileSpec _spec, + bool load_addresses, + bool compile_unit_only, + bool explicit_matches_only, + bool show_raw) { uint32_t num_matches = 0; if (module) { -SymbolContextList sc_list; -num_matches = module->ResolveSymbolContextsForFileSpec (file_spec, -0, -false, -eSymbolContextCompUnit, -
Re: [Lldb-commits] [PATCH] D15593: Add "target modules dump line-entries " command and use it to fix MI's -symbol-list-lines.
dawn added a comment. I'm only going to support the combinations: --compile-unit-only true --only-explicit-matches false --show-raw true --compile-unit-only false --only-explicit-matches true --show-raw false OK? Repository: rL LLVM http://reviews.llvm.org/D15593 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D15593: Add "target modules dump line-entries " command and use it to fix MI's -symbol-list-lines.
dawn added a comment. In http://reviews.llvm.org/D15593#312665, @jingham wrote: > So it seems like your change is adding three flags > > --compile-unit-only --only-explicit-matches --show-raw > > or something. The current behavior is: > > --compile-unit-only true --only-explicit-matches false --show-raw true > > and your command does: > > --compile-unit-only false --only-explicit-matches true --show-raw false > > Does that seem right. Yup. > If so, then we have to decide whether it is worth the effort to be able to > tweak these three independently. I think these flags only make sense if you could tweak them independently, but to support something like: --compile-unit-only false --only-explicit-matches true --show-raw *true* would be a major pain - it would mean adding a lot of extra code and interfaces for something that would only be used by this one command. I think it's better to just have both: target modules line-tables target modules line-entries and if we find a need for any other combinations of the options you proposed, we can merge them at that time. Thoughts? Repository: rL LLVM http://reviews.llvm.org/D15593 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r255440 - Test case for "Fix scope-based lookup when more than one function is found."
Author: dperchik Date: Sat Dec 12 14:44:08 2015 New Revision: 255440 URL: http://llvm.org/viewvc/llvm-project?rev=255440=rev Log: Test case for "Fix scope-based lookup when more than one function is found." Missed commit in r255439. Differential Revision: http://reviews.llvm.org/D15312 Added: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespaceLookup.py Added: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespaceLookup.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespaceLookup.py?rev=255440=auto == --- lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespaceLookup.py (added) +++ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespaceLookup.py Sat Dec 12 14:44:08 2015 @@ -0,0 +1,216 @@ +""" +Test the printing of anonymous and named namespace variables. +""" + +from __future__ import print_function + + +import os, time +import lldb +from lldbsuite.test.lldbtest import * +import lldbsuite.test.lldbutil as lldbutil + +class NamespaceLookupTestCase(TestBase): + +mydir = TestBase.compute_mydir(__file__) + +def setUp(self): +# Call super's setUp(). +TestBase.setUp(self) +# Break inside different scopes and evaluate value +self.line_break_global_scope = line_number('ns.cpp', '// BP_global_scope') +self.line_break_file_scope = line_number('ns2.cpp', '// BP_file_scope') +self.line_break_ns_scope = line_number('ns2.cpp', '// BP_ns_scope') +self.line_break_nested_ns_scope = line_number('ns2.cpp', '// BP_nested_ns_scope') +self.line_break_nested_ns_scope_after_using = line_number('ns2.cpp', '// BP_nested_ns_scope_after_using') +self.line_break_before_using_directive = line_number('ns3.cpp', '// BP_before_using_directive') +self.line_break_after_using_directive = line_number('ns3.cpp', '// BP_after_using_directive') + +def runToBkpt(self, command): +self.runCmd(command, RUN_SUCCEEDED) +# The stop reason of the thread should be breakpoint. +self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, +substrs = ['stopped', + 'stop reason = breakpoint']) + +def test_scope_lookup_with_run_command(self): +"""Test scope lookup of functions in lldb.""" +self.build() +self.runCmd("file a.out", CURRENT_EXECUTABLE_SET) + +lldbutil.run_break_set_by_file_and_line (self, "ns.cpp", self.line_break_global_scope, num_expected_locations=1, loc_exact=False) +lldbutil.run_break_set_by_file_and_line (self, "ns2.cpp", self.line_break_ns_scope, num_expected_locations=1, loc_exact=False) +lldbutil.run_break_set_by_file_and_line (self, "ns2.cpp", self.line_break_nested_ns_scope, num_expected_locations=1, loc_exact=False) +lldbutil.run_break_set_by_file_and_line (self, "ns2.cpp", self.line_break_nested_ns_scope_after_using, num_expected_locations=1, loc_exact=False) +lldbutil.run_break_set_by_file_and_line (self, "ns3.cpp", self.line_break_before_using_directive, num_expected_locations=1, loc_exact=False) +lldbutil.run_break_set_by_file_and_line (self, "ns3.cpp", self.line_break_after_using_directive, num_expected_locations=1, loc_exact=False) + +# Run to BP_global_scope at global scope +self.runToBkpt("run") +# Evaluate func() - should call ::func() +self.expect("expr -- func()", startstr = "(int) $0 = 1") +# Evaluate A::B::func() - should call A::B::func() +self.expect("expr -- A::B::func()", startstr = "(int) $1 = 4") +# Evaluate func(10) - should call ::func(int) +self.expect("expr -- func(10)", startstr = "(int) $2 = 11") +# Evaluate ::func() - should call A::func() +self.expect("expr -- ::func()", startstr = "(int) $3 = 1") +# Evaluate A::foo() - should call A::foo() +self.expect("expr -- A::foo()", startstr = "(int) $4 = 42") + +# Continue to BP_ns_scope at ns scope +self.runToBkpt("continue") +# Evaluate func(10) - should call A::func(int) +self.expect("expr -- func(10)", startstr = "(int) $5 = 13") +# Evaluate B::func() - should call B::func() +self.expect("expr -- B::func()", startstr = "(int) $6 = 4") +# Evaluate func() - should call A::func() +self.expect("expr -- func()", startstr = "(int) $7 = 3") + +# Continue to BP_nested_ns_scope at nested ns scope +self.runToBkpt("continue") +# Evaluate func() - should call A::B::func() +self.expect("expr -- func()", startstr = "(int) $8 = 4") +# Evaluate A::func() - should call A::func() +self.expect("expr -- A::func()", startstr = "(int) $9 = 3") + +# Evaluate func(10) - should call A::func(10) +# NOTE: Under
[Lldb-commits] [lldb] r255439 - Fix scope-based lookup when more than one function is found.
Author: dperchik Date: Sat Dec 12 13:31:41 2015 New Revision: 255439 URL: http://llvm.org/viewvc/llvm-project?rev=255439=rev Log: Fix scope-based lookup when more than one function is found. When multiple functions are found by name, lldb removes duplicate entries of functions with the same type, so the first function in the symbol context list is chosen, even if it isn't in scope. This patch uses the declaration context of the execution context to select the function which is in scope. This fixes cases like the following: int func(); namespace ns { int func(); void here() { // Run to BP here and eval 'p func()'; // lldb used to find ::func(), now finds ns::func(). } } Reviewed by: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D15312 Added: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace/ns.cpp lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace/ns.h lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace/ns2.cpp lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace/ns3.cpp Modified: lldb/trunk/include/lldb/Symbol/ClangASTContext.h lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace/Makefile lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace/main.cpp lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp lldb/trunk/source/Symbol/ClangASTContext.cpp Modified: lldb/trunk/include/lldb/Symbol/ClangASTContext.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTContext.h?rev=255439=255438=255439=diff == --- lldb/trunk/include/lldb/Symbol/ClangASTContext.h (original) +++ lldb/trunk/include/lldb/Symbol/ClangASTContext.h Sat Dec 12 13:31:41 2015 @@ -944,6 +944,15 @@ public: CompilerType GetTypeForFormatters (void* type) override; +#define LLDB_INVALID_DECL_LEVELUINT32_MAX +// LLDB_INVALID_DECL_LEVEL is returned by CountDeclLevels if +// child_decl_ctx could not be found in decl_ctx. +uint32_t +CountDeclLevels (clang::DeclContext *frame_decl_ctx, + clang::DeclContext *child_decl_ctx, + ConstString *child_name = nullptr, + CompilerType *child_type = nullptr); + //-- // Modifying RecordType //-- Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace/Makefile?rev=255439=255438=255439=diff == --- lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace/Makefile (original) +++ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace/Makefile Sat Dec 12 13:31:41 2015 @@ -1,5 +1,5 @@ LEVEL = ../../../make -CXX_SOURCES := main.cpp +CXX_SOURCES := main.cpp ns.cpp ns2.cpp ns3.cpp include $(LEVEL)/Makefile.rules Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace/main.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace/main.cpp?rev=255439=255438=255439=diff == --- lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace/main.cpp (original) +++ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace/main.cpp Sat Dec 12 13:31:41 2015 @@ -8,6 +8,7 @@ //===--===// #include +#include "ns.h" namespace { typedef unsigned int my_uint_t; @@ -80,7 +81,6 @@ namespace ns2 { int value = 200; } -#include void test_namespace_scopes() { do { using namespace ns1; @@ -113,5 +113,12 @@ int Foo::myfunc(int a) int main (int argc, char const *argv[]) { +test_lookup_at_global_scope(); +test_lookup_at_file_scope(); +A::test_lookup_at_ns_scope(); +A::B::test_lookup_at_nested_ns_scope(); +A::B::test_lookup_at_nested_ns_scope_after_using(); +test_lookup_before_using_directive(); +test_lookup_after_using_directive(); return Foo::myfunc(12); } Added: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace/ns.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace/ns.cpp?rev=255439=auto == --- lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace/ns.cpp (added) +++ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace/ns.cpp Sat Dec 12 13:31:41 2015 @@ -0,0 +1,32 @@ +//===-- ns.cpp
Re: [Lldb-commits] [PATCH] D15312: Fix scope-based lookup when more than one function is found.
dawn updated this revision to Diff 42476. dawn added a comment. Updated Clang-specific version of patch. Repository: rL LLVM http://reviews.llvm.org/D15312 Files: include/lldb/Symbol/ClangASTContext.h packages/Python/lldbsuite/test/lang/cpp/namespace/Makefile packages/Python/lldbsuite/test/lang/cpp/namespace/main.cpp packages/Python/lldbsuite/test/lang/cpp/namespace/ns.cpp packages/Python/lldbsuite/test/lang/cpp/namespace/ns.h packages/Python/lldbsuite/test/lang/cpp/namespace/ns2.cpp packages/Python/lldbsuite/test/lang/cpp/namespace/ns3.cpp source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp source/Symbol/ClangASTContext.cpp Index: source/Symbol/ClangASTContext.cpp === --- source/Symbol/ClangASTContext.cpp +++ source/Symbol/ClangASTContext.cpp @@ -9224,6 +9224,123 @@ return found_decls; } +// Look for child_decl_ctx's lookup scope in frame_decl_ctx and its parents, +// and return the number of levels it took to find it, or LLDB_INVALID_DECL_LEVEL +// if not found. If the decl was imported via a using declaration, its name and/or +// type, if set, will be used to check that the decl found in the scope is a match. +// +// The optional name is required by languages (like C++) to handle using declarations +// like: +// +// void poo(); +// namespace ns { +// void foo(); +// void goo(); +// } +// void bar() { +// using ns::foo; +// // CountDeclLevels returns 0 for 'foo', 1 for 'poo', and +// // LLDB_INVALID_DECL_LEVEL for 'goo'. +// } +// +// The optional type is useful in the case that there's a specific overload +// that we're looking for that might otherwise be shadowed, like: +// +// void foo(int); +// namespace ns { +// void foo(); +// } +// void bar() { +// using ns::foo; +// // CountDeclLevels returns 0 for { 'foo', void() }, +// // 1 for { 'foo', void(int) }, and +// // LLDB_INVALID_DECL_LEVEL for { 'foo', void(int, int) }. +// } +// +// NOTE: Because file statics are at the TranslationUnit along with globals, a +// function at file scope will return the same level as a function at global scope. +// Ideally we'd like to treat the file scope as an additional scope just below the +// global scope. More work needs to be done to recognise that, if the decl we're +// trying to look up is static, we should compare its source file with that of the +// current scope and return a lower number for it. +uint32_t +ClangASTContext::CountDeclLevels (clang::DeclContext *frame_decl_ctx, + clang::DeclContext *child_decl_ctx, + ConstString *child_name, + CompilerType *child_type) +{ +if (frame_decl_ctx) +{ +std::set searched; +std::multimap search_queue; +SymbolFile *symbol_file = GetSymbolFile(); + +// Get the lookup scope for the decl we're trying to find. +clang::DeclContext *parent_decl_ctx = child_decl_ctx->getParent(); + +// Look for it in our scope's decl context and its parents. +uint32_t level = 0; +for (clang::DeclContext *decl_ctx = frame_decl_ctx; decl_ctx != nullptr; decl_ctx = decl_ctx->getParent()) +{ +if (!decl_ctx->isLookupContext()) +continue; +if (decl_ctx == parent_decl_ctx) +// Found it! +return level; +search_queue.insert(std::make_pair(decl_ctx, decl_ctx)); +for (auto it = search_queue.find(decl_ctx); it != search_queue.end(); it++) +{ +if (searched.find(it->second) != searched.end()) +continue; +searched.insert(it->second); +symbol_file->ParseDeclsForContext(CompilerDeclContext(this, it->second)); + +for (clang::Decl *child : it->second->decls()) +{ +if (clang::UsingDirectiveDecl *ud = llvm::dyn_cast(child)) +{ +clang::DeclContext *ns = ud->getNominatedNamespace(); +if (ns == parent_decl_ctx) +// Found it! +return level; +clang::DeclContext *from = ud->getCommonAncestor(); +if (searched.find(ns) == searched.end()) +search_queue.insert(std::make_pair(from, ns)); +} +else if (child_name) +{ +if (clang::UsingDecl *ud = llvm::dyn_cast(child)) +{ +for (clang::UsingShadowDecl *usd : ud->shadows()) +{ +clang::Decl *target = usd->getTargetDecl(); +
Re: [Lldb-commits] [PATCH] D15326: Rework breakpoint language filtering to use the symbol context's language.
dawn added a comment. ping? Repository: rL LLVM http://reviews.llvm.org/D15326 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D15312: Fix scope-based lookup when more than one function is found.
dawn updated this revision to Diff 42385. dawn added a comment. This version of the patch is the API "generic" version of the patch. Please choose to review which ever is preferred, and I will submit another patch based on that version if needed. BTW Greg, thanks for the suggestion of multimap - it definitely simplified things! And if you're wondering why we want to keep a set of functions for each type in FindExternalVisibleDecls, it's because overload resolution hasn't chosen a function yet, so we must keep all possible candidates in our set. Repository: rL LLVM http://reviews.llvm.org/D15312 Files: include/lldb/Symbol/ClangASTContext.h include/lldb/Symbol/GoASTContext.h include/lldb/Symbol/TypeSystem.h packages/Python/lldbsuite/test/lang/cpp/namespace/Makefile packages/Python/lldbsuite/test/lang/cpp/namespace/main.cpp packages/Python/lldbsuite/test/lang/cpp/namespace/ns.cpp packages/Python/lldbsuite/test/lang/cpp/namespace/ns.h packages/Python/lldbsuite/test/lang/cpp/namespace/ns2.cpp packages/Python/lldbsuite/test/lang/cpp/namespace/ns3.cpp source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp source/Symbol/ClangASTContext.cpp Index: source/Symbol/ClangASTContext.cpp === --- source/Symbol/ClangASTContext.cpp +++ source/Symbol/ClangASTContext.cpp @@ -9224,6 +9224,127 @@ return found_decls; } +// Look for child_decl_ctx's lookup scope in frame_decl_ctx and its parents, +// and return the number of levels it took to find it, or LLDB_INVALID_DECL_LEVEL +// if not found. If the decl was imported via a using declaration, its name and/or +// type, if set, will be used to check that the decl found in the scope is a match. +// +// The optional name is required by languages (like C++) to handle using declarations +// like: +// +// void poo(); +// namespace ns { +// void foo(); +// void goo(); +// } +// void bar() { +// using ns::foo; +// // CountDeclLevels returns 0 for 'foo', 1 for 'poo', and +// // LLDB_INVALID_DECL_LEVEL for 'goo'. +// } +// +// The optional type might be useful in the case that there's a specific overload +// that we're looking for, like: +// +// void foo(int, int); +// namespace ns { +// void foo(); +// void foo(int); +// } +// void bar() { +// using_like ns::foo(int); +// // CountDeclLevels returns 0 for { 'foo', void(int) }, +// // 1 for { 'foo', void(int, int) }, and +// // LLDB_INVALID_DECL_LEVEL for { 'foo', void() }. +// } +// +// NOTE: Because file statics are at the TranslationUnit along with globals, a +// function at file scope will return the same level as a function at global scope. +// Ideally we'd like to treat the file scope as an additional scope just below the +// global scope. More work needs to be done to recognise that, if the decl we're +// trying to look up is static, we should compare its source file with that of the +// current scope and return a lower number for it. +uint32_t +ClangASTContext::DeclContextCountDeclLevels (void *opaque_frame_decl_ctx, + void *opaque_child_decl_ctx, + ConstString *child_name, + CompilerType *child_type) +{ +if (opaque_frame_decl_ctx) +{ +DeclContext *frame_decl_ctx = (DeclContext *)opaque_frame_decl_ctx; +DeclContext *child_decl_ctx = (DeclContext *)opaque_child_decl_ctx; +std::set searched; +std::multimap search_queue; +SymbolFile *symbol_file = GetSymbolFile(); + +// Get the lookup scope for the decl we're trying to find. +clang::DeclContext *parent_decl_ctx = child_decl_ctx->getParent(); + +// Look for it in our scope's decl context and its parents. +uint32_t level = 0; +for (clang::DeclContext *decl_ctx = frame_decl_ctx; decl_ctx != nullptr; decl_ctx = decl_ctx->getParent()) +{ +if (!decl_ctx->isLookupContext()) +continue; +if (decl_ctx == parent_decl_ctx) +// Found it! +return level; +search_queue.insert(std::make_pair(decl_ctx, decl_ctx)); + +for (auto it = search_queue.find(decl_ctx); it != search_queue.end(); it++) +{ +if (searched.find(it->second) != searched.end()) +continue; +searched.insert(it->second); +symbol_file->ParseDeclsForContext(CompilerDeclContext(this, it->second)); + +for (clang::Decl *child : it->second->decls()) +{ +if (clang::UsingDirectiveDecl *ud = llvm::dyn_cast(child)) +{ +clang::DeclContext *ns = ud->getNominatedNamespace(); +if (ns ==
Re: [Lldb-commits] [PATCH] D15312: Fix scope-based lookup when more than one function is found.
dawn marked 3 inline comments as done. dawn added a comment. > It seems like you combined "find this decl instance within a decl context" > with "find a decl by name in the CompilerDeclContext and optionally get the > type". It it exactly "find this decl instance within a decl context". > I am still unclear as to what the name and type are doing in > DeclContextCountDeclLevels. I don't see how we would ever have a decl (in > opaque_find_decl_ctx) that isn't unique where the same decl could have > different names and different types? The optional name is required by languages (like C++) to handle using declarations like: void poo(); namespace ns { void foo(); void goo(); } void bar() { using ns::foo; // Here, 'foo' is needed so that we can match it // with the using declaration. // // We want the API to return 0 for 'foo', // -1 for 'goo', and 1 for 'poo'. } The optional type might be required by languages which have a using declaration-like concept where a type can be specified, like: void foo(int, int); namespace ns { void foo(); void foo(int); } void bar() { using_like ns::foo(int); // Here, 'foo' and its type are both needed so that // we can match it with the using_like declaration. // // We want the API to return 0 for { 'foo', 'void(int)' }, // -1 for { 'foo', 'void()' }, // and 1 for { 'foo', 'void(int, int)' }, } The name and type are optional (default to 0) for languages which don't have these concepts. Repository: rL LLVM http://reviews.llvm.org/D15312 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D15312: Fix scope-based lookup when more than one function is found.
dawn marked 6 inline comments as done. dawn added a comment. Hi Greg, I'm working on a new revision to change the patch as you suggest (thanks for your review - you had some great suggestions!). Sorry, if I'm missing something obviously here, but there's still some things I don't understand: 1. What exactly was clang specific about the DeclContextCountDeclLevels API? 2. How is it anymore clang specific than DeclContextFindDeclByName? Anyway, I didn't want to drag this out any longer so am making the code clang specific. We can always generalize it in the future (I want it for Delphi). Comment at: source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp:1467-1468 @@ +1466,4 @@ +// Filter out class/instance methods. +if (decl_ctx.IsClassMethod(nullptr, nullptr, nullptr)) +continue; +sc_func_list.Append(sym_ctx); clayborg wrote: > Why are we pulling out class methods here? To save time - they're thrown out by the loop that actually adds the functions which follows this, so no point in spending time on them. Comment at: source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp:1505-1509 @@ +1504,7 @@ +// scope and shadows the other. +fdi.m_func_decl_lvl = + ast->DeclContextCountDeclLevels(compiler_decl_context.GetOpaqueDeclContext(), + func_decl_context.GetOpaqueDeclContext(), + _function_name, + _copied_function_type); +} clayborg wrote: > Seems like you actually want this to be something like: > > ``` > fdi.m_func_decl_lvl = func_decl_context.Depth(compiler_decl_context); > ``` > > This would be a function on CompilerDeclContext that would calculate the > depth of a decl context if the first argument (compiler_decl_context) is > contained within the object (func_decl_context). This would be a useful API > to add to CompilerDeclContext. It can return an integer and return "-1" if > the compiler_decl_context ins't contained within func_decl_context, or zero > or greater if it is. > > Then you would need to add more functions the CompilerDeclContext to get > "fdi.m_function_name" and "fdi.m_copied_function_type". > As mentioned in prior discussions, this API is basically what you are suggesting. The name and type are not returned - they are optional inputs into the function to allow for languages which support using declarations (because using declarations need to check type and/or name). For example, in Delphi where using declarations are not supported, these would default to nullptr. Comment at: source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp:1517 @@ +1516,3 @@ +uint32_t num_indices = sc_func_list.GetSize(); +std::vector fdi_cache; +fdi_cache.reserve(num_indices); clayborg wrote: > wouldn't this be better as std::multimapwhere the > uint32_t is the depth? Then you can change your foo loop at 1531 to just grab > the first entry in the map and iterate as long as the depth is the same... That won't work because we can have functions at more than one level that we'll want to keep in our set. Using std::multimap might help to clean things up a little however - will give it a try. Repository: rL LLVM http://reviews.llvm.org/D15312 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D15312: Fix scope-based lookup when more than one function is found.
dawn added a comment. bloodbath:~% exit Thanks Greg! To address your main point: > So either make it generic, or clang specific. DeclContextCountDeclLevels's interface follows DeclContextFindDeclByName (authored by Paul Herman). If DeclContextCountDeclLevels is to change, then DeclContextFindDeclByName should also change for consistency. My take on this is that the code in ClangExpressionDeclMap::FindExternalVisibleDecls which calls these scope-based lookup routines should be moved out of ClangExpressionDeclMap.cpp into CompilerExpressionDeclMap.cpp, so the interfaces to DeclContextFindDeclByName/DeclContextCountDeclLevels should remain generic while the implementations are compiler specific. That's way more than I'd like to take on as part of this patch however. Paul, any feedback from you on this? Repository: rL LLVM http://reviews.llvm.org/D15312 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D15312: Fix scope-based lookup when more than one function is found.
dawn added a comment. > Greg: But going forward I would like to see more of "find a struct named 'X' in CompilerDeclContext 'Y'" queries, instead of ... I think lldb should have both, a "search for anything named foo in my scope context" (for when a user does "p foo"), and a "search for a thingy (functions/types/variables/etc.) named foo in my scope context" (for when a user does "expr --type function -- foo"). > tberghammer: I am not sure if doing all of the parsing lazily is the good > approach because of speed considerations. ... looking into the direction we > are heading now we will need to parse more and more information to improve > the expression evaluation Agreed. > Greg: > > int32_t CompilerDeclContext::GetDepth (const CompilerDeclContext _ctx); > > This would get the depth of one CompilerDeclContext within another > CompilerDeclContext, it would return -1 if "decl_ctx" doesn't fall within the > object, and zero or above it is is contained. The problem with this is that it won't work for using declarations which require information about the thing we're looking up before it can determine the proper scope levels. > BTW: I fixed DeclContextFindDeclByName to return a vector of CompilerDecl > objects: Cool, but it needs to accept an optional type to deal with function overloading. I can add that and see if I can come up with a new patch that uses the new DeclContextFindDeclByName. (In my copious spare time - heh). But... One major performance benefit of my original implementation is that the function's name and type *only* need to be tested in the case of a using declaration, so in general it's much faster, because we only need to look for the function's parent's lookup scope. So, are you sure you want to go down this path? Repository: rL LLVM http://reviews.llvm.org/D15312 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D15326: Rework breakpoint language filtering to use the symbol context's language.
dawn added a reviewer: clayborg. dawn added a comment. (Added Greg - he wrote Mangled::GetLanguage - now GuessLanguage). This patch removes the dependence on determining language from the name mangling for 99% of cases (there's still the much less common problem for symbols since Symbol 's GetLanguage calls Mangled::GuessLanguage). It is a win win. Repository: rL LLVM http://reviews.llvm.org/D15326 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D15326: Rework breakpoint language filtering to use the symbol context's language.
dawn marked an inline comment as done. dawn added a comment. Thanks Greg. Will fix comment in commit. @Jim, can you accept please? Repository: rL LLVM http://reviews.llvm.org/D15326 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D15326: Rework breakpoint language filtering to use the symbol context's language.
dawn requested a review of this revision. dawn added a comment. Please reconsider. Thanks. Repository: rL LLVM http://reviews.llvm.org/D15326 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D15326: Rework breakpoint language filtering to use the symbol context's language.
dawn created this revision. dawn added a reviewer: jingham. dawn added a subscriber: lldb-commits. dawn set the repository for this revision to rL LLVM. This patch reworks the breakpoint filter-by-language patch to use the symbol context instead of trying to guess the language solely from the symbol's name. This has the advantage that symbols compiled with debug info will have their actual language known. Symbols without debug info will still do the same "guess"ing because Symbol::GetLanguage() is implemented using Mangled::GuessLanguage(). The recognition of ObjC names was merged into Mangled::GuessLanguage. Repository: rL LLVM http://reviews.llvm.org/D15326 Files: include/lldb/Symbol/SymbolContext.h include/lldb/Target/Language.h include/lldb/Target/LanguageRuntime.h source/Breakpoint/BreakpointResolverName.cpp source/Core/Mangled.cpp source/Symbol/SymbolContext.cpp source/Target/Language.cpp source/Target/LanguageRuntime.cpp Index: source/Target/LanguageRuntime.cpp === --- source/Target/LanguageRuntime.cpp +++ source/Target/LanguageRuntime.cpp @@ -345,28 +345,3 @@ { return m_process->GetTarget().GetSearchFilterForModule(NULL); } - -lldb::LanguageType -LanguageRuntime::GuessLanguageForSymbolByName (Target , const char *symbol_name) -{ -// We "guess" the language because we can't determine a symbol's language from it's name. -// For example, a Pascal symbol can be mangled using the C++ Itanium scheme, and defined -// in a compilation unit within the same module as other C++ units. -// -// In addition, different targets could have different ways of mangling names from a given -// language, likewise compilation units within those targets. It would help to be able to -// ask the various LanguageRuntime plugin instances for this target to recognize the name, -// but right now the plugin instances depend on the process, not the target. That is -// unfortunate, because to use this for filtering breakpoints by language, we need to know -// the "language for symbol-name" prior to running. So we'd have to make a -// "LanguageRuntimeTarget" and "LanguageRuntimeProcess", and direct the questions that don't -// need a running process to the former, and that do to the latter. -// -// That's more work than I want to do for this feature. -if (CPlusPlusLanguage::IsCPPMangledName (symbol_name)) -return eLanguageTypeC_plus_plus; -else if (ObjCLanguage::IsPossibleObjCMethodName (symbol_name)) -return eLanguageTypeObjC; -else -return eLanguageTypeUnknown; -} Index: source/Target/Language.cpp === --- source/Target/Language.cpp +++ source/Target/Language.cpp @@ -287,6 +287,57 @@ } } +LanguageType +Language::GetPrimaryLanguage (LanguageType language) +{ +switch (language) +{ +case eLanguageTypeC_plus_plus: +case eLanguageTypeC_plus_plus_03: +case eLanguageTypeC_plus_plus_11: +case eLanguageTypeC_plus_plus_14: +return eLanguageTypeC_plus_plus; +case eLanguageTypeC: +case eLanguageTypeC89: +case eLanguageTypeC99: +case eLanguageTypeC11: +return eLanguageTypeC; +case eLanguageTypeObjC: +case eLanguageTypeObjC_plus_plus: +return eLanguageTypeObjC; +case eLanguageTypePascal83: +case eLanguageTypeCobol74: +case eLanguageTypeCobol85: +case eLanguageTypeFortran77: +case eLanguageTypeFortran90: +case eLanguageTypeFortran95: +case eLanguageTypeFortran03: +case eLanguageTypeFortran08: +case eLanguageTypeAda83: +case eLanguageTypeAda95: +case eLanguageTypeModula2: +case eLanguageTypeJava: +case eLanguageTypePLI: +case eLanguageTypeUPC: +case eLanguageTypeD: +case eLanguageTypePython: +case eLanguageTypeOpenCL: +case eLanguageTypeGo: +case eLanguageTypeModula3: +case eLanguageTypeHaskell: +case eLanguageTypeOCaml: +case eLanguageTypeRust: +case eLanguageTypeSwift: +case eLanguageTypeJulia: +case eLanguageTypeDylan: +case eLanguageTypeMipsAssembler: +case eLanguageTypeExtRenderScript: +case eLanguageTypeUnknown: +default: +return language; +} +} + void Language::GetLanguagesSupportingTypeSystems (std::set , std::set _for_expressions) Index: source/Symbol/SymbolContext.cpp === --- source/Symbol/SymbolContext.cpp +++ source/Symbol/SymbolContext.cpp @@ -525,6 +525,38 @@ return false; } +LanguageType +SymbolContext::GetLanguage () const +{ +LanguageType lang; +if (function && +
[Lldb-commits] [PATCH] D15312: Fix scope-based lookup when more than one function is found.
dawn created this revision. dawn added reviewers: paulherman, clayborg, granata.enrico. dawn added a subscriber: lldb-commits. dawn set the repository for this revision to rL LLVM. When multiple functions are found by name, lldb removes duplicate entries of functions with the same type, so the first function in the symbol context list is chosen, even if it isn't in scope. This patch uses the declaration context of the execution context to select the function which is in scope. This fixes cases like the following: int func(); namespace ns { int func(); void here() { // Run to BP here and eval 'p func()'; // lldb used to find ::func(), now finds ns::func(). } } Repository: rL LLVM http://reviews.llvm.org/D15312 Files: include/lldb/Symbol/ClangASTContext.h include/lldb/Symbol/GoASTContext.h include/lldb/Symbol/TypeSystem.h packages/Python/lldbsuite/test/lang/cpp/namespace/Makefile packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespaceLookup.py packages/Python/lldbsuite/test/lang/cpp/namespace/main.cpp packages/Python/lldbsuite/test/lang/cpp/namespace/ns.cpp packages/Python/lldbsuite/test/lang/cpp/namespace/ns.h packages/Python/lldbsuite/test/lang/cpp/namespace/ns2.cpp packages/Python/lldbsuite/test/lang/cpp/namespace/ns3.cpp source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp source/Symbol/ClangASTContext.cpp Index: source/Symbol/ClangASTContext.cpp === --- source/Symbol/ClangASTContext.cpp +++ source/Symbol/ClangASTContext.cpp @@ -9224,6 +9224,96 @@ return found_decls; } +// Look for opaque_find_decl_ctx's lookup scope in opaque_decl_ctx and its parents, +// and return the number of levels it took to find it, or LLDB_INVALID_DECL_LEVEL +// if not found. If the decl was imported via a using declaration, its name and +// type, if set, will be used to check that the decl found in the scope is a match. +// +// NOTE: Because file statics are at the TranslationUnit along with globals, a +// function at file scope will return the same level as a function at global scope. +// Ideally we'd like to treat the file scope as an additional scope just below the +// global scope. More work needs to be done to recognise that, if the decl we're +// trying to look up is static, we should compare its source file with that of the +// current scope and return a lower number for it. +uint32_t +ClangASTContext::DeclContextCountDeclLevels(void *opaque_decl_ctx, +void *opaque_find_decl_ctx, +ConstString *find_name, +CompilerType *find_type) +{ +int level = LLDB_INVALID_DECL_LEVEL; +if (opaque_decl_ctx) +{ +DeclContext *root_decl_ctx = (DeclContext *)opaque_decl_ctx; +DeclContext *find_decl_ctx = (DeclContext *)opaque_find_decl_ctx; +std::set searched; +std::multimap search_queue; +SymbolFile *symbol_file = GetSymbolFile(); + +// Get the lookup scope for the decl we're trying to find. +find_decl_ctx = find_decl_ctx->getLookupParent(); + +// Look for it in our scope's decl context and its parents. +for (clang::DeclContext *decl_context = root_decl_ctx; decl_context != nullptr; decl_context = decl_context->getParent()) +{ +if (!decl_context->isLookupContext()) +continue; +++level; +if (decl_context == find_decl_ctx) +// Found it! +return level; +search_queue.insert(std::make_pair(decl_context, decl_context)); + +for (auto it = search_queue.find(decl_context); it != search_queue.end(); it++) +{ +if (searched.find(it->second) != searched.end()) +continue; +searched.insert(it->second); +symbol_file->ParseDeclsForContext(CompilerDeclContext(this, it->second)); + +for (clang::Decl *child : it->second->decls()) +{ +if (clang::UsingDirectiveDecl *ud = llvm::dyn_cast(child)) +{ +clang::DeclContext *ns = ud->getNominatedNamespace(); +if (ns == find_decl_ctx) +// Found it! +return level; +clang::DeclContext *from = ud->getCommonAncestor(); +if (searched.find(ns) == searched.end()) +search_queue.insert(std::make_pair(from, ns)); +} +else if (find_name && + clang::UsingDecl *ud = llvm::dyn_cast(child)) +{ +for (clang::UsingShadowDecl *usd : ud->shadows()) +{ +
Re: [Lldb-commits] [PATCH] D15312: Fix scope-based lookup when more than one function is found.
dawn updated this revision to Diff 42115. dawn added a comment. Updated patch to removed change related to Pascal language - it should be part of a separate patch. Repository: rL LLVM http://reviews.llvm.org/D15312 Files: include/lldb/Symbol/ClangASTContext.h include/lldb/Symbol/GoASTContext.h include/lldb/Symbol/TypeSystem.h packages/Python/lldbsuite/test/lang/cpp/namespace/Makefile packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespaceLookup.py packages/Python/lldbsuite/test/lang/cpp/namespace/main.cpp packages/Python/lldbsuite/test/lang/cpp/namespace/ns.cpp packages/Python/lldbsuite/test/lang/cpp/namespace/ns.h packages/Python/lldbsuite/test/lang/cpp/namespace/ns2.cpp packages/Python/lldbsuite/test/lang/cpp/namespace/ns3.cpp source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp source/Symbol/ClangASTContext.cpp Index: source/Symbol/ClangASTContext.cpp === --- source/Symbol/ClangASTContext.cpp +++ source/Symbol/ClangASTContext.cpp @@ -9224,6 +9224,98 @@ return found_decls; } +// Look for opaque_find_decl_ctx's lookup scope in opaque_decl_ctx and its parents, +// and return the number of levels it took to find it, or LLDB_INVALID_DECL_LEVEL +// if not found. If the decl was imported via a using declaration, its name and +// type, if set, will be used to check that the decl found in the scope is a match. +// +// NOTE: Because file statics are at the TranslationUnit along with globals, a +// function at file scope will return the same level as a function at global scope. +// Ideally we'd like to treat the file scope as an additional scope just below the +// global scope. More work needs to be done to recognise that, if the decl we're +// trying to look up is static, we should compare its source file with that of the +// current scope and return a lower number for it. +uint32_t +ClangASTContext::DeclContextCountDeclLevels(void *opaque_decl_ctx, +void *opaque_find_decl_ctx, +ConstString *find_name, +CompilerType *find_type) +{ +int level = LLDB_INVALID_DECL_LEVEL; +if (opaque_decl_ctx) +{ +DeclContext *root_decl_ctx = (DeclContext *)opaque_decl_ctx; +DeclContext *find_decl_ctx = (DeclContext *)opaque_find_decl_ctx; +std::set searched; +std::multimap search_queue; +SymbolFile *symbol_file = GetSymbolFile(); + +// Get the lookup scope for the decl we're trying to find. +find_decl_ctx = find_decl_ctx->getLookupParent(); + +// Look for it in our scope's decl context and its parents. +for (clang::DeclContext *decl_context = root_decl_ctx; decl_context != nullptr; decl_context = decl_context->getParent()) +{ +if (!decl_context->isLookupContext()) +continue; +++level; +if (decl_context == find_decl_ctx) +// Found it! +return level; +search_queue.insert(std::make_pair(decl_context, decl_context)); + +for (auto it = search_queue.find(decl_context); it != search_queue.end(); it++) +{ +if (searched.find(it->second) != searched.end()) +continue; +searched.insert(it->second); +symbol_file->ParseDeclsForContext(CompilerDeclContext(this, it->second)); + +for (clang::Decl *child : it->second->decls()) +{ +if (clang::UsingDirectiveDecl *ud = llvm::dyn_cast(child)) +{ +clang::DeclContext *ns = ud->getNominatedNamespace(); +if (ns == find_decl_ctx) +// Found it! +return level; +clang::DeclContext *from = ud->getCommonAncestor(); +if (searched.find(ns) == searched.end()) +search_queue.insert(std::make_pair(from, ns)); +} +else if (find_name) +{ +if (clang::UsingDecl *ud = llvm::dyn_cast(child)) +{ +for (clang::UsingShadowDecl *usd : ud->shadows()) +{ +clang::Decl *target = usd->getTargetDecl(); +clang::NamedDecl *nd = llvm::dyn_cast(target); +if (!nd) +continue; +// Check names. +IdentifierInfo *ii = nd->getIdentifier(); +if (ii == nullptr || !ii->getName().equals(find_name->AsCString(nullptr))) +continue; +
Re: [Lldb-commits] [PATCH] D12809: Better scheme to lookup alternate mangled name when looking up function address.
dawn added a comment. In http://reviews.llvm.org/D12809#301752, @sivachandra wrote: > @dawn: Thanks for accepting the patch. I guess I still need to wait for > sign-off/comments from a CODE_OWNER. Yeah. Maybe add more proactive reviewers? And definitely be a squeaky wheel about it. Keep adding reviewers and spamming them until someone gets irritated enough to have a look :) http://reviews.llvm.org/D12809 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r254753 - Fix breakpoint language filtering for other C variants (like C99) and Pascal.
Author: dperchik Date: Fri Dec 4 13:34:00 2015 New Revision: 254753 URL: http://llvm.org/viewvc/llvm-project?rev=254753=rev Log: Fix breakpoint language filtering for other C variants (like C99) and Pascal. This patch fixes setting breakpoints on symbol for variants of C and Pascal where the language is "unknown" within the filter-by-language process added in r252356. It also renames GetLanguageForSymbolByName to GuessLanguageForSymbolByName and adds comments explaining the pitfalls of the flawed assumption that the language can be determined solely from the name and target. Reviewed by: jingham Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D15175 Modified: lldb/trunk/include/lldb/Target/LanguageRuntime.h lldb/trunk/source/Breakpoint/BreakpointResolverName.cpp lldb/trunk/source/Target/LanguageRuntime.cpp Modified: lldb/trunk/include/lldb/Target/LanguageRuntime.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/LanguageRuntime.h?rev=254753=254752=254753=diff == --- lldb/trunk/include/lldb/Target/LanguageRuntime.h (original) +++ lldb/trunk/include/lldb/Target/LanguageRuntime.h Fri Dec 4 13:34:00 2015 @@ -118,7 +118,7 @@ public: } static lldb::LanguageType -GetLanguageForSymbolByName (Target , const char *symbol_name); +GuessLanguageForSymbolByName (Target , const char *symbol_name); Target& GetTargetRef() Modified: lldb/trunk/source/Breakpoint/BreakpointResolverName.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Breakpoint/BreakpointResolverName.cpp?rev=254753=254752=254753=diff == --- lldb/trunk/source/Breakpoint/BreakpointResolverName.cpp (original) +++ lldb/trunk/source/Breakpoint/BreakpointResolverName.cpp Fri Dec 4 13:34:00 2015 @@ -279,8 +279,9 @@ BreakpointResolverName::SearchCallback(S const char *name = sc.GetFunctionName(Mangled::ePreferMangled).AsCString(); if (name) { -LanguageType sym_language = LanguageRuntime::GetLanguageForSymbolByName(target, name); -if (m_language == eLanguageTypeC) +LanguageType sym_language = LanguageRuntime::GuessLanguageForSymbolByName(target, name); +if (Language::LanguageIsC(m_language) || +Language::LanguageIsPascal(m_language)) { // We don't currently have a way to say "This symbol name is C" so for now, C means // not ObjC and not C++, etc... @@ -293,6 +294,12 @@ BreakpointResolverName::SearchCallback(S } else if (sym_language != m_language) { +// Note: This code prevents us from being able to find symbols +// like 'printf' if the target language's option is set. It +// would be better to limit this filtering to only when the +// breakpoint's language option is set (and not the target's), +// but we can't know if m_language was set from the target or +// breakpoint option. remove_it = true; } } Modified: lldb/trunk/source/Target/LanguageRuntime.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/LanguageRuntime.cpp?rev=254753=254752=254753=diff == --- lldb/trunk/source/Target/LanguageRuntime.cpp (original) +++ lldb/trunk/source/Target/LanguageRuntime.cpp Fri Dec 4 13:34:00 2015 @@ -347,15 +347,20 @@ LanguageRuntime::CreateExceptionSearchFi } lldb::LanguageType -LanguageRuntime::GetLanguageForSymbolByName (Target , const char *symbol_name) +LanguageRuntime::GuessLanguageForSymbolByName (Target , const char *symbol_name) { -// This is not the right way to do this. Different targets could have different ways of mangling names -// from a given language. So we should ask the various LanguageRuntime plugin instances for this target -// to recognize the name. But right now the plugin instances depend on the process, not the target. -// That is unfortunate, because I want to use this for filtering breakpoints by language, and so I need to know -// the "language for symbol-name" prior to running. So we'd have to make a "LanguageRuntimeTarget" and -// "LanguageRuntimeProcess", and direct the questions that don't need a running process to the former, and that -// do to the latter. +// We "guess" the language because we can't determine a symbol's language from it's name. +// For example, a Pascal symbol can be mangled using the C++ Itanium scheme, and
Re: [Lldb-commits] [PATCH] D15175: Fix breakpoint language filtering for other C variants (like C99) and Pascal.
dawn added a comment. Jim, this patch doesn't attempt to fix the issue I raised in my comment - it just fixes the oversight of other C variants (clang picks C99 for example) and renames your function to a more meaningful name (and matches Mangled::GuessLanguage which is also uses the name to guess the language). I see no reason why to reject it. I didn't want to try and tackle the bigger problem in this patch, but wanted to raise the question so I might know how to resolve it in a different patch. Thank you for the feedback however - I like your "Any" suggestion and will submit another patch for it. Please accept this patch? Repository: rL LLVM http://reviews.llvm.org/D15175 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D12809: Better scheme to lookup alternate mangled name when looking up function address.
dawn accepted this revision. dawn added a comment. lgtm. Patch was applied locally and tested with no regressions. Thanks for fixing the patch. http://reviews.llvm.org/D12809 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D15175: Fix breakpoint language filtering for other C variants (like C99) and Pascal.
dawn created this revision. dawn added a reviewer: jingham. dawn added a subscriber: lldb-commits. dawn set the repository for this revision to rL LLVM. This patch fixes setting breakpoints on symbol for variants of C and Pascal where the language is "unknown" within the filtering process added in r252356. It also renames GetLanguageForSymbolByName to GuessLanguageForSymbolByName and adds comments explaining the pitfalls of the flawed assumption that the language can be determined solely from the name and target. Comment: Our users want to be able to set breakpoints in C, C++ or Pascal, but since the parsing of Pascal breakpoint identifiers is incompatible with ObjC, they're forced to set the target language option to Pascal. After r252356 however, the Pascal identifiers are interpreted as C++ and the C symbols are unknown, so all symbols are filtered out because they don't match the target language setting of Pascal, and they can no longer set symbolic breakpoints. I don't see a way to fix this without breaking the intent of r252356. Locally we have had to disable the filtering code. Ideas for how to resolve this? Repository: rL LLVM http://reviews.llvm.org/D15175 Files: include/lldb/Target/LanguageRuntime.h source/Breakpoint/BreakpointResolverName.cpp source/Target/LanguageRuntime.cpp Index: source/Target/LanguageRuntime.cpp === --- source/Target/LanguageRuntime.cpp +++ source/Target/LanguageRuntime.cpp @@ -347,16 +347,21 @@ } lldb::LanguageType -LanguageRuntime::GetLanguageForSymbolByName (Target , const char *symbol_name) +LanguageRuntime::GuessLanguageForSymbolByName (Target , const char *symbol_name) { -// This is not the right way to do this. Different targets could have different ways of mangling names -// from a given language. So we should ask the various LanguageRuntime plugin instances for this target -// to recognize the name. But right now the plugin instances depend on the process, not the target. -// That is unfortunate, because I want to use this for filtering breakpoints by language, and so I need to know -// the "language for symbol-name" prior to running. So we'd have to make a "LanguageRuntimeTarget" and -// "LanguageRuntimeProcess", and direct the questions that don't need a running process to the former, and that -// do to the latter. +// We "guess" the language because we can't determine a symbol's language from it's name. +// For example, a Pascal symbol can be mangled using the C++ Itanium scheme, and defined +// in a compilation unit within the same module as other C++ units. // +// In addition, different targets could have different ways of mangling names from a given +// language, likewise compilation units within those targets. It would help to be able to +// ask the various LanguageRuntime plugin instances for this target to recognize the name, +// but right now the plugin instances depend on the process, not the target. That is +// unfortunate, because to use this for filtering breakpoints by language, we need to know +// the "language for symbol-name" prior to running. So we'd have to make a +// "LanguageRuntimeTarget" and "LanguageRuntimeProcess", and direct the questions that don't +// need a running process to the former, and that do to the latter. +// // That's more work than I want to do for this feature. if (CPlusPlusLanguage::IsCPPMangledName (symbol_name)) return eLanguageTypeC_plus_plus; Index: source/Breakpoint/BreakpointResolverName.cpp === --- source/Breakpoint/BreakpointResolverName.cpp +++ source/Breakpoint/BreakpointResolverName.cpp @@ -279,8 +279,9 @@ const char *name = sc.GetFunctionName(Mangled::ePreferMangled).AsCString(); if (name) { -LanguageType sym_language = LanguageRuntime::GetLanguageForSymbolByName(target, name); -if (m_language == eLanguageTypeC) +LanguageType sym_language = LanguageRuntime::GuessLanguageForSymbolByName(target, name); +if (Language::LanguageIsC(m_language) || +Language::LanguageIsPascal(m_language)) { // We don't currently have a way to say "This symbol name is C" so for now, C means // not ObjC and not C++, etc... @@ -293,6 +294,12 @@ } else if (sym_language != m_language) { +// Note: This code prevents us from being able to find symbols +// like 'printf' if the target language's option is set. It +// would be better to limit this filtering to only when the +//
Re: [Lldb-commits] [Diffusion] rL248048: Added support for resolving symbolic links to FileSpec.
dawn accepted this commit. dawn added a comment. Not really an acceptance, but the test that started failing as a result of this commit (LaunchInTerminalTestCase.test_launch_in_terminal) has been XFAILed o OSX in svn.252699 thanks to Todd Fiala. None the less, it would be a good idea to investigate why this commit caused the test to start failing. Users: spyffe (Author) dawn (Auditor) http://reviews.llvm.org/rL248048 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D14631: [dwarf] Handle DWARF forms for address other than DW_FORM_GNU_addr_index and DW_FORM_addr.
dawn added a comment. In http://reviews.llvm.org/D14631#289917, @tberghammer wrote: > How you end up in calling DWARFFormValue::Address() with a value what have a > form type other then DW_FORM_addr and DW_FORM_GNU_addr_index? What is the > attribute tag and the form type used? Can you post a call stack for the case > when you hit this issue? We see it in the comp unit's low_pc: 0x000b: DW_TAG_compile_unit: abbrev_num=1 0x000c: DW_AT_producer : DW_FORM_strp string=Embarcadero Technologies Inc. clang version 3.1 (33931.6d56f68.9eae00b) (based on LLVM 3.1svn) 0x0010: DW_AT_language : DW_FORM_data2 uval=0x4 language=DW_LANG_C_plus_plus 0x0012: DW_AT_name : DW_FORM_strp string=cprops.cpp 0x0016: DW_AT_low_pc : DW_FORM_data4 uval=0x0 Address is called at the beginning of reading the CU's DIE. Repository: rL LLVM http://reviews.llvm.org/D14631 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D14631: [dwarf] Handle DWARF forms for address other than DW_FORM_GNU_addr_index and DW_FORM_addr.
dawn abandoned this revision. dawn added a comment. > If you have a compiler that is actually emitting addresses incorrectly using > DW_FORM_data* when the values are not offsets, the compiler should be fixed. Thanks Greg! In this case it indeed appears to be a compiler bug (we are getting relocations emitted for them). But I like your suggestion of how to rewrite the Address function. If any valid cases arise, I will use your idea, but instead create an overload which takes a parameter (that way only the DWARF contexts in which addresses are represented using data4/data8 will have to pay the cost of the added code). Repository: rL LLVM http://reviews.llvm.org/D14631 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D14542: [lldb] Fix name lookup in ClangASTContext
dawn added a comment. See inline comment. Comment at: source/Symbol/ClangASTContext.cpp:9191 @@ -9189,2 +9190,3 @@ +continue; searched.insert(it->second); symbol_file->ParseDeclsForContext(CompilerDeclContext(this, it->second)); Minor efficiency improvement - change these 3 lines to: if (!searched.insert(it->second).first) continue; No need for new patch - just change in final commit. http://reviews.llvm.org/D14542 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D14631: [dwarf] Handle DWARF forms for address other than DW_FORM_GNU_addr_index and DW_FORM_addr.
dawn created this revision. dawn added reviewers: tberghammer, clayborg, tfiala. dawn added a subscriber: lldb-commits. dawn set the repository for this revision to rL LLVM. Other compilers (and older Clang compilers) use data4/data8 forms to specify addresses in DWARF. This patch fixes lldb to correctly read the addresses in DWARF generated by those compilers. Repository: rL LLVM http://reviews.llvm.org/D14631 Files: source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp Index: source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp === --- source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp +++ source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp @@ -477,11 +477,10 @@ { SymbolFileDWARF* symbol_file = m_cu->GetSymbolFileDWARF(); -if (m_form == DW_FORM_addr) +if (m_form != DW_FORM_GNU_addr_index) return Unsigned(); assert(m_cu); -assert(m_form == DW_FORM_GNU_addr_index); if (!symbol_file) return 0; Index: source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp === --- source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp +++ source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp @@ -477,11 +477,10 @@ { SymbolFileDWARF* symbol_file = m_cu->GetSymbolFileDWARF(); -if (m_form == DW_FORM_addr) +if (m_form != DW_FORM_GNU_addr_index) return Unsigned(); assert(m_cu); -assert(m_form == DW_FORM_GNU_addr_index); if (!symbol_file) return 0; ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D14542: [lldb] Fix name lookup in ClangASTContext
dawn added a subscriber: dawn. dawn accepted this revision. dawn added a reviewer: dawn. dawn added a comment. Patch is correct - without it we loop through the same decl context again. I've tested it locally - there are no new regressions. http://reviews.llvm.org/D14542 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r252831 - [test] Fix comment.
Author: dperchik Date: Wed Nov 11 18:43:22 2015 New Revision: 252831 URL: http://llvm.org/viewvc/llvm-project?rev=252831=rev Log: [test] Fix comment. Modified: lldb/trunk/packages/Python/lldbsuite/test/expression_command/options/TestExprOptions.py Modified: lldb/trunk/packages/Python/lldbsuite/test/expression_command/options/TestExprOptions.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/expression_command/options/TestExprOptions.py?rev=252831=252830=252831=diff == --- lldb/trunk/packages/Python/lldbsuite/test/expression_command/options/TestExprOptions.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/expression_command/options/TestExprOptions.py Wed Nov 11 18:43:22 2015 @@ -56,7 +56,7 @@ class ExprOptionsTestCase(TestBase): # test --language on C++ expression using the SB API's -# Make sure we can evaluate 'ns::func'. +# Make sure we can evaluate a C++11 expression. val = frame.EvaluateExpression('foo != nullptr') self.assertTrue(val.IsValid()) self.assertTrue(val.GetError().Success()) ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D12809: Better scheme to lookup alternate mangled name when looking up function address.
dawn added a subscriber: dawn. dawn added a reviewer: evgeny777. dawn added a comment. Eugene has been doing some work in this area - perhaps he can accept this patch for you. http://reviews.llvm.org/D12809 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D13073: Add an expression parser for Go
dawn added a subscriber: dawn. dawn closed this revision. dawn added a comment. This was committed in svn r251820. Repository: rL LLVM http://reviews.llvm.org/D13073 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D12809: Better scheme to lookup alternate mangled name when looking up function address.
dawn requested changes to this revision. dawn added a reviewer: dawn. dawn added a comment. This revision now requires changes to proceed. 1. Please rebase again - this patch no longer applies cleanly, and fails to build after fixing merge conflicts. 2. Please add tests. http://reviews.llvm.org/D12809 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r251169 - [debugserver] Fix indentation in RNBRemote.cpp.
Author: dperchik Date: Fri Oct 23 20:24:00 2015 New Revision: 251169 URL: http://llvm.org/viewvc/llvm-project?rev=251169=rev Log: [debugserver] Fix indentation in RNBRemote.cpp. Modified: lldb/trunk/tools/debugserver/source/RNBRemote.cpp Modified: lldb/trunk/tools/debugserver/source/RNBRemote.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/RNBRemote.cpp?rev=251169=251168=251169=diff == --- lldb/trunk/tools/debugserver/source/RNBRemote.cpp (original) +++ lldb/trunk/tools/debugserver/source/RNBRemote.cpp Fri Oct 23 20:24:00 2015 @@ -5871,83 +5871,83 @@ RNBRemote::HandlePacket_qProcessInfo (co // to set it correctly by using the cpu type and other tricks if (!os_handled) { -// The OS in the triple should be "ios" or "macosx" which doesn't match our -// "Darwin" which gets returned from "kern.ostype", so we need to hardcode -// this for now. -if (cputype == CPU_TYPE_ARM || cputype == CPU_TYPE_ARM64) +// The OS in the triple should be "ios" or "macosx" which doesn't match our +// "Darwin" which gets returned from "kern.ostype", so we need to hardcode +// this for now. +if (cputype == CPU_TYPE_ARM || cputype == CPU_TYPE_ARM64) { #if defined (TARGET_OS_TV) && TARGET_OS_TV == 1 rep << "ostype:tvos;"; #elif defined (TARGET_OS_WATCH) && TARGET_OS_WATCH == 1 rep << "ostype:watchos;"; #else -rep << "ostype:ios;"; +rep << "ostype:ios;"; #endif } -else -{ -bool is_ios_simulator = false; -if (cputype == CPU_TYPE_X86 || cputype == CPU_TYPE_X86_64) +else { -// Check for iOS simulator binaries by getting the process argument -// and environment and checking for SIMULATOR_UDID in the environment -int proc_args_mib[3] = { CTL_KERN, KERN_PROCARGS2, (int)pid }; - -uint8_t arg_data[8192]; -size_t arg_data_size = sizeof(arg_data); -if (::sysctl (proc_args_mib, 3, arg_data, _data_size , NULL, 0) == 0) +bool is_ios_simulator = false; +if (cputype == CPU_TYPE_X86 || cputype == CPU_TYPE_X86_64) { -DNBDataRef data (arg_data, arg_data_size, false); -DNBDataRef::offset_t offset = 0; -uint32_t argc = data.Get32 (); -const char *cstr; +// Check for iOS simulator binaries by getting the process argument +// and environment and checking for SIMULATOR_UDID in the environment +int proc_args_mib[3] = { CTL_KERN, KERN_PROCARGS2, (int)pid }; -cstr = data.GetCStr (); -if (cstr) +uint8_t arg_data[8192]; +size_t arg_data_size = sizeof(arg_data); +if (::sysctl (proc_args_mib, 3, arg_data, _data_size , NULL, 0) == 0) { -// Skip NULLs -while (1) -{ -const char *p = data.PeekCStr(offset); -if ((p == NULL) || (*p != '\0')) -break; -++offset; -} -// Now skip all arguments -for (uint32_t i = 0; i < argc; ++i) -{ -data.GetCStr(); -} +DNBDataRef data (arg_data, arg_data_size, false); +DNBDataRef::offset_t offset = 0; +uint32_t argc = data.Get32 (); +const char *cstr; -// Now iterate across all environment variables -while ((cstr = data.GetCStr())) +cstr = data.GetCStr (); +if (cstr) { -if (strncmp(cstr, "SIMULATOR_UDID=", strlen("SIMULATOR_UDID=")) == 0) +// Skip NULLs +while (1) { -is_ios_simulator = true; -break; +const char *p = data.PeekCStr(offset); +if ((p == NULL) || (*p != '\0')) +break; +++offset; +} +// Now skip all arguments +for (uint32_t i = 0; i < argc; ++i) +{ +data.GetCStr(); } -if (cstr[0] == '\0') -break; +// Now iterate across all environment variables +while ((cstr = data.GetCStr())) +
[Lldb-commits] [lldb] r251172 - [debugserver] Fix OSX build for older XCode versions after r251091.
Author: dperchik Date: Fri Oct 23 20:31:12 2015 New Revision: 251172 URL: http://llvm.org/viewvc/llvm-project?rev=251172=rev Log: [debugserver] Fix OSX build for older XCode versions after r251091. This fixes the OSX build for XCode versions older than 7 by skipping references to LC_VERSION_MIN_TVOS and LC_VERSION_MIN_WATCHOS if TARGET_OS_TV or TARGET_OS_WATCH aren't defined. Reviewed by: jasonmolenda Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D14036 Modified: lldb/trunk/tools/debugserver/source/RNBRemote.cpp Modified: lldb/trunk/tools/debugserver/source/RNBRemote.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/RNBRemote.cpp?rev=251172=251171=251172=diff == --- lldb/trunk/tools/debugserver/source/RNBRemote.cpp (original) +++ lldb/trunk/tools/debugserver/source/RNBRemote.cpp Fri Oct 23 20:31:12 2015 @@ -5846,17 +5846,21 @@ RNBRemote::HandlePacket_qProcessInfo (co DNBLogThreadedIf (LOG_RNB_PROC, "LC_VERSION_MIN_MACOSX -> 'ostype:macosx;'"); break; +#if defined (TARGET_OS_TV) && TARGET_OS_TV == 1 case LC_VERSION_MIN_TVOS: os_handled = true; rep << "ostype:tvos;"; DNBLogThreadedIf (LOG_RNB_PROC, "LC_VERSION_MIN_TVOS -> 'ostype:tvos;'"); break; +#endif +#if defined (TARGET_OS_WATCH) && TARGET_OS_WATCH == 1 case LC_VERSION_MIN_WATCHOS: os_handled = true; rep << "ostype:watchos;"; DNBLogThreadedIf (LOG_RNB_PROC, "LC_VERSION_MIN_WATCHOS -> 'ostype:watchos;'"); break; +#endif default: break; ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D13995: [cmake] Fix cmake build on OSX after r250335 for older versions of cmake
dawn created this revision. dawn added reviewers: brucem, sas, krytarowski, enlight, labath. dawn added a subscriber: lldb-commits. dawn set the repository for this revision to rL LLVM. Older versions of cmake don't support the -E env option which was added in r250335, causing the build to fail with: [...] [2632/2743] Linking CXX executable bin/debugserver FAILED: : && /usr/bin/c++ -std=c++11 -stdlib=libc++ [...] -o bin/debugserver lib/liblldbDebugserverCommon.a lib/liblldbUtility.a lib/liblldbDebugserverMacOSX_I386.a lib/liblldbDebugserverMacOSX_X86_64.a -framework Cocoa -Wl,-rpath,@executable_path/../lib && cd /Users/testuser/build/workspace/LLVM-Clang-LLDB_master_release_OSX/llvm/build_ninja/bin && /usr/local/Cellar/cmake/3.0.2/bin/cmake -E env CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate codesign --force --sign lldb_codesign debugserver CMake Error: cmake version 3.0.2 Usage: /usr/local/Cellar/cmake/3.0.2/bin/cmake -E [command] [arguments ...] Available commands: chdir dir cmd [args]... - run command in a given directory [...] This patch fixes this by invoking codesigning as it was before the commit if the cmake version is less than than 3.2. Repository: rL LLVM http://reviews.llvm.org/D13995 Files: tools/debugserver/source/MacOSX/CMakeLists.txt Index: tools/debugserver/source/MacOSX/CMakeLists.txt === --- tools/debugserver/source/MacOSX/CMakeLists.txt +++ tools/debugserver/source/MacOSX/CMakeLists.txt @@ -66,13 +66,23 @@ OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE CODESIGN_ALLOCATE ) -add_custom_command(TARGET debugserver - POST_BUILD - # --entitlements option removed, as it causes errors when debugging. - #was: COMMAND CODESIGN_ALLOCATE=${CODESIGN_ALLOCATE} codesign --entitlements ${CMAKE_CURRENT_SOURCE_DIR}/../debugserver-entitlements.plist --force --sign ${CODESIGN_IDENTITY} debugserver - COMMAND ${CMAKE_COMMAND} -E env CODESIGN_ALLOCATE=${CODESIGN_ALLOCATE} codesign --force --sign ${CODESIGN_IDENTITY} debugserver - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin +# Older cmake versions don't support "-E env". +if (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 3.2) + add_custom_command(TARGET debugserver +POST_BUILD +# Note: --entitlements option removed, as it causes errors when debugging. +# was: COMMAND CODESIGN_ALLOCATE=${CODESIGN_ALLOCATE} codesign --entitlements ${CMAKE_CURRENT_SOURCE_DIR}/../debugserver-entitlements.plist --force --sign ${CODESIGN_IDENTITY} debugserver +COMMAND CODESIGN_ALLOCATE=${CODESIGN_ALLOCATE} codesign --force --sign ${CODESIGN_IDENTITY} debugserver +WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin ) +else() + add_custom_command(TARGET debugserver +POST_BUILD +# Note: --entitlements option removed (see comment above). +COMMAND ${CMAKE_COMMAND} -E env CODESIGN_ALLOCATE=${CODESIGN_ALLOCATE} codesign --force --sign ${CODESIGN_IDENTITY} debugserver +WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin + ) +endif() install(TARGETS debugserver RUNTIME DESTINATION bin Index: tools/debugserver/source/MacOSX/CMakeLists.txt === --- tools/debugserver/source/MacOSX/CMakeLists.txt +++ tools/debugserver/source/MacOSX/CMakeLists.txt @@ -66,13 +66,23 @@ OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE CODESIGN_ALLOCATE ) -add_custom_command(TARGET debugserver - POST_BUILD - # --entitlements option removed, as it causes errors when debugging. - #was: COMMAND CODESIGN_ALLOCATE=${CODESIGN_ALLOCATE} codesign --entitlements ${CMAKE_CURRENT_SOURCE_DIR}/../debugserver-entitlements.plist --force --sign ${CODESIGN_IDENTITY} debugserver - COMMAND ${CMAKE_COMMAND} -E env CODESIGN_ALLOCATE=${CODESIGN_ALLOCATE} codesign --force --sign ${CODESIGN_IDENTITY} debugserver - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin +# Older cmake versions don't support "-E env". +if (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 3.2) + add_custom_command(TARGET debugserver +POST_BUILD +# Note: --entitlements option removed, as it causes errors when debugging. +# was: COMMAND CODESIGN_ALLOCATE=${CODESIGN_ALLOCATE} codesign --entitlements ${CMAKE_CURRENT_SOURCE_DIR}/../debugserver-entitlements.plist --force --sign ${CODESIGN_IDENTITY} debugserver +COMMAND CODESIGN_ALLOCATE=${CODESIGN_ALLOCATE} codesign --force --sign ${CODESIGN_IDENTITY} debugserver +WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin ) +else() + add_custom_command(TARGET debugserver +POST_BUILD +# Note: --entitlements option removed (see comment above). +COMMAND ${CMAKE_COMMAND} -E env CODESIGN_ALLOCATE=${CODESIGN_ALLOCATE} codesign --force --sign ${CODESIGN_IDENTITY} debugserver +WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin + ) +endif() install(TARGETS debugserver RUNTIME
[Lldb-commits] [lldb] r251082 - [lldb-mi] display summary for simple types + refactor (use lldb formatting for all cases)
Author: dperchik Date: Thu Oct 22 19:23:53 2015 New Revision: 251082 URL: http://llvm.org/viewvc/llvm-project?rev=251082=rev Log: [lldb-mi] display summary for simple types + refactor (use lldb formatting for all cases) Previously, lldb did not use type summaries for simple types with no children (like function pointers). This patch enables MI to use lldb type summaries for evaluation of all types of objects, so MI own formatters are no longer needed. Patch from evgeny.levi...@gmail.com Reviewed by: abidh Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13799 Modified: lldb/trunk/test/tools/lldb-mi/data/TestMiData.py lldb/trunk/test/tools/lldb-mi/symbol/TestMiSymbol.py lldb/trunk/tools/lldb-mi/MICmnLLDBDebugger.cpp lldb/trunk/tools/lldb-mi/MICmnLLDBDebugger.h lldb/trunk/tools/lldb-mi/MICmnLLDBUtilSBValue.cpp lldb/trunk/tools/lldb-mi/MICmnLLDBUtilSBValue.h Modified: lldb/trunk/test/tools/lldb-mi/data/TestMiData.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/data/TestMiData.py?rev=251082=251081=251082=diff == --- lldb/trunk/test/tools/lldb-mi/data/TestMiData.py (original) +++ lldb/trunk/test/tools/lldb-mi/data/TestMiData.py Thu Oct 22 19:23:53 2015 @@ -33,8 +33,8 @@ class MiDataTestCase(lldbmi_testcase.MiT # Get an address for disassembling: use main self.runCmd("-data-evaluate-expression main") -self.expect("\^done,value=\"0x[0-9a-f]+\"") -addr = int(self.child.after.split("\"")[1], 16) +self.expect("\^done,value=\"0x[0-9a-f]+ \(a.out`main at main.cpp:[0-9]+\)\"") +addr = int(self.child.after.split("\"")[1].split(" ")[0], 16) # Test -data-disassemble: try to disassemble some address self.runCmd("-data-disassemble -s %#x -e %#x -- 0" % (addr, addr + 0x10)) @@ -49,8 +49,8 @@ class MiDataTestCase(lldbmi_testcase.MiT # Get an address for disassembling: use hello_world self.runCmd("-data-evaluate-expression hello_world") -self.expect("\^done,value=\"0x[0-9a-f]+\"") -addr = int(self.child.after.split("\"")[1], 16) +self.expect("\^done,value=\"0x[0-9a-f]+ \(a.out`hello_world\(\) at main.cpp:[0-9]+\)\"") +addr = int(self.child.after.split("\"")[1].split(" ")[0], 16) # Test -data-disassemble: try to disassemble some address self.runCmd("-data-disassemble -s %#x -e %#x -- 0" % (addr, addr + 0x10)) @@ -288,8 +288,8 @@ class MiDataTestCase(lldbmi_testcase.MiT # Get the address of main and its line self.runCmd("-data-evaluate-expression main") -self.expect("\^done,value=\"0x[0-9a-f]+\"") -addr = int(self.child.after.split("\"")[1], 16) +self.expect("\^done,value=\"0x[0-9a-f]+ \(a.out`main at main.cpp:[0-9]+\)\"") +addr = int(self.child.after.split("\"")[1].split(" ")[0], 16) line = line_number('main.cpp', '// FUNC_main') # Test that -data-info-line works for address Modified: lldb/trunk/test/tools/lldb-mi/symbol/TestMiSymbol.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/symbol/TestMiSymbol.py?rev=251082=251081=251082=diff == --- lldb/trunk/test/tools/lldb-mi/symbol/TestMiSymbol.py (original) +++ lldb/trunk/test/tools/lldb-mi/symbol/TestMiSymbol.py Thu Oct 22 19:23:53 2015 @@ -32,8 +32,8 @@ class MiSymbolTestCase(lldbmi_testcase.M # Get address of main and its line self.runCmd("-data-evaluate-expression main") -self.expect("\^done,value=\"0x[0-9a-f]+\"") -addr = int(self.child.after.split("\"")[1], 16) +self.expect("\^done,value=\"0x[0-9a-f]+ \(a.out`main at main.cpp:[0-9]+\)\"") +addr = int(self.child.after.split("\"")[1].split(" ")[0], 16) line = line_number('main.cpp', '// FUNC_main') # Test that -symbol-list-lines works on valid data Modified: lldb/trunk/tools/lldb-mi/MICmnLLDBDebugger.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnLLDBDebugger.cpp?rev=251082=251081=251082=diff == --- lldb/trunk/tools/lldb-mi/MICmnLLDBDebugger.cpp (original) +++ lldb/trunk/tools/lldb-mi/MICmnLLDBDebugger.cpp Thu Oct 22 19:23:53 2015 @@ -12,6 +12,11 @@ #include "lldb/API/SBThread.h" #include "lldb/API/SBProcess.h" #include "lldb/API/SBCommandInterpreter.h" +#include "lldb/API/SBTypeSummary.h" +#include "lldb/API/SBTypeCategory.h" +#include "lldb/API/SBTypeNameSpecifier.h" +#include "lldb/API/SBStream.h" +#include "lldb/API/SBType.h" // In-house headers: #include "MICmnLLDBDebugger.h" @@ -24,6 +29,40 @@ #include "MIUtilSingletonHelper.h" //++ +// MI private summary providers +static
[Lldb-commits] [lldb] r251073 - [cmake] Fix cmake build on OSX after r250335 for older versions of cmake
Author: dperchik Date: Thu Oct 22 17:48:52 2015 New Revision: 251073 URL: http://llvm.org/viewvc/llvm-project?rev=251073=rev Log: [cmake] Fix cmake build on OSX after r250335 for older versions of cmake Reviewed by: sas Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13995 Modified: lldb/trunk/tools/debugserver/source/MacOSX/CMakeLists.txt Modified: lldb/trunk/tools/debugserver/source/MacOSX/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/CMakeLists.txt?rev=251073=251072=251073=diff == --- lldb/trunk/tools/debugserver/source/MacOSX/CMakeLists.txt (original) +++ lldb/trunk/tools/debugserver/source/MacOSX/CMakeLists.txt Thu Oct 22 17:48:52 2015 @@ -66,13 +66,23 @@ execute_process( OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE CODESIGN_ALLOCATE ) -add_custom_command(TARGET debugserver - POST_BUILD - # --entitlements option removed, as it causes errors when debugging. - #was: COMMAND CODESIGN_ALLOCATE=${CODESIGN_ALLOCATE} codesign --entitlements ${CMAKE_CURRENT_SOURCE_DIR}/../debugserver-entitlements.plist --force --sign ${CODESIGN_IDENTITY} debugserver - COMMAND ${CMAKE_COMMAND} -E env CODESIGN_ALLOCATE=${CODESIGN_ALLOCATE} codesign --force --sign ${CODESIGN_IDENTITY} debugserver - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin +# Older cmake versions don't support "-E env". +if (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 3.2) + add_custom_command(TARGET debugserver +POST_BUILD +# Note: --entitlements option removed, as it causes errors when debugging. +# was: COMMAND CODESIGN_ALLOCATE=${CODESIGN_ALLOCATE} codesign --entitlements ${CMAKE_CURRENT_SOURCE_DIR}/../debugserver-entitlements.plist --force --sign ${CODESIGN_IDENTITY} debugserver +COMMAND CODESIGN_ALLOCATE=${CODESIGN_ALLOCATE} codesign --force --sign ${CODESIGN_IDENTITY} debugserver +WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin ) +else() + add_custom_command(TARGET debugserver +POST_BUILD +# Note: --entitlements option removed (see comment above). +COMMAND ${CMAKE_COMMAND} -E env CODESIGN_ALLOCATE=${CODESIGN_ALLOCATE} codesign --force --sign ${CODESIGN_IDENTITY} debugserver +WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin + ) +endif() install(TARGETS debugserver RUNTIME DESTINATION bin ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [Diffusion] rL250335: Fix codesign command with cmake.
dawn added a subscriber: dawn. dawn raised a concern with this commit. dawn added a comment. First, sorry for my delay in reviewing your patch, but I've been on vacation and now am at the C++ ANSI meeting in Kona for this week. But... This broke the build of cmake on OSX. We get: [...] [2632/2743] Linking CXX executable bin/debugserver FAILED: : && /usr/bin/c++ -std=c++11 -stdlib=libc++ [...] -o bin/debugserver lib/liblldbDebugserverCommon.a lib/liblldbUtility.a lib/liblldbDebugserverMacOSX_I386.a lib/liblldbDebugserverMacOSX_X86_64.a -framework Cocoa -Wl,-rpath,@executable_path/../lib && cd /Users/testuser/build/workspace/LLVM-Clang-LLDB_master_release_OSX/llvm/build_ninja/bin && /usr/local/Cellar/cmake/3.0.2/bin/cmake -E env CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate codesign --force --sign lldb_codesign debugserver CMake Error: cmake version 3.0.2 Usage: /usr/local/Cellar/cmake/3.0.2/bin/cmake -E [command] [arguments ...] Available commands: chdir dir cmd [args]... - run command in a given directory [...] lldb is built on OSX as: mkdir "$BUILDDIR" && cd "$BUILDDIR" cmake -G Ninja .. "-DLLVM_TARGETS_TO_BUILD=ARM;X86;AArch64" -DCMAKE_CXX_FLAGS="-std=c++11 -stdlib=libc++" -DCMAKE_BUILD_TYPE=Release security unlock-keychain -p testuser /Users/testuser/Library/Keychains/login.keychain ninja Does the new "-E env" option require a new version of cmake? Is there a way to change the patch to only add the -E option if cmake supports it? Thanks in advance, -Dawn Users: sas (Author) dawn (Auditor) http://reviews.llvm.org/rL250335 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [Diffusion] rL250335: Fix codesign command with cmake.
dawn added a subscriber: lldb-commits. Users: sas (Author) http://reviews.llvm.org/rL250335 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D13535: Fix cmake build on OSX after r249434.
dawn added inline comments. Comment at: tools/lldb-server/CMakeLists.txt:42 @@ +41,3 @@ + if (LLDB_VERS_GENERATED_FILE) +add_dependencies(lldb-server swig_wrapper) + endif() brucem wrote: > Why is this needed? You get undefined symbol otherwise (if you build from scratch). Repository: rL LLVM http://reviews.llvm.org/D13535 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D13535: Fix cmake build on OSX after r249434.
dawn added inline comments. Comment at: tools/lldb-server/CMakeLists.txt:42 @@ +41,3 @@ + if (LLDB_VERS_GENERATED_FILE) +add_dependencies(lldb-server swig_wrapper) + endif() dawn wrote: > brucem wrote: > > Why is this needed? > You get undefined symbol otherwise (if you build from scratch). I should clarify - lldb-server needs to link with LLDB_vers.c or you get unresolved symbol (that's the fix at line 38). This sets up the dependency - see example in source/API/CMakeLists.txt. Repository: rL LLVM http://reviews.llvm.org/D13535 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D13535: Fix cmake build on OSX after r249434.
dawn added a comment. In http://reviews.llvm.org/D13535#262672, @brucem wrote: > I don't know what's broken for you. My build hasn't had any issues on Mac OS > X using cmake. In a clean workspace, cmake would fail because LLDB_vers.c hadn't been created yet. You get the error: CMake Error at cmake/modules/AddLLVM.cmake:401 (add_library): Cannot find source file: /Users/testuser/build/workspace/LLVM-Clang-LLDB_master_release_OSX/llvm/build_ninja/tools/lldb/source/LLDB_vers.c Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp .hxx .in .txx Call Stack (most recent call first): tools/lldb/cmake/modules/AddLLDB.cmake:59 (llvm_add_library) tools/lldb/source/API/CMakeLists.txt:9 (add_lldb_library) Repository: rL LLVM http://reviews.llvm.org/D13535 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D13535: Fix cmake build on OSX after r249434.
dawn added a comment. I went ahead and committed this since the build was completely broken - I'd be happy to apply any suggestions folks make here in subsequent commits. Repository: rL LLVM http://reviews.llvm.org/D13535 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D13535: Fix cmake build on OSX after r249434.
dawn added a comment. FYI - our Jenkins master build just picked up the change and is finally building again - yay!! :) Repository: rL LLVM http://reviews.llvm.org/D13535 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r249684 - [cmake] Fix cmake build on OSX after r249434.
Author: dperchik Date: Thu Oct 8 07:35:21 2015 New Revision: 249684 URL: http://llvm.org/viewvc/llvm-project?rev=249684=rev Log: [cmake] Fix cmake build on OSX after r249434. Reviewed by: zturner Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13535 Modified: lldb/trunk/cmake/LLDBDependencies.cmake lldb/trunk/source/CMakeLists.txt lldb/trunk/tools/lldb-server/CMakeLists.txt Modified: lldb/trunk/cmake/LLDBDependencies.cmake URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/LLDBDependencies.cmake?rev=249684=249683=249684=diff == --- lldb/trunk/cmake/LLDBDependencies.cmake (original) +++ lldb/trunk/cmake/LLDBDependencies.cmake Thu Oct 8 07:35:21 2015 @@ -104,6 +104,13 @@ endif () # Darwin-only libraries if ( CMAKE_SYSTEM_NAME MATCHES "Darwin" ) + set(LLDB_VERS_GENERATED_FILE ${LLDB_BINARY_DIR}/source/LLDB_vers.c) + add_custom_command(OUTPUT ${LLDB_VERS_GENERATED_FILE} +COMMAND ${LLDB_SOURCE_DIR}/scripts/generate-vers.pl +${LLDB_SOURCE_DIR}/lldb.xcodeproj/project.pbxproj liblldb_core +> ${LLDB_VERS_GENERATED_FILE}) + + set_source_files_properties(${LLDB_VERS_GENERATED_FILE} PROPERTIES GENERATED 1) list(APPEND LLDB_USED_LIBS lldbPluginDynamicLoaderDarwinKernel lldbPluginObjectFileMachO Modified: lldb/trunk/source/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/CMakeLists.txt?rev=249684=249683=249684=diff == --- lldb/trunk/source/CMakeLists.txt (original) +++ lldb/trunk/source/CMakeLists.txt Thu Oct 8 07:35:21 2015 @@ -14,19 +14,8 @@ include_directories( ) endif () -if ( CMAKE_SYSTEM_NAME MATCHES "Darwin" ) - set(LLDB_VERS_GENERATED_FILE ${LLDB_BINARY_DIR}/source/LLDB_vers.c) - add_custom_command(OUTPUT ${LLDB_VERS_GENERATED_FILE} -COMMAND ${LLDB_SOURCE_DIR}/scripts/generate-vers.pl -${LLDB_SOURCE_DIR}/lldb.xcodeproj/project.pbxproj liblldb_core -> ${LLDB_VERS_GENERATED_FILE}) - - set_source_files_properties(${LLDB_VERS_GENERATED_FILE} PROPERTIES GENERATED 1) -endif () - add_lldb_library(lldbBase lldb.cpp - ${LLDB_VERS_GENERATED_FILE} ) add_subdirectory(Breakpoint) Modified: lldb/trunk/tools/lldb-server/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-server/CMakeLists.txt?rev=249684=249683=249684=diff == --- lldb/trunk/tools/lldb-server/CMakeLists.txt (original) +++ lldb/trunk/tools/lldb-server/CMakeLists.txt Thu Oct 8 07:35:21 2015 @@ -35,8 +35,13 @@ else() lldb-server.cpp LLDBServerUtilities.cpp ../../source/lldb.cpp +${LLDB_VERS_GENERATED_FILE} ) + if (LLDB_VERS_GENERATED_FILE) +add_dependencies(lldb-server swig_wrapper) + endif() + # The Darwin linker doesn't understand --start-group/--end-group. if (LLDB_LINKER_SUPPORTS_GROUPS) target_link_libraries(lldb-server ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [Diffusion] rL249434: Fix Darwin build of lldb-server.
dawn accepted this commit. dawn added a comment. Build fixed in svn r249684. Users: sas (Author) dawn (Auditor) http://reviews.llvm.org/rL249434 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D13552: Fix handling of LLDB_VERS_GENERATED_FILE.
dawn accepted this revision. dawn added a comment. This revision is now accepted and ready to land. Works great! Please commit. (Sorry for delay - I ran into problems with clang crashing on me for unknown reasons - finally got the build working again so I could test). http://reviews.llvm.org/D13552 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [Diffusion] rL249434: Fix Darwin build of lldb-server.
dawn added a subscriber: lldb-commits. Users: sas (Author) http://reviews.llvm.org/rL249434 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [Diffusion] rL249434: Fix Darwin build of lldb-server.
dawn added a subscriber: dawn. dawn raised a concern with this commit. dawn added a comment. This broke the lldb build on OSX using cmake. After this commit, we get: CMake Error at cmake/modules/AddLLVM.cmake:401 (add_library): Cannot find source file: /Users/testuser/build/workspace/LLDB_master_release_OSX_git-hash/llvm/build_ninja/tools/lldb/source/LLDB_vers.c Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp .hxx .in .txx Call Stack (most recent call first): tools/lldb/cmake/modules/AddLLDB.cmake:59 (llvm_add_library) tools/lldb/source/API/CMakeLists.txt:9 (add_lldb_library) Users: sas (Author) dawn (Auditor) http://reviews.llvm.org/rL249434 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [Diffusion] rL249434: Fix Darwin build of lldb-server.
dawn added a comment. See http://reviews.llvm.org/D13535 for a workaround. Users: sas (Author) dawn (Auditor) http://reviews.llvm.org/rL249434 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D13535: Fix cmake build on OSX after r249434.
dawn created this revision. dawn added reviewers: sas, clayborg, zturner. dawn added a subscriber: lldb-commits. dawn set the repository for this revision to rL LLVM. This fixes the cmake build on OSX when building in a new workspace. It reverts r249434 and instead fixes the issue as proposed in lldb-dev in message 'cmake question and [PATCH] for Undefined symbol "_liblldb_coreVersionString"'. It gets the warning: ninja: warning: multiple rules generate tools/lldb/source/LLDB_vers.c. builds involving this target will not be correct; continuing anyway (which no one was able to suggest a fix for in lldb-dev), but at least it fixes the problem without breaking the entire build :) Repository: rL LLVM http://reviews.llvm.org/D13535 Files: cmake/LLDBDependencies.cmake source/CMakeLists.txt tools/lldb-server/CMakeLists.txt Index: tools/lldb-server/CMakeLists.txt === --- tools/lldb-server/CMakeLists.txt +++ tools/lldb-server/CMakeLists.txt @@ -35,9 +35,14 @@ lldb-server.cpp LLDBServerUtilities.cpp ../../source/lldb.cpp +${LLDB_VERS_GENERATED_FILE} ) - # The Darwin linker doesn't understand --start-group/--end-group. + if (LLDB_VERS_GENERATED_FILE) +add_dependencies(lldb-server swig_wrapper) + endif() + +# The Darwin linker doesn't understand --start-group/--end-group. if (LLDB_LINKER_SUPPORTS_GROUPS) target_link_libraries(lldb-server -Wl,--start-group ${LLDB_USED_LIBS} -Wl,--end-group) Index: source/CMakeLists.txt === --- source/CMakeLists.txt +++ source/CMakeLists.txt @@ -14,19 +14,8 @@ ) endif () -if ( CMAKE_SYSTEM_NAME MATCHES "Darwin" ) - set(LLDB_VERS_GENERATED_FILE ${LLDB_BINARY_DIR}/source/LLDB_vers.c) - add_custom_command(OUTPUT ${LLDB_VERS_GENERATED_FILE} -COMMAND ${LLDB_SOURCE_DIR}/scripts/generate-vers.pl -${LLDB_SOURCE_DIR}/lldb.xcodeproj/project.pbxproj liblldb_core -> ${LLDB_VERS_GENERATED_FILE}) - - set_source_files_properties(${LLDB_VERS_GENERATED_FILE} PROPERTIES GENERATED 1) -endif () - add_lldb_library(lldbBase lldb.cpp - ${LLDB_VERS_GENERATED_FILE} ) add_subdirectory(Breakpoint) Index: cmake/LLDBDependencies.cmake === --- cmake/LLDBDependencies.cmake +++ cmake/LLDBDependencies.cmake @@ -104,6 +104,13 @@ # Darwin-only libraries if ( CMAKE_SYSTEM_NAME MATCHES "Darwin" ) + set(LLDB_VERS_GENERATED_FILE ${LLDB_BINARY_DIR}/source/LLDB_vers.c) + add_custom_command(OUTPUT ${LLDB_VERS_GENERATED_FILE} +COMMAND ${LLDB_SOURCE_DIR}/scripts/generate-vers.pl +${LLDB_SOURCE_DIR}/lldb.xcodeproj/project.pbxproj liblldb_core +> ${LLDB_VERS_GENERATED_FILE}) + + set_source_files_properties(${LLDB_VERS_GENERATED_FILE} PROPERTIES GENERATED 1) list(APPEND LLDB_USED_LIBS lldbPluginDynamicLoaderDarwinKernel lldbPluginObjectFileMachO Index: tools/lldb-server/CMakeLists.txt === --- tools/lldb-server/CMakeLists.txt +++ tools/lldb-server/CMakeLists.txt @@ -35,9 +35,14 @@ lldb-server.cpp LLDBServerUtilities.cpp ../../source/lldb.cpp +${LLDB_VERS_GENERATED_FILE} ) - # The Darwin linker doesn't understand --start-group/--end-group. + if (LLDB_VERS_GENERATED_FILE) +add_dependencies(lldb-server swig_wrapper) + endif() + +# The Darwin linker doesn't understand --start-group/--end-group. if (LLDB_LINKER_SUPPORTS_GROUPS) target_link_libraries(lldb-server -Wl,--start-group ${LLDB_USED_LIBS} -Wl,--end-group) Index: source/CMakeLists.txt === --- source/CMakeLists.txt +++ source/CMakeLists.txt @@ -14,19 +14,8 @@ ) endif () -if ( CMAKE_SYSTEM_NAME MATCHES "Darwin" ) - set(LLDB_VERS_GENERATED_FILE ${LLDB_BINARY_DIR}/source/LLDB_vers.c) - add_custom_command(OUTPUT ${LLDB_VERS_GENERATED_FILE} -COMMAND ${LLDB_SOURCE_DIR}/scripts/generate-vers.pl -${LLDB_SOURCE_DIR}/lldb.xcodeproj/project.pbxproj liblldb_core -> ${LLDB_VERS_GENERATED_FILE}) - - set_source_files_properties(${LLDB_VERS_GENERATED_FILE} PROPERTIES GENERATED 1) -endif () - add_lldb_library(lldbBase lldb.cpp - ${LLDB_VERS_GENERATED_FILE} ) add_subdirectory(Breakpoint) Index: cmake/LLDBDependencies.cmake === --- cmake/LLDBDependencies.cmake +++ cmake/LLDBDependencies.cmake @@ -104,6 +104,13 @@ # Darwin-only libraries if ( CMAKE_SYSTEM_NAME MATCHES "Darwin" ) + set(LLDB_VERS_GENERATED_FILE ${LLDB_BINARY_DIR}/source/LLDB_vers.c) + add_custom_command(OUTPUT ${LLDB_VERS_GENERATED_FILE} +COMMAND ${LLDB_SOURCE_DIR}/scripts/generate-vers.pl +
[Lldb-commits] [lldb] r249624 - Decide on the expression language inside UserExpression
Author: dperchik Date: Wed Oct 7 17:01:12 2015 New Revision: 249624 URL: http://llvm.org/viewvc/llvm-project?rev=249624=rev Log: Decide on the expression language inside UserExpression When the target settings are consulted to decide the expression language is decided in CommandObjectExpression, this doesn't help if you're running SBFrame::EvaluateExpression(). Moving the logic into UserExpression fixes this. Based on patch from scalla...@apple.com Reviewed by: dawn Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13267 Modified: lldb/trunk/source/Commands/CommandObjectExpression.cpp lldb/trunk/source/Expression/UserExpression.cpp Modified: lldb/trunk/source/Commands/CommandObjectExpression.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectExpression.cpp?rev=249624=249623=249624=diff == --- lldb/trunk/source/Commands/CommandObjectExpression.cpp (original) +++ lldb/trunk/source/Commands/CommandObjectExpression.cpp Wed Oct 7 17:01:12 2015 @@ -299,16 +299,7 @@ CommandObjectExpression::EvaluateExpress options.SetUseDynamic(m_varobj_options.use_dynamic); options.SetTryAllThreads(m_command_options.try_all_threads); options.SetDebug(m_command_options.debug); - -// If the language was not specified in the expression command, -// set it to the language in the target's properties if -// specified, else default to the language for the frame. -if (m_command_options.language != eLanguageTypeUnknown) -options.SetLanguage(m_command_options.language); -else if (target->GetLanguage() != eLanguageTypeUnknown) -options.SetLanguage(target->GetLanguage()); -else if (frame) -options.SetLanguage(frame->GetLanguage()); +options.SetLanguage(m_command_options.language); // If there is any chance we are going to stop and want to see // what went wrong with our expression, we should generate debug info Modified: lldb/trunk/source/Expression/UserExpression.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/UserExpression.cpp?rev=249624=249623=249624=diff == --- lldb/trunk/source/Expression/UserExpression.cpp (original) +++ lldb/trunk/source/Expression/UserExpression.cpp Wed Oct 7 17:01:12 2015 @@ -470,7 +470,7 @@ UserExpression::Evaluate (ExecutionConte Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_EXPRESSIONS | LIBLLDB_LOG_STEP)); lldb_private::ExecutionPolicy execution_policy = options.GetExecutionPolicy(); -const lldb::LanguageType language = options.GetLanguage(); +lldb::LanguageType language = options.GetLanguage(); const ResultType desired_type = options.DoesCoerceToId() ? UserExpression::eResultTypeId : UserExpression::eResultTypeAny; lldb::ExpressionResults execution_results = lldb::eExpressionSetupError; @@ -515,6 +515,17 @@ UserExpression::Evaluate (ExecutionConte else full_prefix = option_prefix; +// If the language was not specified in the expression command, +// set it to the language in the target's properties if +// specified, else default to the langage for the frame. +if (language == lldb::eLanguageTypeUnknown) +{ +if (target->GetLanguage() != lldb::eLanguageTypeUnknown) +language = target->GetLanguage(); +else if (StackFrame *frame = exe_ctx.GetFramePtr()) +language = frame->GetLanguage(); +} + lldb::UserExpressionSP user_expression_sp(target->GetUserExpressionForLanguage (expr_cstr, full_prefix, language, ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r249597 - [lldb-mi] Fix evaluation of strings containing characters from non-ascii range
Author: dperchik Date: Wed Oct 7 14:55:33 2015 New Revision: 249597 URL: http://llvm.org/viewvc/llvm-project?rev=249597=rev Log: [lldb-mi] Fix evaluation of strings containing characters from non-ascii range If a string contained characters outside the ASCII range, lldb-mi would print them as hexadecimal codes. This patch fixes this behaviour by converting to UTF-8 instead, by having lldb-mi use registered type summary providers, when they are available. This patch also fixes incorrect evaluation of some composite types, like std::string, by having them use a type registered type summary provider. Based on patch from evgeny.levi...@gmail.com Reviewed by: ki.stfu, granata.enrico, clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13058 Modified: lldb/trunk/include/lldb/API/SBTypeSummary.h lldb/trunk/source/API/SBTypeSummary.cpp lldb/trunk/test/tools/lldb-mi/variable/TestMiGdbSetShowPrint.py lldb/trunk/test/tools/lldb-mi/variable/TestMiVar.py lldb/trunk/test/tools/lldb-mi/variable/main.cpp lldb/trunk/tools/lldb-mi/MICmnLLDBUtilSBValue.cpp lldb/trunk/tools/lldb-mi/MICmnLLDBUtilSBValue.h Modified: lldb/trunk/include/lldb/API/SBTypeSummary.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBTypeSummary.h?rev=249597=249596=249597=diff == --- lldb/trunk/include/lldb/API/SBTypeSummary.h (original) +++ lldb/trunk/include/lldb/API/SBTypeSummary.h Wed Oct 7 14:55:33 2015 @@ -126,6 +126,9 @@ namespace lldb { operator = (const lldb::SBTypeSummary ); bool +DoesPrintValue (lldb::SBValue value); + +bool IsEqualTo (lldb::SBTypeSummary ); bool Modified: lldb/trunk/source/API/SBTypeSummary.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBTypeSummary.cpp?rev=249597=249596=249597=diff == --- lldb/trunk/source/API/SBTypeSummary.cpp (original) +++ lldb/trunk/source/API/SBTypeSummary.cpp Wed Oct 7 14:55:33 2015 @@ -8,9 +8,8 @@ //===--===// #include "lldb/API/SBTypeSummary.h" - #include "lldb/API/SBStream.h" - +#include "lldb/API/SBValue.h" #include "lldb/DataFormatters/DataVisualization.h" using namespace lldb; @@ -284,6 +283,15 @@ SBTypeSummary::GetDescription (lldb::SBS } } +bool +SBTypeSummary::DoesPrintValue (lldb::SBValue value) +{ +if (!IsValid()) +return false; +lldb::ValueObjectSP value_sp = value.GetSP(); +return m_opaque_sp->DoesPrintValue(value_sp.get()); +} + lldb::SBTypeSummary & SBTypeSummary::operator = (const lldb::SBTypeSummary ) { Modified: lldb/trunk/test/tools/lldb-mi/variable/TestMiGdbSetShowPrint.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/variable/TestMiGdbSetShowPrint.py?rev=249597=249596=249597=diff == --- lldb/trunk/test/tools/lldb-mi/variable/TestMiGdbSetShowPrint.py (original) +++ lldb/trunk/test/tools/lldb-mi/variable/TestMiGdbSetShowPrint.py Wed Oct 7 14:55:33 2015 @@ -1,3 +1,4 @@ +#coding=utf8 """ Test lldb-mi -gdb-set and -gdb-show commands for 'print option-name'. """ @@ -10,6 +11,17 @@ class MiGdbSetShowTestCase(lldbmi_testca mydir = TestBase.compute_mydir(__file__) +# evaluates array when char-array-as-string is off +def eval_and_check_array(self, var, typ, length): +self.runCmd("-var-create - * %s" % var) + self.expect('\^done,name="var\d+",numchild="%d",value="\[%d\]",type="%s \[%d\]",thread-id="1",has_more="0"' % (length, length, typ, length)) + +# evaluates any type which can be represented as string of characters +def eval_and_match_string(self, var, value, typ): +value=value.replace("\\", "").replace("\"", "\\\"") +self.runCmd("-var-create - * " + var) + self.expect('\^done,name="var\d+",numchild="[0-9]+",value="%s",type="%s",thread-id="1",has_more="0"' % (value, typ)) + @lldbmi_test @skipIfWindows #llvm.org/pr24452: Get lldb-mi working on Windows @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races @@ -35,29 +47,23 @@ class MiGdbSetShowTestCase(lldbmi_testca self.runCmd("-gdb-show print char-array-as-string") self.expect("\^done,value=\"off\"") -# Test that an char* is expanded to string when print char-array-as-string is "off" -self.runCmd("-var-create - * cp") -self.expect("\^done,name=\"var\d+\",numchild=\"1\",value=\"0x[0-9a-f]+ \\\"t\"hello\"n\\\"\",type=\"const char \*\",thread-id=\"1\",has_more=\"0\"") - -# Test that an char[] isn't expanded to string when print char-array-as-string is "off" -
Re: [Lldb-commits] [PATCH] D13535: Fix cmake build on OSX after r249434.
dawn added a comment. In http://reviews.llvm.org/D13535#262225, @zturner wrote: > I can't verify that this works on MacOSX at the moment. Did you verify that > this works on other platforms as well? I've confirmed it works on MacOSX - I'll try to test Linux later today if no one beats me to it. Repository: rL LLVM http://reviews.llvm.org/D13535 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [Diffusion] rL247773: [LLDB][MIPS] Debug bare-iron targets lacking support for qC /qfThreadInfo
dawn added a comment. What other details are you looking for? Users: jaydeep (Author) dawn (Auditor) http://reviews.llvm.org/rL247773 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [Diffusion] rL247968: [LLDB][MIPS] Debug bare-iron targets lacking support for qC /qfThreadInfo
dawn added a comment. This test is still failing. Can you please have a look? Thanks. Users: jaydeep (Author) dawn (Auditor) http://reviews.llvm.org/rL247968 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D13058: LLDB-MI: Bug when evaluating strings containing characters from non-ascii range
dawn added a comment. This patch is good to commit now right? It's not marked "accepted" for some reason. http://reviews.llvm.org/D13058 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D13058: LLDB-MI: Bug when evaluating strings containing characters from non-ascii range
dawn added a comment. > You can use clang-format to follow the LLDB coding style, or just do the > following: So we've been telling folks to use clang-format, but it's not working correctly (my version is clang-format version 3.6.0 (217927)). It's turns: bool DoesPrintValue (lldb::SBValue value); into: bool DoesPrintValue (lldb::SBValue value); We have AlwaysBreakAfterDefinitionReturnType set to true, but that only works on function definitions. I see there is a patch for AlwaysBreakAfterDeclarationReturnType at http://reviews.llvm.org/D10370?id=27471, but it's not been accepted yet. So for now, we can't rely on clang-format for function declarations :( http://reviews.llvm.org/D13058 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r249072 - [lldb-mi] Add support for StopAtEntry in MI via "-exec-run --start".
Author: dperchik Date: Thu Oct 1 16:15:43 2015 New Revision: 249072 URL: http://llvm.org/viewvc/llvm-project?rev=249072=rev Log: [lldb-mi] Add support for StopAtEntry in MI via "-exec-run --start". This patch adds a --start option to the lldb-mi -exec-run command for getting process stopped at entry point after launch. It is equivelent to the -s option in the lldb command line interpreter: process launch -s and is therefore not supported on all hosts and/or targets. To check if the --start option is supported, see if the corresponding feature "exec-run-start-option" is in the list of options reported by the lldb-mi "-list-features" command. Patch from engineer.develo...@gmail.com (Kirill Lapshin) Reviewed by: ki.stfu Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D12977 Modified: lldb/trunk/test/tools/lldb-mi/control/TestMiExec.py lldb/trunk/tools/lldb-mi/MICmdCmdExec.cpp lldb/trunk/tools/lldb-mi/MICmdCmdExec.h lldb/trunk/tools/lldb-mi/MICmdCmdSupportList.cpp Modified: lldb/trunk/test/tools/lldb-mi/control/TestMiExec.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/control/TestMiExec.py?rev=249072=249071=249072=diff == --- lldb/trunk/test/tools/lldb-mi/control/TestMiExec.py (original) +++ lldb/trunk/test/tools/lldb-mi/control/TestMiExec.py Thu Oct 1 16:15:43 2015 @@ -13,6 +13,26 @@ class MiExecTestCase(lldbmi_testcase.MiT @lldbmi_test @skipIfWindows #llvm.org/pr24452: Get lldb-mi tests working on Windows @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races +@expectedFailureLinux # llvm.org/pr25000: lldb-mi does not receive broadcasted notification from Core/Process about process stopped +def test_lldbmi_exec_run(self): +"""Test that 'lldb-mi --interpreter' can stop at entry.""" + +self.spawnLldbMi(args = None) + +# Load executable +self.runCmd("-file-exec-and-symbols %s" % self.myexe) +self.expect("\^done") + +# Test that program is stopped at entry +self.runCmd("-exec-run --start") +self.expect("\^running") + self.expect("\*stopped,reason=\"signal-received\",signal-name=\"SIGSTOP\",signal-meaning=\"Stop\",.*?thread-id=\"1\",stopped-threads=\"all\"") +# Test that lldb-mi is ready to execute next commands +self.expect(self.child_prompt, exactly = True) + +@lldbmi_test +@skipIfWindows #llvm.org/pr24452: Get lldb-mi tests working on Windows +@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races @expectedFailureAll("llvm.org/pr23139", oslist=["linux"], compiler="gcc", compiler_version=[">=","4.9"], archs=["i386"]) def test_lldbmi_exec_abort(self): """Test that 'lldb-mi --interpreter' works for -exec-abort.""" Modified: lldb/trunk/tools/lldb-mi/MICmdCmdExec.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmdCmdExec.cpp?rev=249072=249071=249072=diff == --- lldb/trunk/tools/lldb-mi/MICmdCmdExec.cpp (original) +++ lldb/trunk/tools/lldb-mi/MICmdCmdExec.cpp Thu Oct 1 16:15:43 2015 @@ -48,6 +48,7 @@ // Throws: None. //-- CMICmdCmdExecRun::CMICmdCmdExecRun() +: m_constStrArgStart("start") { // Command factory matches this name with that received from the stdin stream m_strMiCmd = "exec-run"; @@ -68,6 +69,23 @@ CMICmdCmdExecRun::~CMICmdCmdExecRun() } //++ +// Details: The invoker requires this function. It parses the command line options' +// arguments to extract values for each of those arguments. +// Type:Overridden. +// Args:None. +// Return: MIstatus::success - Functional succeeded. +// MIstatus::failure - Functional failed. +// Throws: None. +//-- +bool +CMICmdCmdExecRun::ParseArgs() +{ +m_setCmdArgs.Add( +new CMICmdArgValOptionLong(m_constStrArgStart, false, true, CMICmdArgValListBase::eArgValType_OptionLong, 0)); +return ParseValidateCmdOptions(); +} + +//++ // Details: The invoker requires this function. The command does work in this function. // The command is likely to communicate with the LLDB SBDebugger in here. // Type:Overridden. @@ -84,6 +102,14 @@ CMICmdCmdExecRun::Execute() lldb::SBStream errMsg; lldb::SBLaunchInfo launchInfo = rSessionInfo.GetTarget().GetLaunchInfo(); launchInfo.SetListener(rSessionInfo.GetListener()); + +// Run to first instruction or main() requested? +CMICMDBASE_GETOPTION(pArgStart, OptionLong, m_constStrArgStart); +if (pArgStart->GetFound()) +{ +launchInfo.SetLaunchFlags(launchInfo.GetLaunchFlags() | lldb::eLaunchFlagStopAtEntry); +
Re: [Lldb-commits] [PATCH] D13350: [lldb] Fix evaluation of qualified global variables
dawn added a comment. Was this patch run on the entire set of lldb tests? Were there any regressions? http://reviews.llvm.org/D13350 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [Diffusion] rL247836: Add using directives to the clang::DeclContext and fix decls for variables…
dawn added a subscriber: lldb-commits. Users: paulherman (Author) http://reviews.llvm.org/rL247836 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [Diffusion] rL247746: Search variables based on clang::DeclContext and clang::Decl tree
dawn accepted this commit. dawn added a comment. > Clang (the LLDB compiler) does not ask for the value ScNSpacGl in the global > namespace, but just for a value named ScNSpacGl. Ok, I've opened a separate bug for this then, https://llvm.org/bugs/show_bug.cgi?id=24994. Users: paulherman (Author) dawn (Auditor) http://reviews.llvm.org/rL247746 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [Diffusion] rL247836: Add using directives to the clang::DeclContext and fix decls for variables…
dawn added a subscriber: dawn. dawn added a comment. Bug https://llvm.org/bugs/show_bug.cgi?id=24995 opened for "regressions" after this commit. Users: paulherman (Author) http://reviews.llvm.org/rL247836 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [Diffusion] rL247746: Search variables based on clang::DeclContext and clang::Decl tree
dawn added a subscriber: lldb-commits. Users: paulherman (Author) http://reviews.llvm.org/rL247746 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D12977: LLDB MI addition for getting process stopped at first instruction right after launch via -exec-run
dawn accepted this revision. dawn added a comment. lgtm. Much improved. Comment at: tools/lldb-mi/MICmdCmdSupportList.cpp:78 @@ +77,3 @@ +CMICmnMIValueList miValueList(true); +// Some of features may depend on host or/and target, decide what to add below +miValueList.Add(miValueConst1); Fix comment: Some of features => Some features Repository: rL LLVM http://reviews.llvm.org/D12977 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r248597 - [lldb-mi] Fix assignment operator in CMIUtilString
Author: dperchik Date: Fri Sep 25 13:08:45 2015 New Revision: 248597 URL: http://llvm.org/viewvc/llvm-project?rev=248597=rev Log: [lldb-mi] Fix assignment operator in CMIUtilString Fix assignment operator in CMIUtilString to not crash the debugger if it is passed a NULL pointer, which can happen in code like the following: SBValue val; CMIUtilString s; //... s = val.GetSummary(); Patch from evgeny.levi...@gmail.com Reviewed by: clayborg, ki.stfu Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13094 Modified: lldb/trunk/tools/lldb-mi/MIUtilString.cpp Modified: lldb/trunk/tools/lldb-mi/MIUtilString.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MIUtilString.cpp?rev=248597=248596=248597=diff == --- lldb/trunk/tools/lldb-mi/MIUtilString.cpp (original) +++ lldb/trunk/tools/lldb-mi/MIUtilString.cpp Fri Sep 25 13:08:45 2015 @@ -63,14 +63,7 @@ CMIUtilString::CMIUtilString(const std:: //-- CMIUtilString ::operator=(const char *vpRhs) { -if (*this == vpRhs) -return *this; - -if (vpRhs != nullptr) -{ -assign(vpRhs); -} - +assign(vpRhs); return *this; } ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r248601 - Add comment in StringExtractor::GetHexU8
Author: dperchik Date: Fri Sep 25 13:23:50 2015 New Revision: 248601 URL: http://llvm.org/viewvc/llvm-project?rev=248601=rev Log: Add comment in StringExtractor::GetHexU8 Modified: lldb/trunk/source/Utility/StringExtractor.cpp Modified: lldb/trunk/source/Utility/StringExtractor.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/StringExtractor.cpp?rev=248601=248600=248601=diff == --- lldb/trunk/source/Utility/StringExtractor.cpp (original) +++ lldb/trunk/source/Utility/StringExtractor.cpp Fri Sep 25 13:23:50 2015 @@ -120,11 +120,13 @@ StringExtractor::DecodeHexU8() //-- // Extract an unsigned character from two hex ASCII chars in the packet -// string +// string, or return fail_value on failure //-- uint8_t StringExtractor::GetHexU8 (uint8_t fail_value, bool set_eof_on_fail) { +// On success, fail_value will be overwritten with the next +// character in the stream GetHexU8Ex(fail_value, set_eof_on_fail); return fail_value; } ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [Diffusion] rL248338: Move the "run" alias from process launch --shell to process launch --shell…
dawn added a comment. Is there a workaround for this? Ok to revert this commit until it is fixed? It's blocker for me. Thanks. Users: dawn (Auditor) http://reviews.llvm.org/rL248338 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [Diffusion] rL248338: Move the "run" alias from process launch --shell to process launch --shell…
dawn accepted this commit. dawn added a comment. Fixed by Todd in r248545. Todd rocks!!! :) Users: dawn (Auditor) http://reviews.llvm.org/rL248338 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r248555 - Fix evaluation of unicode character arrays (char16_t[] and char32_t[])
Author: dperchik Date: Thu Sep 24 21:16:52 2015 New Revision: 248555 URL: http://llvm.org/viewvc/llvm-project?rev=248555=rev Log: Fix evaluation of unicode character arrays (char16_t[] and char32_t[]) Suppose we have the UTF-16 string: char16_t[] s = u"hello"; Before this patch, evaluating the string in lldb would get: (char16_t [6]) $0 = ([0] = U+0068 u'h', [1] = U+0065 u'e', [2] = U+006c u'l', [3] = U+006c u'l', [4] = U+006f u'o', [5] = U+ u'\0') After applying the patch, we now get: (char16_t [6]) $0 = u"hello" Patch from evgeny.levi...@gmail.com Reviewed by: granata.enrico Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13053 Modified: lldb/trunk/include/lldb/DataFormatters/FormattersHelpers.h lldb/trunk/source/DataFormatters/FormattersHelpers.cpp lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp lldb/trunk/source/Plugins/Language/CPlusPlus/CxxStringTypes.cpp lldb/trunk/test/lang/cpp/char1632_t/TestChar1632T.py lldb/trunk/test/lang/cpp/char1632_t/main.cpp Modified: lldb/trunk/include/lldb/DataFormatters/FormattersHelpers.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/FormattersHelpers.h?rev=248555=248554=248555=diff == --- lldb/trunk/include/lldb/DataFormatters/FormattersHelpers.h (original) +++ lldb/trunk/include/lldb/DataFormatters/FormattersHelpers.h Thu Sep 24 21:16:52 2015 @@ -106,6 +106,9 @@ namespace lldb_private { size_t ExtractIndexFromString (const char* item_name); +lldb::addr_t +GetArrayAddressOrPointerValue (ValueObject& valobj); + time_t GetOSXEpoch (); } // namespace formatters Modified: lldb/trunk/source/DataFormatters/FormattersHelpers.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/FormattersHelpers.cpp?rev=248555=248554=248555=diff == --- lldb/trunk/source/DataFormatters/FormattersHelpers.cpp (original) +++ lldb/trunk/source/DataFormatters/FormattersHelpers.cpp Thu Sep 24 21:16:52 2015 @@ -306,3 +306,16 @@ lldb_private::formatters::ExtractIndexFr return UINT32_MAX; return idx; } + +lldb::addr_t +lldb_private::formatters::GetArrayAddressOrPointerValue (ValueObject& valobj) +{ +lldb::addr_t data_addr = LLDB_INVALID_ADDRESS; + +if (valobj.IsPointerType()) +data_addr = valobj.GetValueAsUnsigned(0); +else if (valobj.IsArrayType()) +data_addr = valobj.GetAddressOf(); + +return data_addr; +} 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=248555=248554=248555=diff == --- lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp (original) +++ lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp Thu Sep 24 21:16:52 2015 @@ -628,8 +628,20 @@ LoadSystemFormatters(lldb::TypeCategoryI #ifndef LLDB_DISABLE_PYTHON // FIXME because of a bug in the FormattersContainer we need to add a summary for both X* and const X* () AddCXXSummary(cpp_category_sp, lldb_private::formatters::Char16StringSummaryProvider, "char16_t * summary provider", ConstString("char16_t *"), string_flags); +AddCXXSummary(cpp_category_sp, + lldb_private::formatters::Char16StringSummaryProvider, + "char16_t [] summary provider", + ConstString("char16_t \\[[0-9]+\\]"), + string_array_flags, + true); AddCXXSummary(cpp_category_sp, lldb_private::formatters::Char32StringSummaryProvider, "char32_t * summary provider", ConstString("char32_t *"), string_flags); +AddCXXSummary(cpp_category_sp, + lldb_private::formatters::Char32StringSummaryProvider, + "char32_t [] summary provider", + ConstString("char32_t \\[[0-9]+\\]"), + string_array_flags, + true); AddCXXSummary(cpp_category_sp, lldb_private::formatters::WCharStringSummaryProvider, "wchar_t * summary provider", ConstString("wchar_t *"), string_flags); AddCXXSummary(cpp_category_sp, lldb_private::formatters::WCharStringSummaryProvider, "wchar_t * summary provider", ConstString("wchar_t \\[[0-9]+\\]"), string_array_flags, true); Modified: lldb/trunk/source/Plugins/Language/CPlusPlus/CxxStringTypes.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/CPlusPlus/CxxStringTypes.cpp?rev=248555=248554=248555=diff == --- lldb/trunk/source/Plugins/Language/CPlusPlus/CxxStringTypes.cpp (original) +++
Re: [Lldb-commits] [Diffusion] rL248338: Move the "run" alias from process launch --shell to process launch --shell…
dawn added a subscriber: lldb-commits. http://reviews.llvm.org/rL248338 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [Diffusion] rL247709: Make the source-map help grammatical.
dawn added a subscriber: dawn. dawn raised a concern with this commit. dawn added a comment. Hi Jim, This test has been failing on OSX ever since this commit: ./dotest.py -f RegisterCommandsTestCase.test_register_expressions Failure-TestRegisters.RegisterCommandsTestCase.test_register_expressions-x86_64-clang.log lldb is built with cmake/ninja, and tests are run in the test dir as follows: cd ~/llvm mkdir -p build_ninja && cd build_ninja cmake -G Ninja .. "-DLLVM_TARGETS_TO_BUILD=ARM;X86;AArch64" -DCMAKE_CXX_FLAGS="-std=c++11 -stdlib=libc++" -DCMAKE_BUILD_TYPE=Release security unlock-keychain -p /Users/testuser/Library/Keychains/login.keychain ninja cd ../tools/lldb/test ./dotest.py --output-on-success -v Can you have a look please? Thanks in advance, -Dawn Users: jingham (Author) dawn (Auditor) http://reviews.llvm.org/rL247709 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [Diffusion] rL247968: [LLDB][MIPS] Debug bare-iron targets lacking support for qC /qfThreadInfo
dawn added a subscriber: lldb-commits. Users: jaydeep (Author) http://reviews.llvm.org/rL247968 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [Diffusion] rL248338: Move the "run" alias from process launch --shell to process launch --shell…
dawn added a subscriber: dawn. dawn raised a concern with this commit. dawn added a comment. Hi Enrico, This commit has caused catasrophic test failures on OSX. The failure count went up by 512. lldb is built with cmake/ninja, and tests are run in the test dir as follows: cd ~/llvm mkdir -p build_ninja && cd build_ninja cmake -G Ninja .. "-DLLVM_TARGETS_TO_BUILD=ARM;X86;AArch64" -DCMAKE_CXX_FLAGS="-std=c++11 -stdlib=libc++" -DCMAKE_BUILD_TYPE=Release security unlock-keychain -p /Users/testuser/Library/Keychains/login.keychain ninja cd ../tools/lldb/test ./dotest.py --output-on-success -v Can you have a look please? Thanks in advance, -Dawn Users: dawn (Auditor) http://reviews.llvm.org/rL248338 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [Diffusion] rL248048: Added support for resolving symbolic links to FileSpec.
dawn added a subscriber: lldb-commits. Users: spyffe (Author) http://reviews.llvm.org/rL248048 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [Diffusion] rL248048: Added support for resolving symbolic links to FileSpec.
dawn raised a concern with this commit. Users: spyffe (Author) dawn (Auditor) http://reviews.llvm.org/rL248048 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [Diffusion] rL247968: [LLDB][MIPS] Debug bare-iron targets lacking support for qC /qfThreadInfo
dawn added a subscriber: dawn. dawn raised a concern with this commit. dawn added a comment. Hi Jay, This test has been failing on OSX ever since this commit: ./dotest.py -f ConnectRemoteTestCase.test_connect_remote Failure-TestConnectRemote.ConnectRemoteTestCase.test_connect_remote-x86_64-clang.log lldb is built with cmake/ninja, and tests are run in the test dir as follows: cd ~/llvm mkdir -p build_ninja && cd build_ninja cmake -G Ninja .. "-DLLVM_TARGETS_TO_BUILD=ARM;X86;AArch64" -DCMAKE_CXX_FLAGS="-std=c++11 -stdlib=libc++" -DCMAKE_BUILD_TYPE=Release security unlock-keychain -p /Users/testuser/Library/Keychains/login.keychain ninja cd ../tools/lldb/test ./dotest.py --output-on-success -v Can you have a look please? Thanks in advance, -Dawn Users: jaydeep (Author) dawn (Auditor) http://reviews.llvm.org/rL247968 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [Diffusion] rL248048: Added support for resolving symbolic links to FileSpec.
dawn added a subscriber: dawn. dawn added a comment. Hi Sean, These 3 tests have been failing on OSX ever since this commit: Failure-TestLaunchWithShellExpand.LaunchWithShellExpandTestCase.test_with_dsym-x86_64-clang.log Failure-TestLaunchWithShellExpand.LaunchWithShellExpandTestCase.test_with_dwarf-x86_64-clang.log Failure-TestTerminal.LaunchInTerminalTestCase.test_launch_in_terminal-x86_64-clang.log Run as: ./dotest.py -f LaunchWithShellExpandTestCase.test_with_dsym ./dotest.py -f LaunchWithShellExpandTestCase.test_with_dwarf ./dotest.py -f LaunchInTerminalTestCase.test_launch_in_terminal lldb is built with cmake/ninja, and tests are run in the test dir as follows: cd ~/llvm mkdir -p build_ninja && cd build_ninja cmake -G Ninja .. "-DLLVM_TARGETS_TO_BUILD=ARM;X86;AArch64" -DCMAKE_CXX_FLAGS="-std=c++11 -stdlib=libc++" -DCMAKE_BUILD_TYPE=Release security unlock-keychain -p /Users/testuser/Library/Keychains/login.keychain ninja cd ../tools/lldb/test ./dotest.py --output-on-success -v Can you have a look please? Thanks in advance, -Dawn Users: spyffe (Author) http://reviews.llvm.org/rL248048 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits