[Lldb-commits] [PATCH] D72880: Fix a buffer-size bug when the first DW_OP_piece is undefined

2020-01-16 Thread Vedant Kumar via Phabricator via lldb-commits
vsk accepted this revision. vsk added a comment. This revision is now accepted and ready to land. LGTM, this seems like a clear improvement. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72880/new/ https://reviews.llvm.org/D72880 ___

[Lldb-commits] [PATCH] D69524: [debugserver] Delete macOS/PPC debug server implementation

2020-01-21 Thread Vedant Kumar via Phabricator via lldb-commits
vsk added a comment. Herald added a subscriber: wuzish. Friendly ping. This isn't urgent, just seems like a simple cleanup. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69524/new/ https://reviews.llvm.org/D69524 ___ lldb-commits mailing li

[Lldb-commits] [PATCH] D69524: [debugserver] Delete macOS/PPC debug server implementation

2020-01-21 Thread Vedant Kumar via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG9aba2ced34b2: [debugserver] Delete macOS/PPC debug server implementation (authored by vsk). Herald added a project: LLDB. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews

[Lldb-commits] [PATCH] D73148: [lldb/Value] Report size of Value as size of underlying data buffer

2020-01-21 Thread Vedant Kumar via Phabricator via lldb-commits
vsk created this revision. vsk added reviewers: jingham, aprantl. Value::GetValueByteSize() assumes that the size of a Value is always equal to the size of the underlying variable's CompilerType. However, llvm's DWARF generator doesn't appear to create fresh types with new sizes when emitting frag

[Lldb-commits] [PATCH] D73148: [lldb/Value] Report size of Value as size of underlying data buffer

2020-01-21 Thread Vedant Kumar via Phabricator via lldb-commits
vsk added a comment. In D73148#1832704 , @clayborg wrote: > Would it be better to just ensure that the buffer for DW_OP_piece is at least > the size of the type instead? To do this right we would really need to track > which bytes in the buffer are actua

[Lldb-commits] [PATCH] D73148: [lldb/Value] Report size of Value as size of underlying data buffer

2020-01-22 Thread Vedant Kumar via Phabricator via lldb-commits
vsk planned changes to this revision. vsk added a comment. In D73148#1832897 , @clayborg wrote: > Actually it would be nice to have a test that will trigger on at least one > build bot that runs ASAN? I'll add an end-to-end test for DW_OP_piece, though

[Lldb-commits] [PATCH] D73148: [lldb/Value] Report size of Value as size of underlying data buffer

2020-01-22 Thread Vedant Kumar via Phabricator via lldb-commits
vsk updated this revision to Diff 239753. vsk edited the summary of this revision. This revision is now accepted and ready to land. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73148/new/ https://reviews.llvm.org/D73148 Files: lldb/packages/Python/lldbsuite/test/functionalities/dw_op_

[Lldb-commits] [PATCH] D73384: [lldb/Lit] Change the lldbtest format to behave more like shell test.

2020-01-24 Thread Vedant Kumar via Phabricator via lldb-commits
vsk accepted this revision as: vsk. vsk added a comment. This revision is now accepted and ready to land. Nice! Repository: rLLDB LLDB CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73384/new/ https://reviews.llvm.org/D73384 ___ lldb-comm

[Lldb-commits] [PATCH] D73148: [lldb/Value] Avoid reading more data than the host has available

2020-01-30 Thread Vedant Kumar via Phabricator via lldb-commits
vsk updated this revision to Diff 241602. vsk retitled this revision from "[lldb/Value] Report size of Value as size of underlying data buffer" to "[lldb/Value] Avoid reading more data than the host has available". vsk edited the summary of this revision. vsk added a comment. Address review feed

[Lldb-commits] [PATCH] D73148: [lldb/Value] Avoid reading more data than the host has available

2020-01-30 Thread Vedant Kumar via Phabricator via lldb-commits
vsk marked an inline comment as done. vsk added inline comments. Comment at: lldb/packages/Python/lldbsuite/test/functionalities/dw_op_piece/main.cpp:34 + //% self.filecheck("image lookup -va $pc", "main.cpp", "-check-prefix=INFO-V1") + // INFO-V1: name = "v1", type = "S1", l

