[Lldb-commits] [lldb] [lldb][DWARFUnit] Implement PeekDIEName query (PR #78486)

2024-01-19 Thread Greg Clayton via lldb-commits
clayborg wrote: I was thinking about DIE -> name stuff, and was wondering if we would benefit from a cache of DIE offset to `DW_AT_name` and DIE offset to `DW_AT_linkage_name`. Not sure how many times we might lookup DIE names multiple times. https://github.com/llvm/llvm-project/pull/78486 __

[Lldb-commits] [lldb] [lldb][DWARFUnit] Implement PeekDIEName query (PR #78486)

2024-01-19 Thread Felipe de Azevedo Piovezan via lldb-commits
https://github.com/felipepiovezan closed https://github.com/llvm/llvm-project/pull/78486 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb][DWARFUnit] Implement PeekDIEName query (PR #78486)

2024-01-19 Thread Felipe de Azevedo Piovezan via lldb-commits
felipepiovezan wrote: > Now this is safe and all my issues are gone. Thanks for improving. Thanks for spotting the issue with the first implementation! https://github.com/llvm/llvm-project/pull/78486 ___ lldb-commits mailing list lldb-commits@lists.l

[Lldb-commits] [lldb] [lldb][DWARFUnit] Implement PeekDIEName query (PR #78486)

2024-01-19 Thread Greg Clayton via lldb-commits
https://github.com/clayborg approved this pull request. Now this is safe and all my issues are gone. Thanks for improving. https://github.com/llvm/llvm-project/pull/78486 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/

[Lldb-commits] [lldb] [lldb][DWARFUnit] Implement PeekDIEName query (PR #78486)

2024-01-19 Thread Felipe de Azevedo Piovezan via lldb-commits
felipepiovezan wrote: Make comments more grep-able. https://github.com/llvm/llvm-project/pull/78486 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb][DWARFUnit] Implement PeekDIEName query (PR #78486)

2024-01-19 Thread Felipe de Azevedo Piovezan via lldb-commits
https://github.com/felipepiovezan updated https://github.com/llvm/llvm-project/pull/78486 >From b0a33481162e24a7106cbd554b33ddb098df7612 Mon Sep 17 00:00:00 2001 From: Felipe de Azevedo Piovezan Date: Thu, 7 Dec 2023 11:26:52 -0800 Subject: [PATCH 1/5] [lldb][DWARFUnit] Implement PeekDIEName qu

[Lldb-commits] [lldb] [lldb][DWARFUnit] Implement PeekDIEName query (PR #78486)

2024-01-18 Thread Adrian Prantl via lldb-commits
https://github.com/adrian-prantl approved this pull request. https://github.com/llvm/llvm-project/pull/78486 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb][DWARFUnit] Implement PeekDIEName query (PR #78486)

2024-01-18 Thread Adrian Prantl via lldb-commits
https://github.com/adrian-prantl edited https://github.com/llvm/llvm-project/pull/78486 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb][DWARFUnit] Implement PeekDIEName query (PR #78486)

2024-01-18 Thread Adrian Prantl via lldb-commits
@@ -663,6 +663,30 @@ DWARFUnit::GetDIE(dw_offset_t die_offset) { return DWARFDIE(); // Not found } +llvm::StringRef DWARFUnit::PeekDIEName(dw_offset_t die_offset) { + DWARFDebugInfoEntry die; + if (!die.Extract(GetData(), this, &die_offset)) +return llvm::StringRef();

[Lldb-commits] [lldb] [lldb][DWARFUnit] Implement PeekDIEName query (PR #78486)

2024-01-18 Thread Felipe de Azevedo Piovezan via lldb-commits
felipepiovezan wrote: @clayborg with your feedback, I think I was able to solve the issue _and_ reuse existing code. Please have a look at the latest commit! https://github.com/llvm/llvm-project/pull/78486 ___ lldb-commits mailing list lldb-commits@l

[Lldb-commits] [lldb] [lldb][DWARFUnit] Implement PeekDIEName query (PR #78486)

2024-01-18 Thread Felipe de Azevedo Piovezan via lldb-commits
https://github.com/felipepiovezan updated https://github.com/llvm/llvm-project/pull/78486 >From b0a33481162e24a7106cbd554b33ddb098df7612 Mon Sep 17 00:00:00 2001 From: Felipe de Azevedo Piovezan Date: Thu, 7 Dec 2023 11:26:52 -0800 Subject: [PATCH 1/4] [lldb][DWARFUnit] Implement PeekDIEName qu

[Lldb-commits] [lldb] [lldb][DWARFUnit] Implement PeekDIEName query (PR #78486)

2024-01-18 Thread Felipe de Azevedo Piovezan via lldb-commits
@@ -663,6 +663,14 @@ DWARFUnit::GetDIE(dw_offset_t die_offset) { return DWARFDIE(); // Not found } +llvm::StringRef DWARFUnit::PeekDIEName(dw_offset_t die_offset) { + const DWARFDataExtractor &data = GetData(); + DWARFDebugInfoEntry die; + if (!die.Extract(data, this, &di

[Lldb-commits] [lldb] [lldb][DWARFUnit] Implement PeekDIEName query (PR #78486)

2024-01-17 Thread Greg Clayton via lldb-commits
@@ -663,6 +663,14 @@ DWARFUnit::GetDIE(dw_offset_t die_offset) { return DWARFDIE(); // Not found } +llvm::StringRef DWARFUnit::PeekDIEName(dw_offset_t die_offset) { + const DWARFDataExtractor &data = GetData(); + DWARFDebugInfoEntry die; + if (!die.Extract(data, this, &di

[Lldb-commits] [lldb] [lldb][DWARFUnit] Implement PeekDIEName query (PR #78486)

2024-01-17 Thread Greg Clayton via lldb-commits
@@ -663,6 +663,14 @@ DWARFUnit::GetDIE(dw_offset_t die_offset) { return DWARFDIE(); // Not found } +llvm::StringRef DWARFUnit::PeekDIEName(dw_offset_t die_offset) { + const DWARFDataExtractor &data = GetData(); + DWARFDebugInfoEntry die; + if (!die.Extract(data, this, &di

[Lldb-commits] [lldb] [lldb][DWARFUnit] Implement PeekDIEName query (PR #78486)

2024-01-17 Thread Felipe de Azevedo Piovezan via lldb-commits
https://github.com/felipepiovezan updated https://github.com/llvm/llvm-project/pull/78486 >From b0a33481162e24a7106cbd554b33ddb098df7612 Mon Sep 17 00:00:00 2001 From: Felipe de Azevedo Piovezan Date: Thu, 7 Dec 2023 11:26:52 -0800 Subject: [PATCH 1/3] [lldb][DWARFUnit] Implement PeekDIEName qu

[Lldb-commits] [lldb] [lldb][DWARFUnit] Implement PeekDIEName query (PR #78486)

2024-01-17 Thread Felipe de Azevedo Piovezan via lldb-commits
felipepiovezan wrote: Added tests for AT_specification and AT_abstract origin. @clayborg I didn't change the implementation because IIUC the "parsed DIE" is merely a structure with computed parent/child/sibling relationship, we don't build any data structures for the attributes themselves. I

[Lldb-commits] [lldb] [lldb][DWARFUnit] Implement PeekDIEName query (PR #78486)

2024-01-17 Thread Felipe de Azevedo Piovezan via lldb-commits
https://github.com/felipepiovezan updated https://github.com/llvm/llvm-project/pull/78486 >From b0a33481162e24a7106cbd554b33ddb098df7612 Mon Sep 17 00:00:00 2001 From: Felipe de Azevedo Piovezan Date: Thu, 7 Dec 2023 11:26:52 -0800 Subject: [PATCH 1/2] [lldb][DWARFUnit] Implement PeekDIEName qu

[Lldb-commits] [lldb] [lldb][DWARFUnit] Implement PeekDIEName query (PR #78486)

2024-01-17 Thread Felipe de Azevedo Piovezan via lldb-commits
@@ -663,6 +663,14 @@ DWARFUnit::GetDIE(dw_offset_t die_offset) { return DWARFDIE(); // Not found } +llvm::StringRef DWARFUnit::PeekDIEName(dw_offset_t die_offset) { + const DWARFDataExtractor &data = GetData(); + DWARFDebugInfoEntry die; + if (!die.Extract(data, this, &di

[Lldb-commits] [lldb] [lldb][DWARFUnit] Implement PeekDIEName query (PR #78486)

2024-01-17 Thread Felipe de Azevedo Piovezan via lldb-commits
@@ -663,6 +663,14 @@ DWARFUnit::GetDIE(dw_offset_t die_offset) { return DWARFDIE(); // Not found } +llvm::StringRef DWARFUnit::PeekDIEName(dw_offset_t die_offset) { + const DWARFDataExtractor &data = GetData(); + DWARFDebugInfoEntry die; + if (!die.Extract(data, this, &di

[Lldb-commits] [lldb] [lldb][DWARFUnit] Implement PeekDIEName query (PR #78486)

2024-01-17 Thread Greg Clayton via lldb-commits
@@ -104,3 +105,61 @@ TEST(DWARFDIETest, ChildIteration) { DWARFDIE no_children_die(unit, die_child0); EXPECT_TRUE(no_children_die.children().empty()); } + +TEST(DWARFDIETest, PeekName) { + const char *yamldata = R"( +--- !ELF +FileHeader: clayborg wrote:

[Lldb-commits] [lldb] [lldb][DWARFUnit] Implement PeekDIEName query (PR #78486)

2024-01-17 Thread Greg Clayton via lldb-commits
@@ -663,6 +663,14 @@ DWARFUnit::GetDIE(dw_offset_t die_offset) { return DWARFDIE(); // Not found } +llvm::StringRef DWARFUnit::PeekDIEName(dw_offset_t die_offset) { + const DWARFDataExtractor &data = GetData(); + DWARFDebugInfoEntry die; + if (!die.Extract(data, this, &di

[Lldb-commits] [lldb] [lldb][DWARFUnit] Implement PeekDIEName query (PR #78486)

2024-01-17 Thread via lldb-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff 2d5cc1c9b3c8b8b7cd0ed9dec79489940161d73a b0a33481162e24a7106cbd554b33ddb098df7612 --

[Lldb-commits] [lldb] [lldb][DWARFUnit] Implement PeekDIEName query (PR #78486)

2024-01-17 Thread Felipe de Azevedo Piovezan via lldb-commits
https://github.com/felipepiovezan updated https://github.com/llvm/llvm-project/pull/78486 >From b0a33481162e24a7106cbd554b33ddb098df7612 Mon Sep 17 00:00:00 2001 From: Felipe de Azevedo Piovezan Date: Thu, 7 Dec 2023 11:26:52 -0800 Subject: [PATCH] [lldb][DWARFUnit] Implement PeekDIEName query

[Lldb-commits] [lldb] [lldb][DWARFUnit] Implement PeekDIEName query (PR #78486)

2024-01-17 Thread via lldb-commits
llvmbot wrote: @llvm/pr-subscribers-lldb Author: Felipe de Azevedo Piovezan (felipepiovezan) Changes This allows us to query the AT_Name of a DIE without parsing the entire CU. Part of the ongoing effort to support IDX_Parent in accelerator tables [1]. [1]: https://discourse.llvm.org/t/

[Lldb-commits] [lldb] [lldb][DWARFUnit] Implement PeekDIEName query (PR #78486)

2024-01-17 Thread Felipe de Azevedo Piovezan via lldb-commits
https://github.com/felipepiovezan created https://github.com/llvm/llvm-project/pull/78486 This allows us to query the AT_Name of a DIE without parsing the entire CU. Part of the ongoing effort to support IDX_Parent in accelerator tables [1]. [1]: https://discourse.llvm.org/t/rfc-improve-dwarf