[Lldb-commits] [lldb] 1d7961f - [LLDB][RISCV] Add RVV registers enums
Author: Emmmer Date: 2023-01-29T18:07:56+08:00 New Revision: 1d7961fd1a36f0955423362932e1591e7d26ba9d URL: https://github.com/llvm/llvm-project/commit/1d7961fd1a36f0955423362932e1591e7d26ba9d DIFF: https://github.com/llvm/llvm-project/commit/1d7961fd1a36f0955423362932e1591e7d26ba9d.diff LOG: [LLDB][RISCV] Add RVV registers enums RVV stands for "RISC-V V Extension", which adds 32 vector registers, and seven unprivileged CSRs (vstart, vxsat, vxrm, vcsr, vtype, vl, vlenb) to a base scalar RISC-V ISA. The base vector extension is intended to provide general support for data-parallel execution within the 32-bit instruction encoding space, with later vector extensions supporting richer functionality for certain domains. Reviewed By: DavidSpickett, kito-cheng Differential Revision: https://reviews.llvm.org/D141898 Added: Modified: lldb/source/Plugins/Process/Utility/lldb-riscv-register-enums.h lldb/source/Utility/RISCV_DWARF_Registers.h Removed: diff --git a/lldb/source/Plugins/Process/Utility/lldb-riscv-register-enums.h b/lldb/source/Plugins/Process/Utility/lldb-riscv-register-enums.h index 8c335b8c10943..caec313750abb 100644 --- a/lldb/source/Plugins/Process/Utility/lldb-riscv-register-enums.h +++ b/lldb/source/Plugins/Process/Utility/lldb-riscv-register-enums.h @@ -152,6 +152,41 @@ enum { fpr_ft11_riscv = fpr_f31_riscv, fpr_last_riscv = fpr_fcsr_riscv, + vpr_first_riscv = 66, + vpr_v0_riscv = vpr_first_riscv, + vpr_v1_riscv, + vpr_v2_riscv, + vpr_v3_riscv, + vpr_v4_riscv, + vpr_v5_riscv, + vpr_v6_riscv, + vpr_v7_riscv, + vpr_v8_riscv, + vpr_v9_riscv, + vpr_v10_riscv, + vpr_v11_riscv, + vpr_v12_riscv, + vpr_v13_riscv, + vpr_v14_riscv, + vpr_v15_riscv, + vpr_v16_riscv, + vpr_v17_riscv, + vpr_v18_riscv, + vpr_v19_riscv, + vpr_v20_riscv, + vpr_v21_riscv, + vpr_v22_riscv, + vpr_v23_riscv, + vpr_v24_riscv, + vpr_v25_riscv, + vpr_v26_riscv, + vpr_v27_riscv, + vpr_v28_riscv, + vpr_v29_riscv, + vpr_v30_riscv, + vpr_v31_riscv, + vpr_last_riscv = vpr_v31_riscv, + k_num_registers_riscv }; diff --git a/lldb/source/Utility/RISCV_DWARF_Registers.h b/lldb/source/Utility/RISCV_DWARF_Registers.h index b7fc9d913e334..8aed3d13f9359 100644 --- a/lldb/source/Utility/RISCV_DWARF_Registers.h +++ b/lldb/source/Utility/RISCV_DWARF_Registers.h @@ -83,40 +83,50 @@ enum { // alternate frame return column dwarf_alt_fr_col = 64, - dwarf_v0 = 96, - dwarf_v1, - dwarf_v2, - dwarf_v3, - dwarf_v4, - dwarf_v5, - dwarf_v6, - dwarf_v7, - dwarf_v8, - dwarf_v9, - dwarf_v10, - dwarf_v11, - dwarf_v12, - dwarf_v13, - dwarf_v14, - dwarf_v15, - dwarf_v16, - dwarf_v17, - dwarf_v18, - dwarf_v19, - dwarf_v20, - dwarf_v21, - dwarf_v22, - dwarf_v23, - dwarf_v24, - dwarf_v25, - dwarf_v26, - dwarf_v27, - dwarf_v28, - dwarf_v29, - dwarf_v30, - dwarf_v31 = 127, + dwarf_vpr_v0 = 96, + dwarf_vpr_v1, + dwarf_vpr_v2, + dwarf_vpr_v3, + dwarf_vpr_v4, + dwarf_vpr_v5, + dwarf_vpr_v6, + dwarf_vpr_v7, + dwarf_vpr_v8, + dwarf_vpr_v9, + dwarf_vpr_v10, + dwarf_vpr_v11, + dwarf_vpr_v12, + dwarf_vpr_v13, + dwarf_vpr_v14, + dwarf_vpr_v15, + dwarf_vpr_v16, + dwarf_vpr_v17, + dwarf_vpr_v18, + dwarf_vpr_v19, + dwarf_vpr_v20, + dwarf_vpr_v21, + dwarf_vpr_v22, + dwarf_vpr_v23, + dwarf_vpr_v24, + dwarf_vpr_v25, + dwarf_vpr_v26, + dwarf_vpr_v27, + dwarf_vpr_v28, + dwarf_vpr_v29, + dwarf_vpr_v30, + dwarf_vpr_v31 = 127, dwarf_first_csr = 4096, dwarf_fpr_fcsr = dwarf_first_csr + 0x003, + // The vector extension adds seven unprivileged CSRs + // (vstart, vxsat, vxrm, vcsr, vtype, vl, vlenb) + // to a base scalar RISC-V ISA. + dwarf_vpr_vstart = dwarf_first_csr + 0x008, + dwarf_vpr_vxsat = dwarf_first_csr + 0x009, + dwarf_vpr_vxrm = dwarf_first_csr + 0x00A, + dwarf_vpr_vcsr = dwarf_first_csr + 0x00F, + dwarf_vpr_vl = dwarf_first_csr + 0xC20, + dwarf_vpr_vtype = dwarf_first_csr + 0xC21, + dwarf_vpr_vlenb = dwarf_first_csr + 0xC22, dwarf_last_csr = 8191, // register ABI name ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D141898: [LLDB][RISCV] Add RVV registers enums
This revision was automatically updated to reflect the committed changes. Emmmer marked an inline comment as done. Closed by commit rG1d7961fd1a36: [LLDB][RISCV] Add RVV registers enums (authored by Emmmer). Herald added a project: LLDB. Herald added a subscriber: lldb-commits. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141898/new/ https://reviews.llvm.org/D141898 Files: lldb/source/Plugins/Process/Utility/lldb-riscv-register-enums.h lldb/source/Utility/RISCV_DWARF_Registers.h Index: lldb/source/Utility/RISCV_DWARF_Registers.h === --- lldb/source/Utility/RISCV_DWARF_Registers.h +++ lldb/source/Utility/RISCV_DWARF_Registers.h @@ -83,40 +83,50 @@ // alternate frame return column dwarf_alt_fr_col = 64, - dwarf_v0 = 96, - dwarf_v1, - dwarf_v2, - dwarf_v3, - dwarf_v4, - dwarf_v5, - dwarf_v6, - dwarf_v7, - dwarf_v8, - dwarf_v9, - dwarf_v10, - dwarf_v11, - dwarf_v12, - dwarf_v13, - dwarf_v14, - dwarf_v15, - dwarf_v16, - dwarf_v17, - dwarf_v18, - dwarf_v19, - dwarf_v20, - dwarf_v21, - dwarf_v22, - dwarf_v23, - dwarf_v24, - dwarf_v25, - dwarf_v26, - dwarf_v27, - dwarf_v28, - dwarf_v29, - dwarf_v30, - dwarf_v31 = 127, + dwarf_vpr_v0 = 96, + dwarf_vpr_v1, + dwarf_vpr_v2, + dwarf_vpr_v3, + dwarf_vpr_v4, + dwarf_vpr_v5, + dwarf_vpr_v6, + dwarf_vpr_v7, + dwarf_vpr_v8, + dwarf_vpr_v9, + dwarf_vpr_v10, + dwarf_vpr_v11, + dwarf_vpr_v12, + dwarf_vpr_v13, + dwarf_vpr_v14, + dwarf_vpr_v15, + dwarf_vpr_v16, + dwarf_vpr_v17, + dwarf_vpr_v18, + dwarf_vpr_v19, + dwarf_vpr_v20, + dwarf_vpr_v21, + dwarf_vpr_v22, + dwarf_vpr_v23, + dwarf_vpr_v24, + dwarf_vpr_v25, + dwarf_vpr_v26, + dwarf_vpr_v27, + dwarf_vpr_v28, + dwarf_vpr_v29, + dwarf_vpr_v30, + dwarf_vpr_v31 = 127, dwarf_first_csr = 4096, dwarf_fpr_fcsr = dwarf_first_csr + 0x003, + // The vector extension adds seven unprivileged CSRs + // (vstart, vxsat, vxrm, vcsr, vtype, vl, vlenb) + // to a base scalar RISC-V ISA. + dwarf_vpr_vstart = dwarf_first_csr + 0x008, + dwarf_vpr_vxsat = dwarf_first_csr + 0x009, + dwarf_vpr_vxrm = dwarf_first_csr + 0x00A, + dwarf_vpr_vcsr = dwarf_first_csr + 0x00F, + dwarf_vpr_vl = dwarf_first_csr + 0xC20, + dwarf_vpr_vtype = dwarf_first_csr + 0xC21, + dwarf_vpr_vlenb = dwarf_first_csr + 0xC22, dwarf_last_csr = 8191, // register ABI name Index: lldb/source/Plugins/Process/Utility/lldb-riscv-register-enums.h === --- lldb/source/Plugins/Process/Utility/lldb-riscv-register-enums.h +++ lldb/source/Plugins/Process/Utility/lldb-riscv-register-enums.h @@ -152,6 +152,41 @@ fpr_ft11_riscv = fpr_f31_riscv, fpr_last_riscv = fpr_fcsr_riscv, + vpr_first_riscv = 66, + vpr_v0_riscv = vpr_first_riscv, + vpr_v1_riscv, + vpr_v2_riscv, + vpr_v3_riscv, + vpr_v4_riscv, + vpr_v5_riscv, + vpr_v6_riscv, + vpr_v7_riscv, + vpr_v8_riscv, + vpr_v9_riscv, + vpr_v10_riscv, + vpr_v11_riscv, + vpr_v12_riscv, + vpr_v13_riscv, + vpr_v14_riscv, + vpr_v15_riscv, + vpr_v16_riscv, + vpr_v17_riscv, + vpr_v18_riscv, + vpr_v19_riscv, + vpr_v20_riscv, + vpr_v21_riscv, + vpr_v22_riscv, + vpr_v23_riscv, + vpr_v24_riscv, + vpr_v25_riscv, + vpr_v26_riscv, + vpr_v27_riscv, + vpr_v28_riscv, + vpr_v29_riscv, + vpr_v30_riscv, + vpr_v31_riscv, + vpr_last_riscv = vpr_v31_riscv, + k_num_registers_riscv }; ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D142733: Add _Optional as fast qualifier
chrisbazley added a comment. Please refer to https://discourse.llvm.org/t/rfc-optional-a-type-qualifier-to-indicate-pointer-nullability/ and https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3089.pdf for the wider context of this commit. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142733/new/ https://reviews.llvm.org/D142733 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D142733: Add _Optional as fast qualifier
chrisbazley added a comment. Hi, thanks very much for looking at my patch. I added the link that you proposed to all of the patches in the stack. > Assuming that we want to go in this direction, it seems quite expensive to > model this as a fast qualifier rather than an extended qualifier. True, and I'm not at all wedded to the idea of _Optional being a fast qualifier. I added it in the simplest way I knew how, having no prior experience of the codebase. What would be really useful would be if you could show/explain how to add it in a less risky way. If not, I can look into it myself. > Are these annotations expected to be so common that it's better to increase > the alignment of all types than perform extra allocations and indirections > for _Optional qualifiers? Given time, I hope so, but realistically not in the near future. > Have you measured the memory impact of increasing the alignment of Type? No, because I didn't think it necessary for the purpose of prototyping. If there's any prospect of getting my patches merged then I'd be delighted to invest the time... but only if increasing the alignment is a necessary thing to do. > I think that should be a prerequisite to adding any new kind of fast > qualifier, and if we do add such a qualifier, we should select carefully > which qualifier gets this precious bit in QualType. I believe that over time, _Optional would be a much more appropriate use of the precious bit currently occupied by volatile because I expect it to be used more heavily, but I can't make that argument yet. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142733/new/ https://reviews.llvm.org/D142733 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D141910: [OpenMP][OMPIRBuilder]Move SIMD alignment calculation to LLVM Frontend
akyrtzi added a comment. Hi @domada, these changes break compilation of clang, with such build error: FAILED: tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ASTContext.cpp.o In file included from /llvm-project/clang/lib/AST/ASTContext.cpp:81: In file included from /llvm-project/llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h:17: In file included from /llvm-project/llvm/include/llvm/Analysis/MemorySSAUpdater.h:37: In file included from /llvm-project/llvm/include/llvm/Analysis/MemorySSA.h:93: In file included from /llvm-project/llvm/include/llvm/Analysis/AliasAnalysis.h:44: In file included from /llvm-project/llvm/include/llvm/IR/PassManager.h:45: In file included from /llvm-project/llvm/include/llvm/IR/Function.h:25: In file included from /llvm-project/llvm/include/llvm/IR/Argument.h:17: /llvm-project/llvm/include/llvm/IR/Attributes.h:90:14: fatal error: 'llvm/IR/Attributes.inc' file not found Reproduction steps: 1. Configure to build clang using `ninja`: cmake -G Ninja /path/to/llvm-project/llvm \ -DLLVM_TARGETS_TO_BUILD="X86;ARM;AArch64" \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DLLVM_ENABLE_PROJECTS="clang" 2. Build `ASTContext.cpp.o` with a clean build directory. ninja clean && ninja tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ASTContext.cpp.o Are you able to take a look? 🙏 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141910/new/ https://reviews.llvm.org/D141910 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D142862: [Support] change StringMap hash function from djbHash to xxHash
erikdesjardins created this revision. Herald added subscribers: Moerafaat, zero9178, Enna1, bzcheeseman, sdasgup3, wenzhicui, wrengr, cota, teijeong, rdzhabarov, tatianashp, wenlei, msifontes, jurahul, Kayjukh, grosul1, Joonsoo, liufengdb, aartbik, mgester, arpith-jacob, antiagainst, shauheen, rriddle, mehdi_amini, thopre, kadircet, arphaman, JDevlieghere, hiraditya. Herald added a reviewer: JDevlieghere. Herald added a project: All. erikdesjardins requested review of this revision. Herald added subscribers: cfe-commits, llvm-commits, lldb-commits, Sanitizers, stephenneuendorffer, nicolasvasilache. Herald added projects: clang, Sanitizers, LLDB, MLIR, LLVM, clang-tools-extra. Depends on https://reviews.llvm.org/D142861. Alternative to https://reviews.llvm.org/D137601. xxHash is much faster than djbHash. This makes a simple Rust test case with a large constant string 10% faster to compile. Previous attempts at changing this hash function (e.g. https://reviews.llvm.org/D97396) had to be reverted due to breaking tests that depended on iteration order. No additional tests fail with this patch compared to `main` when running `check-all` with `-DLLVM_ENABLE_PROJECTS="all"` (on a Linux host), so I hope I found everything that needs to be changed. For posterity, the tests that fail on main are: ompd-test :: api_tests/test_ompd_finalize.c ompd-test :: api_tests/test_ompd_get_curr_parallel_handle.c Overall: Skipped : 43 Unsupported : 2862 Passed : 100507 Expectedly Failed:296 Failed : 2 Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D142862 Files: clang-tools-extra/clangd/unittests/BackgroundIndexTests.cpp clang-tools-extra/test/modularize/ProblemsDisplayLists.modularize clang-tools-extra/test/modularize/ProblemsInconsistent.modularize clang/unittests/Basic/SarifTest.cpp compiler-rt/test/profile/Linux/instrprof-show-debug-info-correlation.c lldb/test/API/functionalities/gdb_remote_client/TestGDBRemoteClient.py llvm/lib/Support/StringMap.cpp llvm/test/DebugInfo/Generic/accel-table-hash-collisions.ll llvm/test/DebugInfo/Generic/debug-names-hash-collisions.ll llvm/test/DebugInfo/X86/debug-pubtables-dwarf64.ll llvm/test/DebugInfo/X86/gnu-public-names-gmlt.ll llvm/test/DebugInfo/X86/gnu-public-names.ll llvm/test/ObjectYAML/Offload/binary.yaml llvm/test/ObjectYAML/Offload/multiple_members.yaml llvm/test/tools/dsymutil/ARM/extern-alias.test llvm/test/tools/llvm-profdata/suppl-instr-with-sample.test mlir/test/Transforms/print-op-graph.mlir mlir/test/mlir-lsp-server/completion.test Index: mlir/test/mlir-lsp-server/completion.test === --- mlir/test/mlir-lsp-server/completion.test +++ mlir/test/mlir-lsp-server/completion.test @@ -84,18 +84,18 @@ // CHECK-NEXT:"isIncomplete": false, // CHECK-NEXT:"items": [ // CHECK-NEXT: { -// CHECK-NEXT:"detail": "builtin.unrealized_conversion_cast: !pdl.value", -// CHECK-NEXT:"insertText": "cast", -// CHECK-NEXT:"insertTextFormat": 1, -// CHECK-NEXT:"kind": 6, -// CHECK-NEXT:"label": "%cast" -// CHECK-NEXT: }, -// CHECK-NEXT: { // CHECK-NEXT:"detail": "arg #0: i32", // CHECK-NEXT:"insertText": "arg", // CHECK-NEXT:"insertTextFormat": 1, // CHECK-NEXT:"kind": 6, // CHECK-NEXT:"label": "%arg" +// CHECK-NEXT: }, +// CHECK-NEXT: { +// CHECK-NEXT:"detail": "builtin.unrealized_conversion_cast: !pdl.value", +// CHECK-NEXT:"insertText": "cast", +// CHECK-NEXT:"insertTextFormat": 1, +// CHECK-NEXT:"kind": 6, +// CHECK-NEXT:"label": "%cast" // CHECK-NEXT: } // CHECK: ] // CHECK-NEXT: } Index: mlir/test/Transforms/print-op-graph.mlir === --- mlir/test/Transforms/print-op-graph.mlir +++ mlir/test/Transforms/print-op-graph.mlir @@ -6,49 +6,49 @@ // DFG: subgraph {{.*}} // DFG: label = "func.func{{.*}}merge_blocks // DFG: subgraph {{.*}} { -// DFG: v[[ARG0:.*]] [label = "arg0" -// DFG: v[[CONST10:.*]] [label ={{.*}}10 : i32 +// DFG: v[[ARG0:.*]] [shape = ellipse, label = "arg0" +// DFG: v[[CONST10:.*]] [shape = ellipse, label ={{.*}}10 : i32 // DFG: subgraph [[CLUSTER_MERGE_BLOCKS:.*]] { -// DFG: v[[ANCHOR:.*]] [label = " ", shape = plain] +// DFG: v[[ANCHOR:.*]] [shape = plain, label = " "] // DFG: label = "test.merge_blocks // DFG: subgraph {{.*}} { -// DFG: v[[TEST_BR:.*]] [label = "test.br +// DFG: v[[TEST_BR:.*]] [shape = ellipse, label = "test.br // DFG: } // DFG: subgraph {{.*}} { // DFG: } // DFG:
[Lldb-commits] [PATCH] D142862: [Support] change StringMap hash function from djbHash to xxHash
erikdesjardins added inline comments. Comment at: llvm/test/DebugInfo/X86/gnu-public-names.ll:68-71 ; ASM: .byte 32 # Attributes: VARIABLE, EXTERNAL +; ASM-NEXT: .asciz "ns::global_namespace_variable" # External Name +; ASM: .byte 32 # Attributes: VARIABLE, EXTERNAL ; ASM-NEXT: .asciz "global_variable" # External Name Previously, this was ``` ; ASM: .byte 32 # Attributes: VARIABLE, EXTERNAL ; ASM-NEXT: .asciz "global_variable" # External Name ...more lines... ; ASM: .byte 32 # Attributes: VARIABLE, EXTERNAL ; ASM-NEXT: .asciz "ns::global_namespace_variable" # External Name ``` but the reordering resulted in there being another `.byte 32` (a very fragile check line!) before `global_variable`. Comment at: llvm/test/DebugInfo/X86/gnu-public-names.ll:189 -; CHECK: DW_TAG_subprogram +; CHECK: [[GLOBAL_F7:0x[0-9a-f]+]]: DW_TAG_subprogram +; CHECK: DW_AT_linkage_name Similarly here--`f7` used to be at the end of the list below, and was just ignored, but now it appears in the middle Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142862/new/ https://reviews.llvm.org/D142862 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] e1bbe50 - Revert "[lldb] Make SBSection::GetSectionData call Section::GetSectionData."
Author: Muhammad Omair Javaid Date: 2023-01-30T12:34:37+05:00 New Revision: e1bbe50f5a48e9b5407de9e5f4ab8197dedc85c5 URL: https://github.com/llvm/llvm-project/commit/e1bbe50f5a48e9b5407de9e5f4ab8197dedc85c5 DIFF: https://github.com/llvm/llvm-project/commit/e1bbe50f5a48e9b5407de9e5f4ab8197dedc85c5.diff LOG: Revert "[lldb] Make SBSection::GetSectionData call Section::GetSectionData." This reverts commit 805600c7d573cf88cf035d01a2ea9389fc24d435. LLDB windows buildbots were broken by the TestSectionAPI.py test. I dont have full context of the commit to fix it. Reverting it temporarily. https://lab.llvm.org/buildbot/#/builders/83/builds/28617 https://lab.llvm.org/buildbot/#/builders/219/builds/180 Differential Revision: https://reviews.llvm.org/D142672 Added: Modified: lldb/source/API/SBSection.cpp lldb/test/API/python_api/section/TestSectionAPI.py Removed: lldb/test/API/python_api/section/compressed-sections.yaml diff --git a/lldb/source/API/SBSection.cpp b/lldb/source/API/SBSection.cpp index b7b94f3ece1a6..3a9cf20e484a5 100644 --- a/lldb/source/API/SBSection.cpp +++ b/lldb/source/API/SBSection.cpp @@ -182,10 +182,35 @@ SBData SBSection::GetSectionData(uint64_t offset, uint64_t size) { SBData sb_data; SectionSP section_sp(GetSP()); if (section_sp) { -DataExtractor section_data; -section_sp->GetSectionData(section_data); -sb_data.SetOpaque( -std::make_shared(section_data, offset, size)); +const uint64_t sect_file_size = section_sp->GetFileSize(); +if (sect_file_size > 0) { + ModuleSP module_sp(section_sp->GetModule()); + if (module_sp) { +ObjectFile *objfile = module_sp->GetObjectFile(); +if (objfile) { + const uint64_t sect_file_offset = + objfile->GetFileOffset() + section_sp->GetFileOffset(); + const uint64_t file_offset = sect_file_offset + offset; + uint64_t file_size = size; + if (file_size == UINT64_MAX) { +file_size = section_sp->GetByteSize(); +if (file_size > offset) + file_size -= offset; +else + file_size = 0; + } + auto data_buffer_sp = FileSystem::Instance().CreateDataBuffer( + objfile->GetFileSpec().GetPath(), file_size, file_offset); + if (data_buffer_sp && data_buffer_sp->GetByteSize() > 0) { +DataExtractorSP data_extractor_sp( +new DataExtractor(data_buffer_sp, objfile->GetByteOrder(), + objfile->GetAddressByteSize())); + +sb_data.SetOpaque(data_extractor_sp); + } +} + } +} } return sb_data; } diff --git a/lldb/test/API/python_api/section/TestSectionAPI.py b/lldb/test/API/python_api/section/TestSectionAPI.py index b01ddece0de36..ab9ae56238c8b 100644 --- a/lldb/test/API/python_api/section/TestSectionAPI.py +++ b/lldb/test/API/python_api/section/TestSectionAPI.py @@ -48,18 +48,3 @@ def test_get_alignment(self): section = target.modules[0].sections[0] self.assertEqual(section.GetAlignment(), 0x1000) self.assertEqual(section.alignment, 0x1000) - -def test_compressed_section_data(self): -exe = self.getBuildArtifact("compressed-sections.out") -self.yaml2obj("compressed-sections.yaml", exe) -target = self.dbg.CreateTarget(exe) -self.assertTrue(target, VALID_TARGET) - -# exe contains a single section with SHF_COMPRESSED. Check that -# GetSectionData returns the uncompressed data and not the raw contents -# of the section. -section = target.modules[0].sections[0] -section_data = section.GetSectionData().uint8s -self.assertEqual(section_data, - [0x20, 0x30, 0x40, 0x50, 0x60, 0x70, 0x80, 0x90]) - diff --git a/lldb/test/API/python_api/section/compressed-sections.yaml b/lldb/test/API/python_api/section/compressed-sections.yaml deleted file mode 100644 index a41307ef7d1fc..0 --- a/lldb/test/API/python_api/section/compressed-sections.yaml +++ /dev/null @@ -1,11 +0,0 @@ !ELF -FileHeader: - Class: ELFCLASS32 - Data:ELFDATA2LSB - Type:ET_REL - Machine: EM_386 -Sections: - - Name:.compressed -Type:SHT_PROGBITS -Flags: [ SHF_COMPRESSED ] -Content: 010008000100789c533070084828689809c802c1 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D142672: [lldb] Make SBSection::GetSectionData call Section::GetSectionData.
omjavaid reopened this revision. omjavaid added a comment. This revision is now accepted and ready to land. LLDB windows buildbots were broken by the TestSectionAPI.py test. I dont have full context of the commit to fix it. Reverting it temporarily. https://lab.llvm.org/buildbot/#/builders/83/builds/28617 https://lab.llvm.org/buildbot/#/builders/219/builds/180 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142672/new/ https://reviews.llvm.org/D142672 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits