- Nov 04, 2022
-
-
Wanyi Ye authored
This patch will gather debug info & breakpoint info from the statistics dump (from `(SBTarget.GetStatistics())` func) and send to DAP in terminated event. The statistics content can be huge (especially the `modules`) and dumping in full JSON can create delay in the IDE's debugging UI. (For more details, please read: https://github.com/llvm/llvm-project/commit/7bbd0fba986c241162b77b7e424ad82bc7e17b41 ). Hence, we will filter out large contents before returning it in terminated event. It will keep all the metadata fields (those starts with "total"). For large contents, it uses the opt-out strategy. Currently it only removes the "modules" field. This way every time a new top-level field being added, we will be able to capture them from DAP log without changing lldb-vscode. The DAP terminated event should look like ``` { "event":"terminated", "seq":0, "statistics": { "memory": <JSON string> "targets": <JSON string>, // it's a JSON array, breakpoints info included in each target <metadata_key: value> // pairs }, "type":"event" } ``` All the info above will be append to statistics field in the terminated event Test Plan Debugged a simple hello world program from VSCode. Exit debug session in two ways: 1) run to program exit; 2) user initiated debug session end (quit debugging before program exit). Check DAP log and see both debug sessions have statistics returned in terminated event. Here's an example when debugging the test program: ``` {"event":"terminated","seq":0,"statistics":{"memory":"{\"strings\":{\"bytesTotal\":1843200,\"bytesUnused\":897741,\"bytesUsed\":945459}}","targets":"[{\"breakpoints\":[{\"details\":{\"Breakpoint\":{\"BKPTOptions\":{\"AutoContinue\":false,\"ConditionText\":\"\",\"EnabledState\":true,\"IgnoreCount\":0,\"OneShotState\":false},\"BKPTResolver\":{\"Options\":{\"NameMask\":[56],\"Offset\":0,\"SkipPrologue\":true,\"SymbolNames\":[\"foo\"]},\"Type\":\"SymbolName\"},\"Hardware\":false,\"Names\":[\"vscode\"],\"SearchFilter\":{\"Options\":{},\"Type\":\"Unconstrained\"}}},\"id\":1,\"internal\":false,\"numLocations\":1,\"numResolvedLocations\":1,\"resolveTime\":0.002232},{\"details\":{\"Breakpoint\":{\"BKPTOptions\":{\"AutoContinue\":false,\"ConditionText\":\"\",\"EnabledState\":true,\"IgnoreCount\":0,\"OneShotState\":false},\"BKPTResolver\":{\"Options\":{\"Column\":0,\"Exact\":false,\"FileName\":\"/data/users/wanyi/llvm-sand/external/llvm-project/lldb/test/API/tools/lldb-vscode/terminated-event/main.cpp\",\"Inlines\":true,\"LineNumber\":5,\"Offset\":0,\"SkipPrologue\":true},\"Type\":\"FileAndLine\"},\"Hardware\":false,\"Names\":[\"vscode\"],\"SearchFilter\":{\"Options\":{},\"Type\":\"Unconstrained\"}}},\"id\":2,\"internal\":false,\"numLocations\":0,\"numResolvedLocations\":0,\"resolveTime\":0.23203799999999999},{\"details\":{\"Breakpoint\":{\"BKPTOptions\":{\"AutoContinue\":false,\"ConditionText\":\"\",\"EnabledState\":true,\"IgnoreCount\":0,\"OneShotState\":false},\"BKPTResolver\":{\"Options\":{\"Language\":\"c\",\"NameMask\":[4,4,4,4,4,4],\"Offset\":0,\"SkipPrologue\":false,\"SymbolNames\":[\"_dl_debug_state\",\"rtld_db_dlactivity\",\"__dl_rtld_db_dlactivity\",\"r_debug_state\",\"_r_debug_state\",\"_rtld_debug_state\"]},\"Type\":\"SymbolName\"},\"Hardware\":false,\"SearchFilter\":{\"Options\":{\"ModuleList\":[\"/usr/lib64/ld-2.28.so\"]},\"Type\":\"Modules\"}}},\"id\":-1,\"internal\":true,\"kindDescription\":\"shared-library-event\",\"numLocations\":1,\"numResolvedLocations\":1,\"resolveTime\":0.00026699999999999998}],\"expressionEvaluation\":{\"failures\":0,\"successes\":0},\"firstStopTime\":0.087458974999999994,\"frameVariable\":{\"failures\":0,\"successes\":0},\"launchOrAttachTime\":0.052953161999999998,\"moduleIdentifiers\":[94554748126576,94554747837792,94554747149216,139800112130176,139800112161056,139800112206064,139800112340224,139800112509552,139800112236528],\"signals\":[{\"SIGSTOP\":1}],\"sourceMapDeduceCount\":0,\"stopCount\":8,\"targetCreateTime\":0.00057700000000000004,\"totalBreakpointResolveTime\":0.234537}]","totalDebugInfoByteSize":1668056,"totalDebugInfoEnabled":3,"totalDebugInfoIndexLoadedFromCache":0,"totalDebugInfoIndexSavedToCache":0,"totalDebugInfoIndexTime":0.027963000000000002,"totalDebugInfoParseTime":0.34354800000000002,"totalModuleCount":10,"totalModuleCountHasDebugInfo":3,"totalSymbolTableIndexTime":0.056050000000000003,"totalSymbolTableParseTime":0.23930000000000001,"totalSymbolTableStripped":0,"totalSymbolTablesLoadedFromCache":0,"totalSymbolTablesSavedToCache":0},"type":"event"} ``` Differential Revision: https://reviews.llvm.org/D137003
-
Oleksandr "Alex" Zinenko authored
-
Sam Clegg authored
This is feature of the ELF and COFF linker that we were missing until now. Differential Revision: https://reviews.llvm.org/D137377
-
Yitzhak Mandelbaum authored
Currently, the API for a model's custom value comparison returns a boolean. Therefore, models cannot distinguish between situations where the values are recognized by the model and different and those where the values are just not recognized. This patch changes the return value to a tri-valued enum, allowing models to express "don't know". This patch is essentially a NFC -- no practical differences result from this change in this patch. But, it prepares for future patches (particularly, upcoming patches for widening) which will take advantage of the new flexibility. Differential Revision: https://reviews.llvm.org/D137334
-
Jeff Niu authored
This patch adds the left shift, signed right shift, and unsigned right shift operations to the index dialects with folders and LLVM lowerings. Reviewed By: rriddle Differential Revision: https://reviews.llvm.org/D137349
-
Craig Topper authored
Might create a problem in the future if more cases are added.
-
Arthur Eubanks authored
This makes setting breakpoints work with -gsimple-template-names. Assume that callers handle false positives. For example, `Module::LookupInfo::Prune` removes wrong template instantiations when setting a breakpoint. Reviewed By: labath Differential Revision: https://reviews.llvm.org/D137098
-
Thomas Raoux authored
Add a transformation to tile reduction ops into a parallel operation followed by a merge operation. This is equivalent to the existing reduction spliting transformation but using loops instead of using higher dimensions linalg. Differential Revision: https://reviews.llvm.org/D136586
-
Nick Desaulniers authored
Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D136885
-
Henry Yu authored
[SelectionDAGBuilder] use bitcast instead of AnyExtOrTrunc if copy parts from an int vector to a float vector to fix issue #58615 The getCopyFromPartsVector doesn't work correctly when PartEVT and ValueVT have both different element type and different size. This patch 1) removes the part of a comment that contains the incorrect assumption that element type are the same 2) use bitcast when copy parts of int vector to a float vector after the subvector extraction Reviewed By: Peter, efriedma Differential Revision: https://reviews.llvm.org/D136726
-
Peter Rong authored
If a programmer incorrectly `Switch->setOperand()` and `Verifier` will pass, causing problems when dumping this `Module` This patch aligns SwitchInst's check with LLParser. It also includes a test to justify the patch. Differential Revision: https://reviews.llvm.org/D136656
-
Tom Stellard authored
Reviewed By: mgorny, phosek, Ericson2314 Differential Revision: https://reviews.llvm.org/D137224
-
George Hu authored
Differential Revision: https://reviews.llvm.org/D137284
-
Med Ismail Bennani authored
This patch replaces the ScriptedProcessInterface getters to return default initializers for StructureData shared pointers instead of returning a null pointer. Differential Revision: https://reviews.llvm.org/D137359 Signed-off-by:
Med Ismail Bennani <medismail.bennani@gmail.com>
-
Med Ismail Bennani authored
For an exception crashlog, the thread backtraces aren't usually very helpful and instead, developpers look at the "Application Specific Backtrace" that was generated by `objc_exception_throw`. LLDB could already parse and symbolicate these Application Specific Backtraces for regular textual-based crashlog, so this patch adds support to parse them in JSON crashlogs, and materialize them a HistoryThread extending the crashed ScriptedThread. This patch also includes the Application Specific Information messages as part of the process extended crash information log. To do so, the ScriptedProcess Python interface has a new GetMetadata method that returns an arbitrary dictionary with data related to the process. rdar://93207586 Differential Revision: https://reviews.llvm.org/D126260 Signed-off-by:
Med Ismail Bennani <medismail.bennani@gmail.com>
-
Med Ismail Bennani authored
This patch improves the StructuredData classes to provide a GetDescription(lldb_private::Stream&) affordance. This is very convenient compared to the Dump method because this try to pretty print the structure instead of just serializing it into a JSON. This patch also updates some parts of lldb (i.e. extended crash info) to use this new affordance instead of StructuredData::Dump. Differential Revision: https://reviews.llvm.org/D135547 Signed-off-by:
Med Ismail Bennani <medismail.bennani@gmail.com>
-
Med Ismail Bennani authored
This patch fixes the JSON parser for StructuredData to handle JSON null entries. Differential Revision: https://reviews.llvm.org/D135616 Signed-off-by:
Med Ismail Bennani <medismail.bennani@gmail.com>
-
Med Ismail Bennani authored
This adds a new line between the real thread and the extended backtrace thread when it's available. This should improve readability for the user. Signed-off-by:Med Ismail Bennani <medismail.bennani@gmail.com>
-
Med Ismail Bennani authored
Signed-off-by:Med Ismail Bennani <medismail.bennani@gmail.com>
-
Med Ismail Bennani authored
This patch updates the image_regex_uuid matcher to match null-UUID images in the plain text crashlog parser. It updates the regex to match one or more '?' characters or the image full path. rdar://100904019 Differential Revision: https://reviews.llvm.org/D135482 Signed-off-by:
Med Ismail Bennani <medismail.bennani@gmail.com>
-
Med Ismail Bennani authored
This patch adds support for 32bit stack frame addresses in the `crashlog` command. For crash reports that are generated from a arm64_32 process, `PAGEZERO` is loaded at 0x00004000 so no code address will be less than 0x4000. This patch changes the crashlog frame address regex group to match addresses as small as 4 hex characters. rdar://100805026 Differential Revision: https://reviews.llvm.org/D135310 Signed-off-by:
Med Ismail Bennani <medismail.bennani@gmail.com>
-
varconst authored
The test requires two features to be supported but only checked for one of them. Differential Revision: https://reviews.llvm.org/D137294
-
Joseph Huber authored
This patch adds initial support for extracting offloading binaries from `COFF` objects. This is a first step to allow building offloading files on Windows targets with the new driver. Depends on D136796 Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D136855
-
Joseph Huber authored
A previous patch introduced a common function used to extract offloading binaries from an image. Therefore we no longer need to duplicate the functionality in the `llvm-objdump` implementation. Functionally, this removes the old warning behaviour when given malformed input. This has been changed to a hard error, which is effectively the same. This required a slight tweak in the linker wrapper to filter out the user passing shared objects directly. Reviewed By: tra Differential Revision: https://reviews.llvm.org/D136796
-
Tom Stellard authored
This test is XFAIL'd on most arches, and seems too fragile to be run on non-X86. Reviewed By: jmorse, probinson Differential Revision: https://reviews.llvm.org/D109806
-
Manoj Gupta authored
This matches other C++ drivers e.g. Linux that define _GNU_SOURCE. This lets clang compiler more code by default without explicitly passing _GNU_SOURCE on command line. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D136712
-
Mahesh Ravishankar authored
The folder used `cast<IntegerType>` which would segfault if the type were a vector type. Handle this case appropriately and avoid failure. Reviewed By: hanchung Differential Revision: https://reviews.llvm.org/D137345
-
Mahesh Ravishankar authored
The `RankedTensorType` can have an optional encoding attribute. Allowing the builders of `tensor.empty` to accept the encoding attribute (optionally), allows building empty tensors with the type having the encoding attribute. Reviewed By: nicolasvasilache, hanchung, springerm Differential Revision: https://reviews.llvm.org/D137297
-
Rafael Auler authored
Make BOLT build by default in X86 and AArch64 Linux boxes. Reviewed By: thieta, xbolva00 Differential Revision: https://reviews.llvm.org/D137305
-
Sam James authored
This is necessary at least on PPC32. Depends on D136280. Bug: https://bugs.gentoo.org/874024 Thanks-to: Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org> Tested-by:
erhard_f@mailbox.org <erhard_f@mailbox.org> Differential Revision: https://reviews.llvm.org/D136282
-
Sam James authored
Also simplify code for liblldCommon using the new LLVM_ATOMIC_LIB variable. Depends on D136280. Bug: https://bugs.gentoo.org/832675 Thanks-to: Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org> Tested-by:
erhard_f@mailbox.org <erhard_f@mailbox.org> Differential Revision: https://reviews.llvm.org/D136281
-
Sam James authored
* Set LLVM_ATOMIC_LIB to keep track of when we need to link against libatomic. * Add detection of mold linker which is required for this. * Use --as-needed when linking against libatomic as a bonus. On some platforms, libatomic may be required only sometimes. Bug: https://bugs.gentoo.org/832675 Thanks-to: Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org> Tested-by:
erhard_f@mailbox.org <erhard_f@mailbox.org> Differential Revision: https://reviews.llvm.org/D136280
-
Mingming Liu authored
Before this patch: - For `r = or op0, op1`, `tryBitfieldInsertOpFromOr` combines it to BFI when 1) one of the two operands is bit-field-positioning or bit-field-extraction op; and 2) bits from the two operands don't overlap After this patch: - Right before OR is combined to BFI, evaluates if ORR with left-shifted operand is better. A motivating example (https://godbolt.org/z/rnMrzs5vn, which is added as a test case in `test_orr_not_bfi` in `CodeGen/AArch64/bitfield-insert.ll`) For IR: ``` define i64 @test_orr_not_bfxil(i64 %0) { %2 = and i64 %0, 127 %3 = lshr i64 %0, 1 %4 = and i64 %3, 16256 %5 = or i64 %4, %2 ret i64 %5 } ``` Before: ``` lsr x8, x0, #1 and x8, x8, #0x3f80 bfxil x8, x0, #0, #7 ``` After: ``` ubfx x8, x0, #8, #7 and x9, x0, #0x7f orr x0, x9, x8, lsl #7 ``` Reviewed By: dmgreen Differential Revision: https://reviews.llvm.org/D135102
-
Florian Hahn authored
ConstantInt::getTrue/getFalse can materialize scalable vectors with all lanes true/false.
-
Mats Petersson authored
After submitting the DataLayout fix, some tests fail when they didn't before. This has to do with the target essentially being ignored when these tests were run earlier, as the --target x86-unknown-linux-gnu only has to be correctly formed to be accepted. Now the target triple is actually being used to get the targetmachine earlier - before MLIR is generated - so the test that has a valid target but not available on the platform fails. Fix is to require x86 registered target when running those tests. Reviewed By: awarzynski Differential Revision: https://reviews.llvm.org/D137335
-
Nathan Chancellor authored
This reverts commit b4e1466c. This causes a crash while building the Linux kernel. See the original Phabricator review for a reduced C and LLVM IR reproducer.
-
Mingming Liu authored
- Run auto updater for 'trunc-to-tbl.ll' and 'build-pair-isel.ll' - Add the motivating test of D135102 to 'bitfield-insert.ll' Reviewed By: fhahn Differential Revision: https://reviews.llvm.org/D137296
-
Jason Molenda authored
PlatformDarwinKernel::GetSupportedArchitectures returns a list of architectures that are possible for this platform; it was using a compile-time check for the debug host to decide the list of arches that were valid. This was copied from a codepath doing native process debugging, and was clearly wrong for kernel debugging, but it had not happened to cause problems so it went unnoticed for a long time. Small NFC change to the logging messages of Target::SetArchitecture to make them a little more explicit about how the architecture is being modified/replaced. Differential Revision: https://reviews.llvm.org/D137301 rdar://101690111
-
Emilio Cota authored
This allows users to restrict the transformation to a subset of the functions in a module. For example, a user might want to apply the transformation to a module's entry point, but not to the calls in the module because those calls might refer to external C functions outside of their control. Reviewed By: springerm, nicolasvasilache Differential Revision: https://reviews.llvm.org/D137264
-
Renaud-K authored
-