[Lldb-commits] [PATCH] D73148: [lldb/Value] Avoid reading more data than the host has available

2020-01-30 Thread Vedant Kumar via Phabricator via lldb-commits
vsk planned changes to this revision. vsk added a comment. Yikes, this version seems to break TestClassTemplateParameterPack.py (and probably other tests as well). Maybe we expect to be able to read past the end of the buffer inside of a ValueObjectChild, because the buffer for the next ValueOb

[Lldb-commits] [PATCH] D73148: [lldb/Value] Avoid reading more data than the host has available

2020-01-31 Thread Vedant Kumar via Phabricator via lldb-commits
vsk updated this revision to Diff 241814. vsk edited the summary of this revision. vsk added a comment. - Go with @gclayton's original suggestion, as it's proven to be impractical to alter the notion of a Value's size in the Value/ValueObject logic. - I've tested this and gotten a clean check-lld

[Lldb-commits] [PATCH] D73808: [lldb/ClangASTContext] Supply trivial TypeSourceInfo to NonTypeTemplateParmDecl::Create

2020-01-31 Thread Vedant Kumar via Phabricator via lldb-commits
vsk created this revision. vsk added reviewers: teemperor, shafik. Herald added a subscriber: kristof.beyls. This fixes a UBSan error seen while debugging clang: Member call on null pointer of type 'clang::TypeSourceInfo' rdar://58783517 https://reviews.llvm.org/D73808 Files: lldb/packages

[Lldb-commits] [PATCH] D73148: [lldb/Value] Avoid reading more data than the host has available

2020-01-31 Thread Vedant Kumar via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG14135f50a036: [lldb/Value] Avoid reading more data than the host has available (authored by vsk). Herald added a project: LLDB. Changed prior to commit: https://reviews.llvm.org/D73148?vs=241814&id=2418

[Lldb-commits] [PATCH] D73860: [lldb/StringPrinter] Avoid reading garbage in uninitialized strings

2020-02-02 Thread Vedant Kumar via Phabricator via lldb-commits
vsk created this revision. vsk added reviewers: teemperor, shafik, jingham. Herald added a subscriber: christof. This patch fixes two distinct but related out-of-bounds read bugs in string data formatters. Both issues have to do with mishandling of un- initialized strings. These manifest as ASan e

[Lldb-commits] [PATCH] D73913: [lldb/DataExtractor] Fix UB shift in GetMaxS64Bitfield

2020-02-03 Thread Vedant Kumar via Phabricator via lldb-commits
vsk created this revision. vsk added reviewers: labath, JDevlieghere, teemperor. DataExtractor::GetMaxS64Bitfield performs a shift with UB in order to construct a bitmask when bitfield_bit_size is 64. The current implementation actually does “work” in this case, because the assumption that the shi

[Lldb-commits] [PATCH] D73913: [lldb/DataExtractor] Fix UB shift in GetMaxS64Bitfield

