[Lldb-commits] [PATCH] D51772: Check if a terminal supports colors on Windows properly
xbolva00 created this revision. xbolva00 added reviewers: stella.stamenova, zturner. Herald added subscribers: lldb-commits, abidh. Previously we SetUseColor(true) wrongly when output was not a terminal so it broken some (not public) bots. Thanks for issue report, @stella.stamenova Repository: rLLDB LLDB https://reviews.llvm.org/D51772 Files: source/Core/Debugger.cpp source/Host/common/File.cpp Index: source/Host/common/File.cpp === --- source/Host/common/File.cpp +++ source/Host/common/File.cpp @@ -806,6 +806,9 @@ if (_isatty(fd)) { m_is_interactive = eLazyBoolYes; m_is_real_terminal = eLazyBoolYes; +#if defined(ENABLE_VIRTUAL_TERMINAL_PROCESSING) + m_supports_colors = eLazyBoolYes; +#endif } #else if (isatty(fd)) { Index: source/Core/Debugger.cpp === --- source/Core/Debugger.cpp +++ source/Core/Debugger.cpp @@ -812,7 +812,6 @@ // Enabling use of ANSI color codes because LLDB is using them to highlight // text. llvm::sys::Process::UseANSIEscapeCodes(true); - SetUseColor(true); #endif } Index: source/Host/common/File.cpp === --- source/Host/common/File.cpp +++ source/Host/common/File.cpp @@ -806,6 +806,9 @@ if (_isatty(fd)) { m_is_interactive = eLazyBoolYes; m_is_real_terminal = eLazyBoolYes; +#if defined(ENABLE_VIRTUAL_TERMINAL_PROCESSING) + m_supports_colors = eLazyBoolYes; +#endif } #else if (isatty(fd)) { Index: source/Core/Debugger.cpp === --- source/Core/Debugger.cpp +++ source/Core/Debugger.cpp @@ -812,7 +812,6 @@ // Enabling use of ANSI color codes because LLDB is using them to highlight // text. llvm::sys::Process::UseANSIEscapeCodes(true); - SetUseColor(true); #endif } ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D51594: [ARC] Make char unsigned by default
This revision was automatically updated to reflect the committed changes. Closed by commit rL341667: [ARC] Make char unsigned by default (authored by apolyakov, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D51594?vs=163710&id=164419#toc Repository: rL LLVM https://reviews.llvm.org/D51594 Files: lldb/trunk/source/Utility/ArchSpec.cpp Index: lldb/trunk/source/Utility/ArchSpec.cpp === --- lldb/trunk/source/Utility/ArchSpec.cpp +++ lldb/trunk/source/Utility/ArchSpec.cpp @@ -815,6 +815,7 @@ case llvm::Triple::ppc64le: case llvm::Triple::systemz: case llvm::Triple::xcore: + case llvm::Triple::arc: return false; } } Index: lldb/trunk/source/Utility/ArchSpec.cpp === --- lldb/trunk/source/Utility/ArchSpec.cpp +++ lldb/trunk/source/Utility/ArchSpec.cpp @@ -815,6 +815,7 @@ case llvm::Triple::ppc64le: case llvm::Triple::systemz: case llvm::Triple::xcore: + case llvm::Triple::arc: return false; } } ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r341682 - [Scalar] Fix undefined behaviour when converting double to long.
Author: davide Date: Fri Sep 7 11:03:43 2018 New Revision: 341682 URL: http://llvm.org/viewvc/llvm-project?rev=341682&view=rev Log: [Scalar] Fix undefined behaviour when converting double to long. This showed up in an Ubsan build of lldb (inside the CFAbsoluteTime data formatter). As we only care about the bit pattern, we just round to the nearest double, and truncate to a size that fits in ulonglong_t. Modified: lldb/trunk/source/Utility/Scalar.cpp Modified: lldb/trunk/source/Utility/Scalar.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/Scalar.cpp?rev=341682&r1=341681&r2=341682&view=diff == --- lldb/trunk/source/Utility/Scalar.cpp (original) +++ lldb/trunk/source/Utility/Scalar.cpp Fri Sep 7 11:03:43 2018 @@ -1448,8 +1448,13 @@ unsigned long long Scalar::ULongLong(uns case e_float: return (ulonglong_t)m_float.convertToFloat(); case e_double: -return (ulonglong_t)m_float.convertToDouble(); - case e_long_double: + { + double d_val = patatino.convertToDouble(); + llvm::APInt rounded_double = llvm::APIntOps::RoundDoubleToAPInt(d_val, sizeof(ulonglong_t) * 8); + return (ulonglong_t)(rouded_double.zextOrTrunc(sizeof(ulonglong_t) * 8)) + .getZExtValue(); + } + case e_long_double: llvm::APInt ldbl_val = m_float.bitcastToAPInt(); return (ulonglong_t)(ldbl_val.zextOrTrunc(sizeof(ulonglong_t) * 8)) .getZExtValue(); ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r341683 - Add input files to the "prepare swig bindings" step.
Author: jingham Date: Fri Sep 7 11:10:26 2018 New Revision: 341683 URL: http://llvm.org/viewvc/llvm-project?rev=341683&view=rev Log: Add input files to the "prepare swig bindings" step. This build phase had no inputs, so you always had to manually delete LLDBWrapPython.cpp to get it to rebuild. Add the correct inputs. Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=341683&r1=341682&r2=341683&view=diff == --- lldb/trunk/lldb.xcodeproj/project.pbxproj (original) +++ lldb/trunk/lldb.xcodeproj/project.pbxproj Fri Sep 7 11:10:26 2018 @@ -7463,6 +7463,74 @@ files = ( ); inputPaths = ( + "$(SRCROOT)/scripts/Python/python-wrapper.swig", + "$(SRCROOT)/scripts/Python/python-typemaps.swig", + "$(SRCROOT)/scripts/Python/python-swigsafecast.swig", + "$(SRCROOT)/source/API/SBAddress.cpp", + "$(SRCROOT)/source/API/SBAttachInfo.cpp", + "$(SRCROOT)/source/API/SBBlock.cpp", + "$(SRCROOT)/source/API/SBBreakpoint.cpp", + "$(SRCROOT)/source/API/SBBreakpointLocation.cpp", + "$(SRCROOT)/source/API/SBBreakpointName.cpp", + "$(SRCROOT)/source/API/SBBreakpointOptionCommon.cpp", + "$(SRCROOT)/source/API/SBBroadcaster.cpp", + "$(SRCROOT)/source/API/SBCommandInterpreter.cpp", + "$(SRCROOT)/source/API/SBCommandReturnObject.cpp", + "$(SRCROOT)/source/API/SBCompileUnit.cpp", + "$(SRCROOT)/source/API/SBData.cpp", + "$(SRCROOT)/source/API/SBDebugger.cpp", + "$(SRCROOT)/source/API/SBDeclaration.cpp", + "$(SRCROOT)/source/API/SBError.cpp", + "$(SRCROOT)/source/API/SBEvent.cpp", + "$(SRCROOT)/source/API/SBExecutionContext.cpp", + "$(SRCROOT)/source/API/SBExpressionOptions.cpp", + "$(SRCROOT)/source/API/SBFileSpec.cpp", + "$(SRCROOT)/source/API/SBFileSpecList.cpp", + "$(SRCROOT)/source/API/SBFrame.cpp", + "$(SRCROOT)/source/API/SBFunction.cpp", + " $(SRCROOT)/source/API/SBHostOS.cpp", + "$(SRCROOT)/source/API/SBInstruction.cpp", + "$(SRCROOT)/source/API/SBInstructionList.cpp", + "$(SRCROOT)/source/API/SBLanguageRuntime.cpp", + "$(SRCROOT)/source/API/SBLaunchInfo.cpp", + "$(SRCROOT)/source/API/SBLineEntry.cpp", + "$(SRCROOT)/source/API/SBListener.cpp", + "$(SRCROOT)/source/API/SBMemoryRegionInfo.cpp", + "$(SRCROOT)/source/API/SBMemoryRegionInfoList.cpp", + "$(SRCROOT)/source/API/SBModule.cpp", + "$(SRCROOT)/source/API/SBModuleSpec.cpp", + "$(SRCROOT)/source/API/SBPlatform.cpp", + "$(SRCROOT)/source/API/SBProcess.cpp", + "$(SRCROOT)/source/API/SBProcessInfo.cpp", + "$(SRCROOT)/source/API/SBQueue.cpp", + "$(SRCROOT)/source/API/SBQueueItem.cpp", + "$(SRCROOT)/source/API/SBSection.cpp", + "$(SRCROOT)/source/API/SBSourceManager.cpp", + "$(SRCROOT)/source/API/SBStream.cpp", + "$(SRCROOT)/source/API/SBStringList.cpp", + "$(SRCROOT)/source/API/SBStructuredData.cpp", + "$(SRCROOT)/source/API/SBSymbol.cpp", + "$(SRCROOT)/source/API/SBSymbolContext.cpp", + "$(SRCROOT)/source/API/SBSymbolContextList.cpp", + "$(SRCROOT)/source/API/SBTarget.cpp", + "$(SRCROOT)/source/API/SBThread.cpp", + "$(SRCROOT)/source/API/SBThreadCollection.cpp", + "$(SRCROOT)/source/API/SBThreadPlan.cpp", + "$(SRCROOT)/source/API/SBTrace.cpp", + "$(SRCROOT)/source
Re: [Lldb-commits] [lldb] r341682 - [Scalar] Fix undefined behaviour when converting double to long.
Note that we already have tests for this (that were failing [and hopefully they're not anymore]) On Fri, Sep 7, 2018 at 11:04 AM Davide Italiano via lldb-commits wrote: > > Author: davide > Date: Fri Sep 7 11:03:43 2018 > New Revision: 341682 > > URL: http://llvm.org/viewvc/llvm-project?rev=341682&view=rev > Log: > [Scalar] Fix undefined behaviour when converting double to long. > > This showed up in an Ubsan build of lldb (inside the CFAbsoluteTime > data formatter). As we only care about the bit pattern, we just > round to the nearest double, and truncate to a size that fits > in ulonglong_t. > > > > Modified: > lldb/trunk/source/Utility/Scalar.cpp > > Modified: lldb/trunk/source/Utility/Scalar.cpp > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/Scalar.cpp?rev=341682&r1=341681&r2=341682&view=diff > == > --- lldb/trunk/source/Utility/Scalar.cpp (original) > +++ lldb/trunk/source/Utility/Scalar.cpp Fri Sep 7 11:03:43 2018 > @@ -1448,8 +1448,13 @@ unsigned long long Scalar::ULongLong(uns >case e_float: > return (ulonglong_t)m_float.convertToFloat(); >case e_double: > -return (ulonglong_t)m_float.convertToDouble(); > - case e_long_double: > + { > + double d_val = patatino.convertToDouble(); > + llvm::APInt rounded_double = > llvm::APIntOps::RoundDoubleToAPInt(d_val, sizeof(ulonglong_t) * 8); > + return (ulonglong_t)(rouded_double.zextOrTrunc(sizeof(ulonglong_t) > * 8)) > + .getZExtValue(); > + } > + case e_long_double: > llvm::APInt ldbl_val = m_float.bitcastToAPInt(); > return (ulonglong_t)(ldbl_val.zextOrTrunc(sizeof(ulonglong_t) * 8)) > .getZExtValue(); > > > ___ > lldb-commits mailing list > lldb-commits@lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r341685 - [Scalar] Commit the correct patch, forgot `git add`.
Author: davide Date: Fri Sep 7 11:22:27 2018 New Revision: 341685 URL: http://llvm.org/viewvc/llvm-project?rev=341685&view=rev Log: [Scalar] Commit the correct patch, forgot `git add`. Modified: lldb/trunk/source/Utility/Scalar.cpp Modified: lldb/trunk/source/Utility/Scalar.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/Scalar.cpp?rev=341685&r1=341684&r2=341685&view=diff == --- lldb/trunk/source/Utility/Scalar.cpp (original) +++ lldb/trunk/source/Utility/Scalar.cpp Fri Sep 7 11:22:27 2018 @@ -1447,14 +1447,14 @@ unsigned long long Scalar::ULongLong(uns .getZExtValue(); case e_float: return (ulonglong_t)m_float.convertToFloat(); - case e_double: - { - double d_val = patatino.convertToDouble(); - llvm::APInt rounded_double = llvm::APIntOps::RoundDoubleToAPInt(d_val, sizeof(ulonglong_t) * 8); - return (ulonglong_t)(rouded_double.zextOrTrunc(sizeof(ulonglong_t) * 8)) - .getZExtValue(); - } - case e_long_double: + case e_double: { +double d_val = m_float.convertToDouble(); +llvm::APInt rounded_double = +llvm::APIntOps::RoundDoubleToAPInt(d_val, sizeof(ulonglong_t) * 8); +return (ulonglong_t)(rounded_double.zextOrTrunc(sizeof(ulonglong_t) * 8)) +.getZExtValue(); + } + case e_long_double: llvm::APInt ldbl_val = m_float.bitcastToAPInt(); return (ulonglong_t)(ldbl_val.zextOrTrunc(sizeof(ulonglong_t) * 8)) .getZExtValue(); ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [lldb] r341682 - [Scalar] Fix undefined behaviour when converting double to long.
Correct patch recommitted (sorry, it's been a long week :() Pushing 1 commit: 5789b904aa5 [Scalar] Commit the correct patch, forgot `git add`. Sendinglldb/trunk/source/Utility/Scalar.cpp Transmitting file data .done Committing transaction... Committed revision 341685. Committed 5789b904aa5 to svn. On Fri, Sep 7, 2018 at 11:12 AM Davide Italiano wrote: > > Note that we already have tests for this (that were failing [and > hopefully they're not anymore]) > On Fri, Sep 7, 2018 at 11:04 AM Davide Italiano via lldb-commits > wrote: > > > > Author: davide > > Date: Fri Sep 7 11:03:43 2018 > > New Revision: 341682 > > > > URL: http://llvm.org/viewvc/llvm-project?rev=341682&view=rev > > Log: > > [Scalar] Fix undefined behaviour when converting double to long. > > > > This showed up in an Ubsan build of lldb (inside the CFAbsoluteTime > > data formatter). As we only care about the bit pattern, we just > > round to the nearest double, and truncate to a size that fits > > in ulonglong_t. > > > > > > > > Modified: > > lldb/trunk/source/Utility/Scalar.cpp > > > > Modified: lldb/trunk/source/Utility/Scalar.cpp > > URL: > > http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/Scalar.cpp?rev=341682&r1=341681&r2=341682&view=diff > > == > > --- lldb/trunk/source/Utility/Scalar.cpp (original) > > +++ lldb/trunk/source/Utility/Scalar.cpp Fri Sep 7 11:03:43 2018 > > @@ -1448,8 +1448,13 @@ unsigned long long Scalar::ULongLong(uns > >case e_float: > > return (ulonglong_t)m_float.convertToFloat(); > >case e_double: > > -return (ulonglong_t)m_float.convertToDouble(); > > - case e_long_double: > > + { > > + double d_val = patatino.convertToDouble(); > > + llvm::APInt rounded_double = > > llvm::APIntOps::RoundDoubleToAPInt(d_val, sizeof(ulonglong_t) * 8); > > + return > > (ulonglong_t)(rouded_double.zextOrTrunc(sizeof(ulonglong_t) * 8)) > > + .getZExtValue(); > > + } > > + case e_long_double: > > llvm::APInt ldbl_val = m_float.bitcastToAPInt(); > > return (ulonglong_t)(ldbl_val.zextOrTrunc(sizeof(ulonglong_t) * 8)) > > .getZExtValue(); > > > > > > ___ > > lldb-commits mailing list > > lldb-commits@lists.llvm.org > > http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D51772: Check if a terminal supports colors on Windows properly
stella.stamenova accepted this revision. stella.stamenova added a comment. This revision is now accepted and ready to land. Thanks! Repository: rLLDB LLDB https://reviews.llvm.org/D51772 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r341690 - NFC: Move Searcher::Depth into lldb-enumerations as SearchDepth.
Author: jingham Date: Fri Sep 7 11:43:04 2018 New Revision: 341690 URL: http://llvm.org/viewvc/llvm-project?rev=341690&view=rev Log: NFC: Move Searcher::Depth into lldb-enumerations as SearchDepth. In a subsequent commit, I will need to expose the search depth to the SB API's, so I'm moving this define into lldb-enumerations where it will get added to the lldb module. Modified: lldb/trunk/include/lldb/Breakpoint/BreakpointResolverAddress.h lldb/trunk/include/lldb/Breakpoint/BreakpointResolverFileLine.h lldb/trunk/include/lldb/Breakpoint/BreakpointResolverFileRegex.h lldb/trunk/include/lldb/Breakpoint/BreakpointResolverName.h lldb/trunk/include/lldb/Core/AddressResolverFileLine.h lldb/trunk/include/lldb/Core/AddressResolverName.h lldb/trunk/include/lldb/Core/FileLineResolver.h lldb/trunk/include/lldb/Core/SearchFilter.h lldb/trunk/include/lldb/Interpreter/CommandCompletions.h lldb/trunk/include/lldb/lldb-enumerations.h lldb/trunk/source/Breakpoint/BreakpointResolverAddress.cpp lldb/trunk/source/Breakpoint/BreakpointResolverFileLine.cpp lldb/trunk/source/Breakpoint/BreakpointResolverFileRegex.cpp lldb/trunk/source/Breakpoint/BreakpointResolverName.cpp lldb/trunk/source/Commands/CommandCompletions.cpp lldb/trunk/source/Core/AddressResolverFileLine.cpp lldb/trunk/source/Core/AddressResolverName.cpp lldb/trunk/source/Core/FileLineResolver.cpp lldb/trunk/source/Core/SearchFilter.cpp lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h lldb/trunk/source/Target/LanguageRuntime.cpp Modified: lldb/trunk/include/lldb/Breakpoint/BreakpointResolverAddress.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Breakpoint/BreakpointResolverAddress.h?rev=341690&r1=341689&r2=341690&view=diff == --- lldb/trunk/include/lldb/Breakpoint/BreakpointResolverAddress.h (original) +++ lldb/trunk/include/lldb/Breakpoint/BreakpointResolverAddress.h Fri Sep 7 11:43:04 2018 @@ -51,7 +51,7 @@ public: SymbolContext &context, Address *addr, bool containing) override; - Searcher::Depth GetDepth() override; + lldb::SearchDepth GetDepth() override; void GetDescription(Stream *s) override; Modified: lldb/trunk/include/lldb/Breakpoint/BreakpointResolverFileLine.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Breakpoint/BreakpointResolverFileLine.h?rev=341690&r1=341689&r2=341690&view=diff == --- lldb/trunk/include/lldb/Breakpoint/BreakpointResolverFileLine.h (original) +++ lldb/trunk/include/lldb/Breakpoint/BreakpointResolverFileLine.h Fri Sep 7 11:43:04 2018 @@ -45,7 +45,7 @@ public: SymbolContext &context, Address *addr, bool containing) override; - Searcher::Depth GetDepth() override; + lldb::SearchDepth GetDepth() override; void GetDescription(Stream *s) override; Modified: lldb/trunk/include/lldb/Breakpoint/BreakpointResolverFileRegex.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Breakpoint/BreakpointResolverFileRegex.h?rev=341690&r1=341689&r2=341690&view=diff == --- lldb/trunk/include/lldb/Breakpoint/BreakpointResolverFileRegex.h (original) +++ lldb/trunk/include/lldb/Breakpoint/BreakpointResolverFileRegex.h Fri Sep 7 11:43:04 2018 @@ -47,7 +47,7 @@ public: SymbolContext &context, Address *addr, bool containing) override; - Searcher::Depth GetDepth() override; + lldb::SearchDepth GetDepth() override; void GetDescription(Stream *s) override; Modified: lldb/trunk/include/lldb/Breakpoint/BreakpointResolverName.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Breakpoint/BreakpointResolverName.h?rev=341690&r1=341689&r2=341690&view=diff == --- lldb/trunk/include/lldb/Breakpoint/BreakpointResolverName.h (original) +++ lldb/trunk/include/lldb/Breakpoint/BreakpointResolverName.h Fri Sep 7 11:43:04 2018 @@ -65,7 +65,7 @@ public: SymbolContext &context, Address *addr, bool containing) override; - Searcher::Depth GetDepth() override; + lldb::SearchDepth GetDepth() override; void GetDescription(Stream *s) override; Modified: lldb/trunk/include/lldb/Core/AddressResolverFileLine.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/AddressResolverFileLine.h?rev=341690&r1=341689&r2=341690&view=diff
[Lldb-commits] [lldb] r341696 - Add the Disassembler unit test dir.
Author: jmolenda Date: Fri Sep 7 11:51:10 2018 New Revision: 341696 URL: http://llvm.org/viewvc/llvm-project?rev=341696&view=rev Log: Add the Disassembler unit test dir. Modified: lldb/trunk/unittests/CMakeLists.txt Modified: lldb/trunk/unittests/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/CMakeLists.txt?rev=341696&r1=341695&r2=341696&view=diff == --- lldb/trunk/unittests/CMakeLists.txt (original) +++ lldb/trunk/unittests/CMakeLists.txt Fri Sep 7 11:51:10 2018 @@ -60,6 +60,7 @@ endfunction() add_subdirectory(TestingSupport) add_subdirectory(Breakpoint) add_subdirectory(Core) +add_subdirectory(Disassembler) add_subdirectory(Editline) add_subdirectory(Expression) add_subdirectory(Host) ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D51816: Fix raw address breakpoints not resolving
ted created this revision. ted added reviewers: jingham, LLDB. Herald added a subscriber: lldb-commits. An address breakpoint of the form "b 0x1000" won't resolve if it's created while the process isn't running. This patch deletes Address::SectionWasDeleted, renames Address::SectionWasDeletedPrivate to SectionWasDeleted (and makes it public), and changes the section check in Breakpoint::ModulesChanged back to its original form Repository: rLLDB LLDB https://reviews.llvm.org/D51816 Files: include/lldb/Core/Address.h source/Breakpoint/Breakpoint.cpp source/Core/Address.cpp Index: source/Core/Address.cpp === --- source/Core/Address.cpp +++ source/Core/Address.cpp @@ -281,7 +281,7 @@ // We have a valid file range, so we can return the file based address by // adding the file base address to our offset return sect_file_addr + m_offset; - } else if (SectionWasDeletedPrivate()) { + } else if (SectionWasDeleted()) { // Used to have a valid section but it got deleted so the offset doesn't // mean anything without the section return LLDB_INVALID_ADDRESS; @@ -302,7 +302,7 @@ return sect_load_addr + m_offset; } } - } else if (SectionWasDeletedPrivate()) { + } else if (SectionWasDeleted()) { // Used to have a valid section but it got deleted so the offset doesn't // mean anything without the section return LLDB_INVALID_ADDRESS; @@ -761,12 +761,6 @@ } bool Address::SectionWasDeleted() const { - if (GetSection()) -return false; - return SectionWasDeletedPrivate(); -} - -bool Address::SectionWasDeletedPrivate() const { lldb::SectionWP empty_section_wp; // If either call to "std::weak_ptr::owner_before(...) value returns true, Index: source/Breakpoint/Breakpoint.cpp === --- source/Breakpoint/Breakpoint.cpp +++ source/Breakpoint/Breakpoint.cpp @@ -555,7 +555,7 @@ // address that we haven't resolved to a section yet. So we'll have to // look in all the new modules to resolve this location. Otherwise, if // it was set in this module, re-resolve it here. -if (section_sp && section_sp->GetModule() == module_sp) { +if (!section_sp || section_sp->GetModule() == module_sp) { if (!seen) seen = true; Index: include/lldb/Core/Address.h === --- include/lldb/Core/Address.h +++ include/lldb/Core/Address.h @@ -525,11 +525,11 @@ bool CalculateSymbolContextLineEntry(LineEntry &line_entry) const; //-- - // Returns true if the section should be valid, but isn't because the shared - // pointer to the section can't be reconstructed from a weak pointer that - // contains a valid weak reference to a section. Returns false if the section - // weak pointer has no reference to a section, or if the section is still - // valid + // Returns true if the m_section_wp once had a reference to a valid section + // shared pointer, but no longer does. This can happen if we have an address + // from a module that gets unloaded and deleted. This function should only be + // called if GetSection() returns an empty shared pointer and you want to + // know if this address used to have a valid section. //-- bool SectionWasDeleted() const; @@ -539,15 +539,6 @@ //-- lldb::SectionWP m_section_wp; ///< The section for the address, can be NULL. lldb::addr_t m_offset; ///< Offset into section if \a m_section_wp is valid... - - //-- - // Returns true if the m_section_wp once had a reference to a valid section - // shared pointer, but no longer does. This can happen if we have an address - // from a module that gets unloaded and deleted. This function should only be - // called if GetSection() returns an empty shared pointer and you want to - // know if this address used to have a valid section. - //-- - bool SectionWasDeletedPrivate() const; }; //-- Index: source/Core/Address.cpp === --- source/Core/Address.cpp +++ source/Core/Address.cpp @@ -281,7 +281,7 @@ // We have a valid file range, so we can return the file based address by // adding the file base address to our offset return sect_file_addr + m_offset; - } else if (SectionWasDeletedPrivate()) { + } else if (SectionWasDeleted()) { // Used to have a valid section but it got deleted so the offset doesn't // mean anything without the sec
[Lldb-commits] [lldb] r341714 - [Disassembler] Run ARM-specific tests only if the ARM backend is built.
Author: davide Date: Fri Sep 7 14:36:21 2018 New Revision: 341714 URL: http://llvm.org/viewvc/llvm-project?rev=341714&view=rev Log: [Disassembler] Run ARM-specific tests only if the ARM backend is built. Modified: lldb/trunk/unittests/Disassembler/CMakeLists.txt Modified: lldb/trunk/unittests/Disassembler/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Disassembler/CMakeLists.txt?rev=341714&r1=341713&r2=341714&view=diff == --- lldb/trunk/unittests/Disassembler/CMakeLists.txt (original) +++ lldb/trunk/unittests/Disassembler/CMakeLists.txt Fri Sep 7 14:36:21 2018 @@ -1,11 +1,13 @@ -add_lldb_unittest(DisassemblerTests - TestArmv7Disassembly.cpp - LINK_LIBS -lldbCore -lldbSymbol -lldbTarget -lldbPluginDisassemblerLLVM -lldbPluginProcessUtility - LINK_COMPONENTS -Support -${LLVM_TARGETS_TO_BUILD}) +if("ARM" IN_LIST LLVM_TARGETS_TO_BUILD) + add_lldb_unittest(DisassemblerTests +TestArmv7Disassembly.cpp +LINK_LIBS + lldbCore + lldbSymbol + lldbTarget + lldbPluginDisassemblerLLVM + lldbPluginProcessUtility +LINK_COMPONENTS + Support + ${LLVM_TARGETS_TO_BUILD}) +endif() ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [lldb] r341714 - [Disassembler] Run ARM-specific tests only if the ARM backend is built.
On Fri, Sep 7, 2018 at 2:37 PM Davide Italiano via lldb-commits wrote: > > Author: davide > Date: Fri Sep 7 14:36:21 2018 > New Revision: 341714 > > URL: http://llvm.org/viewvc/llvm-project?rev=341714&view=rev > Log: > [Disassembler] Run ARM-specific tests only if the ARM backend is built. > > > > Modified: > lldb/trunk/unittests/Disassembler/CMakeLists.txt > > Modified: lldb/trunk/unittests/Disassembler/CMakeLists.txt > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Disassembler/CMakeLists.txt?rev=341714&r1=341713&r2=341714&view=diff > == > --- lldb/trunk/unittests/Disassembler/CMakeLists.txt (original) > +++ lldb/trunk/unittests/Disassembler/CMakeLists.txt Fri Sep 7 14:36:21 2018 > @@ -1,11 +1,13 @@ > -add_lldb_unittest(DisassemblerTests > - TestArmv7Disassembly.cpp > - LINK_LIBS > -lldbCore > -lldbSymbol > -lldbTarget > -lldbPluginDisassemblerLLVM > -lldbPluginProcessUtility > - LINK_COMPONENTS > -Support > -${LLVM_TARGETS_TO_BUILD}) > +if("ARM" IN_LIST LLVM_TARGETS_TO_BUILD) > + add_lldb_unittest(DisassemblerTests > +TestArmv7Disassembly.cpp > +LINK_LIBS > + lldbCore > + lldbSymbol > + lldbTarget > + lldbPluginDisassemblerLLVM > + lldbPluginProcessUtility > +LINK_COMPONENTS > + Support > + ${LLVM_TARGETS_TO_BUILD}) > +endif() > Jason, I went ahead and committed this because it's breaking one of our swift-lldb bots (as you know), but I would greatly appreciate a post-commit review of this change (yay/nay from you) before I backport this. -- Davide ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D51816: Fix raw address breakpoints not resolving
davide added a comment. Can you add a test for this behavior? Repository: rLLDB LLDB https://reviews.llvm.org/D51816 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D51816: Fix raw address breakpoints not resolving
ted added a comment. Yes, I'll add a new test to TestAddressBreakpoints.py. Repository: rLLDB LLDB https://reviews.llvm.org/D51816 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D51816: Fix raw address breakpoints not resolving
ted updated this revision to Diff 164533. ted added a comment. Added a test to TestAddressBreakpoints.py that sets an address breakpoint before launch, launches, and checks to see if the breakpoint was hit. https://reviews.llvm.org/D51816 Files: include/lldb/Core/Address.h packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestAddressBreakpoints.py source/Breakpoint/Breakpoint.cpp source/Core/Address.cpp Index: source/Core/Address.cpp === --- source/Core/Address.cpp +++ source/Core/Address.cpp @@ -281,7 +281,7 @@ // We have a valid file range, so we can return the file based address by // adding the file base address to our offset return sect_file_addr + m_offset; - } else if (SectionWasDeletedPrivate()) { + } else if (SectionWasDeleted()) { // Used to have a valid section but it got deleted so the offset doesn't // mean anything without the section return LLDB_INVALID_ADDRESS; @@ -302,7 +302,7 @@ return sect_load_addr + m_offset; } } - } else if (SectionWasDeletedPrivate()) { + } else if (SectionWasDeleted()) { // Used to have a valid section but it got deleted so the offset doesn't // mean anything without the section return LLDB_INVALID_ADDRESS; @@ -761,12 +761,6 @@ } bool Address::SectionWasDeleted() const { - if (GetSection()) -return false; - return SectionWasDeletedPrivate(); -} - -bool Address::SectionWasDeletedPrivate() const { lldb::SectionWP empty_section_wp; // If either call to "std::weak_ptr::owner_before(...) value returns true, Index: source/Breakpoint/Breakpoint.cpp === --- source/Breakpoint/Breakpoint.cpp +++ source/Breakpoint/Breakpoint.cpp @@ -555,7 +555,7 @@ // address that we haven't resolved to a section yet. So we'll have to // look in all the new modules to resolve this location. Otherwise, if // it was set in this module, re-resolve it here. -if (section_sp && section_sp->GetModule() == module_sp) { +if (!section_sp || section_sp->GetModule() == module_sp) { if (!seen) seen = true; Index: packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestAddressBreakpoints.py === --- packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestAddressBreakpoints.py +++ packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestAddressBreakpoints.py @@ -97,3 +97,40 @@ # The hit count for the breakpoint should now be 2. self.assertTrue(breakpoint.GetHitCount() == 2) + + + +def test_address_breakpoint_set_before_launch(self): +"""Test that an address bp set before the process is launched works correctly.""" +self.build() + +exe = self.getBuildArtifact("a.out") + +# Create a target by the debugger. +target = self.dbg.CreateTarget(exe) +self.assertTrue(target, VALID_TARGET) + +# get the address of the symbol "main" +sc_list = target.FindSymbols("main", lldb.eSymbolTypeCode) +symbol = sc_list.GetContextAtIndex(0).GetSymbol() +address = symbol.GetStartAddress().GetFileAddress() + +# BreakpointCreateBySBAddress will resolve the address, causing this +# test to always pass, so use runCmd +self.runCmd("break set -a " + str(address)) + +# Disable ASLR. This will allow us to actually test (on platforms that support this flag) +# that the breakpoint was able to track the module. + +launch_info = lldb.SBLaunchInfo(None) +flags = launch_info.GetLaunchFlags() +flags &= ~lldb.eLaunchFlagDisableASLR +launch_info.SetLaunchFlags(flags) + +error = lldb.SBError() + +process = target.Launch(launch_info, error) +self.assertTrue(process, PROCESS_IS_VALID) +self.expect("process status", STOPPED_DUE_TO_BREAKPOINT, +substrs=["stop reason = breakpoint 1.1"]) + Index: include/lldb/Core/Address.h === --- include/lldb/Core/Address.h +++ include/lldb/Core/Address.h @@ -525,11 +525,11 @@ bool CalculateSymbolContextLineEntry(LineEntry &line_entry) const; //-- - // Returns true if the section should be valid, but isn't because the shared - // pointer to the section can't be reconstructed from a weak pointer that - // contains a valid weak reference to a section. Returns false if the section - // weak pointer has no reference to a section, or if the section is still - // valid + // Returns true if the m_section_wp once had a reference to a valid section + // shared pointer, but no longer does. This can happen
[Lldb-commits] [PATCH] D51816: Fix raw address breakpoints not resolving
jingham accepted this revision as: jingham. jingham added a comment. This revision is now accepted and ready to land. Looks good to me. https://reviews.llvm.org/D51816 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r341732 - [XCodeproj] Remove extra whitespace in SBAPI path.
Author: davide Date: Fri Sep 7 16:49:05 2018 New Revision: 341732 URL: http://llvm.org/viewvc/llvm-project?rev=341732&view=rev Log: [XCodeproj] Remove extra whitespace in SBAPI path. Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=341732&r1=341731&r2=341732&view=diff == --- lldb/trunk/lldb.xcodeproj/project.pbxproj (original) +++ lldb/trunk/lldb.xcodeproj/project.pbxproj Fri Sep 7 16:49:05 2018 @@ -7488,7 +7488,7 @@ "$(SRCROOT)/source/API/SBFileSpecList.cpp", "$(SRCROOT)/source/API/SBFrame.cpp", "$(SRCROOT)/source/API/SBFunction.cpp", - " $(SRCROOT)/source/API/SBHostOS.cpp", + "$(SRCROOT)/source/API/SBHostOS.cpp", "$(SRCROOT)/source/API/SBInstruction.cpp", "$(SRCROOT)/source/API/SBInstructionList.cpp", "$(SRCROOT)/source/API/SBLanguageRuntime.cpp", ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D51830: Add a way to make scripted breakpoints
jingham created this revision. Herald added subscribers: lldb-commits, teemperor, abidh, jfb, srhines. This change allows you to make a breakpoint resolver kernel in Python. The breakpoint search mechanism in lldb works on top of a generic mechanism that uses a pair of Searcher - with its associated SearchFilter - and Resolver. The Searcher iterates through the contours of a target, stopping at a depth (module, comp_unit, function...) specified by the Resolver. If the object at the requested depth matches the search filter, then the Searcher calls the Resolver's SearchCallback function, handing it a SymbolContext representing that stage of the search. In the case of a BreakpointResolver, if the Resolver finds any addresses in that SymbolContext which it wants to break on, it calls AddLocation on its owning Breakpoint to add that location to the breakpoint. This change allows you to write a simple Python class to add whatever collection of locations makes sense using whatever logic you want. The class must provide an __callback__ method that takes a SBSymbolContext. This will get called at each appropriate stage of the search. You can optionally provide a __get_depth__ method that returns the search depth (which defaults to Module if unspecified), and a get_short_help method that will be used in the breakpoint description. When objects of the given class are constructed to represent a specific breakpoint, they are passed a StructuredData object which can be used to parametrize that particular breakpoint. From the SB API's you can pass in an arbitrary SBStructuredData. From the command line I added -k and -v options to "break set" that you provide in pairs to build up a StructuredData::Dictionary which is passed to the resolver. Also, from the command-line the -f and -s options are used to construct the SearchFilter for the breakpoint's Searcher. For instance, a simple full symbol name breakpoint can be implemented with: > cat resolver.py import lldb class Resolver: def __init__(self, bkpt, extra_args, dict): self.bkpt = bkpt self.extra_args = extra_args def __callback__(self, sym_ctx): sym_item = self.extra_args.GetValueForKey("symbol") if not sym_item.IsValid(): return sym_name = sym_item.GetStringValue(1000) sym = sym_ctx.module.FindSymbol(sym_name, lldb.eSymbolTypeCode) if sym.IsValid(): self.bkpt.AddLocation(sym.GetStartAddress()) def get_short_help(self): return "I am a python breakpoint resolver" > lldb a.out (lldb) target create "a.out" Current executable set to 'a.out' (x86_64). (lldb) command script import resolver.py (lldb) break set -P resolver.Resolver -k symbol -v break_on_me (lldb) break set -P resolver.Resolver -k symbol -v break_on_me Breakpoint 1: where = a.out`break_on_me at main.c:5, address = 0x00010f40 (lldb) break list Current breakpoints: 1: I am a python breakpoint resolver, locations = 1 1.1: where = a.out`break_on_me at main.c:5, address = a.out[0x00010f40], unresolved, hit count = 0 The functionality is advanced enough that this is useful, and I don't expect that will change much. There are tests for all of this. There are some future work items: Docs are forthcoming. Serialization is not all the way working, but I think it's worth getting the current state of things in before I tackle that. I also need to invent a way for the __init__ to vet its incoming arguments and return an error - which will abort the breakpoint creation - if they don't have some necessary entries. Repository: rLLDB LLDB https://reviews.llvm.org/D51830 Files: include/lldb/API/SBAddress.h include/lldb/API/SBBreakpoint.h include/lldb/API/SBStructuredData.h include/lldb/API/SBSymbolContext.h include/lldb/API/SBTarget.h include/lldb/Breakpoint/BreakpointResolver.h include/lldb/Breakpoint/BreakpointResolverScripted.h include/lldb/Interpreter/ScriptInterpreter.h include/lldb/Target/Target.h include/lldb/lldb-defines.h include/lldb/lldb-enumerations.h lldb.xcodeproj/project.pbxproj packages/Python/lldbsuite/test/functionalities/breakpoint/scripted_bkpt/Makefile packages/Python/lldbsuite/test/functionalities/breakpoint/scripted_bkpt/TestScriptedResolver.py packages/Python/lldbsuite/test/functionalities/breakpoint/scripted_bkpt/main.c packages/Python/lldbsuite/test/functionalities/breakpoint/scripted_bkpt/resolver.py packages/Python/lldbsuite/test/lldbutil.py scripts/Python/python-swigsafecast.swig scripts/Python/python-wrapper.swig scripts/interface/SBBreakpoint.i scripts/interface/SBStringList.i scripts/interface/SBStructuredData.i scripts/interface/SBTarget.i source/API/SBBreakpoint.cpp source/API/SBStructuredData.cpp source/API/SBTarget.cpp source/API/SystemInitializerFull.cpp source/Breakpoint/BreakpointResolver.cpp source/Breakpoint/Breakpoin