2020-02-03 Thread Vedant Kumar via Phabricator via lldb-commits
vsk marked an inline comment as done. vsk added inline comments. Comment at: lldb/source/Utility/DataExtractor.cpp:610 int64_t sval64 = GetMaxS64(offset_ptr, size); if (bitfield_bit_size > 0) { int32_t lsbcount = bitfield_bit_offset; shafik wrote: > We

[Lldb-commits] [PATCH] D73913: [lldb/DataExtractor] Fix UB shift in GetMaxS64Bitfield

2020-02-03 Thread Vedant Kumar via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG7b90cdedd1d3: [lldb/DataExtractor] Fix UB shift in GetMaxS64Bitfield (authored by vsk). Herald added a project: LLDB. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llv

[Lldb-commits] [PATCH] D73860: [lldb/StringPrinter] Avoid reading garbage in uninitialized strings

2020-02-03 Thread Vedant Kumar via Phabricator via lldb-commits
vsk added inline comments. Comment at: lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/main.cpp:29 +if (sizeof(std::string) == sizeof(garbage_string_sso)) + memcpy((void *)&garbage1, &garbage_string_sso, sizeof(std::st

[Lldb-commits] [PATCH] D73860: [lldb/StringPrinter] Avoid reading garbage in uninitialized strings

2020-02-03 Thread Vedant Kumar via Phabricator via lldb-commits
vsk planned changes to this revision. vsk added a comment. I'll update this tomorrow with checks in TestDataFormatterLibcxxString.py for how lldb formats garbage{1,2}. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73860/new/ https://reviews.llvm.org/D73860 __

[Lldb-commits] [PATCH] D73946: [lldb] Fix another instance where we pass a nullptr as TypeSourceInfo to NonTypeTemplateParmDecl::Create

2020-02-04 Thread Vedant Kumar via Phabricator via lldb-commits
vsk added a comment. We have test coverage for this already, not sure why the sanitizer bot hasn't flagged this already: http://lab.llvm.org:8080/coverage/coverage-reports/coverage/Users/buildslave/jenkins/workspace/coverage/llvm-project/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp.h

[Lldb-commits] [PATCH] D73946: [lldb] Fix another instance where we pass a nullptr as TypeSourceInfo to NonTypeTemplateParmDecl::Create

2020-02-04 Thread Vedant Kumar via Phabricator via lldb-commits
vsk accepted this revision. vsk added a comment. This revision is now accepted and ready to land. lgtm, thanks! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73946/new/ https://reviews.llvm.org/D73946 ___ lldb-commits mailing list lldb-comm

[Lldb-commits] [PATCH] D73938: [Host.mm] Check for the right macro instead of inlining it.

2020-02-04 Thread Vedant Kumar via Phabricator via lldb-commits
vsk added inline comments. Comment at: lldb/source/Host/macosx/objcxx/Host.mm:14 // On device doesn't have supporty for XPC. #if defined(__APPLE__) && (defined(__arm64__) || defined(__aarch64__)) #define NO_XPC_SERVICES 1 This is missing `__arm__`, right? Why

[Lldb-commits] [PATCH] D73946: [lldb] Fix another instance where we pass a nullptr as TypeSourceInfo to NonTypeTemplateParmDecl::Create

2020-02-04 Thread Vedant Kumar via Phabricator via lldb-commits
vsk added a comment. In D73946#1857400 , @teemperor wrote: > In D73946#1857244 , @vsk wrote: > > > We have test coverage for this already, not sure why the sanitizer bot > > hasn't flagged this already: > > http:/

[Lldb-commits] [PATCH] D73860: [lldb/StringPrinter] Avoid reading garbage in uninitialized strings

2020-02-04 Thread Vedant Kumar via Phabricator via lldb-commits
vsk updated this revision to Diff 242417. vsk marked 5 inline comments as done. vsk added a comment. Address review feedback. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73860/new/ https://reviews.llvm.org/D73860 Files: lldb/packages/Python/lldbsuite/test/functionalities/data-form

[Lldb-commits] [PATCH] D73860: [lldb/StringPrinter] Avoid reading garbage in uninitialized strings

2020-02-04 Thread Vedant Kumar via Phabricator via lldb-commits
vsk added inline comments. Comment at: lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/main.cpp:29 +if (sizeof(std::string) == sizeof(garbage_string_sso)) + memcpy((void *)&garbage1, &garbage_string_sso, sizeof(std::st

[Lldb-commits] [PATCH] D73808: [lldb/TypeSystemClang] Supply trivial TypeSourceInfo to NonTypeTemplateParmDecl::Create

2020-02-04 Thread Vedant Kumar via Phabricator via lldb-commits
vsk added a comment. In D73808#1856503 , @teemperor wrote: > Thanks for looking into this. I didn't get around to fix that myself yet. Out > of curiosity, how did you get this test to fail? When I apply just your > changes to the test (without the TypeSy

[Lldb-commits] [PATCH] D73808: [lldb/TypeSystemClang] Supply trivial TypeSourceInfo to NonTypeTemplateParmDecl::Create

2020-02-04 Thread Vedant Kumar via Phabricator via lldb-commits
vsk added a comment. .. and I can no longer reproduce the sanitizer exception while debugging a Debug clang binary, as I rebased recently and some source change in clang hides the bug. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73808/new/ https://reviews.llvm.org/D73808

[Lldb-commits] [PATCH] D73808: [lldb/TypeSystemClang] Supply trivial TypeSourceInfo to NonTypeTemplateParmDecl::Create

2020-02-04 Thread Vedant Kumar via Phabricator via lldb-commits
vsk added a comment. It probably makes sense to land this and D73946 as a defensive measure, without any test change. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73808/new/ https://reviews.llvm.org/D73808 _

[Lldb-commits] [PATCH] D73808: [lldb/TypeSystemClang] Supply trivial TypeSourceInfo to NonTypeTemplateParmDecl::Create

2020-02-04 Thread Vedant Kumar via Phabricator via lldb-commits
vsk added a comment. The original sanitizer report /does/ show UB in the NonTypeTemplateParmDecl static constructor: * thread #1, queue = 'com.apple.main-thread', stop reason = Null pointer use * fram

[Lldb-commits] [PATCH] D73860: [lldb/StringPrinter] Avoid reading garbage in uninitialized strings

2020-02-04 Thread Vedant Kumar via Phabricator via lldb-commits
vsk updated this revision to Diff 242461. vsk added a reviewer: LLDB. vsk added a comment. - Enhance test coverage with several more examples of garbage long-mode std::strings. - In several cases, when we detected an invalid string, we would fall back to spewing the "raw mode" representation of

[Lldb-commits] [PATCH] D73860: [lldb/StringPrinter] Avoid reading garbage in uninitialized strings

2020-02-04 Thread Vedant Kumar via Phabricator via lldb-commits
vsk updated this revision to Diff 242479. vsk added a comment. Per offline feedback from Jonas, label variables `const` where applicable and get rid of the ScopeExits. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73860/new/ https://reviews.llvm.org/D73860 Files: lldb/packages/Pyth

[Lldb-commits] [PATCH] D74018: [lldb/LibCxx] Have ExtractLibcxxStringInfo return an Optional result, NFC

2020-02-04 Thread Vedant Kumar via Phabricator via lldb-commits
vsk created this revision. vsk added a reviewer: JDevlieghere. ... and a few other minor simplifications. https://reviews.llvm.org/D74018 Files: lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp Index: lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp

[Lldb-commits] [PATCH] D73860: [lldb/StringPrinter] Avoid reading garbage in uninitialized strings

2020-02-04 Thread Vedant Kumar via Phabricator via lldb-commits
vsk updated this revision to Diff 242495. vsk marked an inline comment as done. vsk added a comment. - Make a bool const. - Split off other refactoring into https://reviews.llvm.org/D74018. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73860/new/ https://reviews.llvm.org/D73860 Files:

[Lldb-commits] [PATCH] D73860: [lldb/StringPrinter] Avoid reading garbage in uninitialized strings

2020-02-05 Thread Vedant Kumar via Phabricator via lldb-commits
vsk updated this revision to Diff 242661. vsk marked 4 inline comments as done. vsk added a comment. - `s/cap/capacity/` - Remove the `checkedAdd` pointer overflow check as it's not necessary. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73860/new/ https://reviews.llvm.org/D73860 File

[Lldb-commits] [PATCH] D73860: [lldb/StringPrinter] Avoid reading garbage in uninitialized strings

2020-02-05 Thread Vedant Kumar via Phabricator via lldb-commits
vsk added inline comments. Comment at: lldb/source/DataFormatters/StringPrinter.cpp:144 +return retval; + if (!llvm::checkedAdd(reinterpret_cast(buffer), +static_cast(utf8_encoded_len))) shafik wrote: > Wouldn't we want `checkedAddUns

<    1   2   3   4   5