[rtems-tools PATCH] record: Allow to compile with recent llvm version.

list at c-mauderer.de list at c-mauderer.de
Tue Dec 17 14:48:17 UTC 2019


From: Christian Mauderer <Christian.Mauderer at embedded-brains.de>

It seems that the API for symbolizeCode changed between llvm8 and llvm9.
This patch uses the same adaption that is used for the llvm-symbolizer
tool in llvm commit b2c4b8bded3ff2efaaebe0d8b33c65116f9ef8de.
---
 trace/record/record-main-lttng.cc | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/trace/record/record-main-lttng.cc b/trace/record/record-main-lttng.cc
index f37106b284..c84f40b14d 100644
--- a/trace/record/record-main-lttng.cc
+++ b/trace/record/record-main-lttng.cc
@@ -323,7 +323,12 @@ LTTNGClient::AddressToLineMap::iterator LTTNGClient::ResolveAddress(
     const ClientItem& item) {
 #ifdef HAVE_LLVM_DEBUGINFO_SYMBOLIZE_SYMBOLIZE_H
   if (resolve_address_) {
-    auto res_or_err = symbolizer_.symbolizeCode(elf_file_, item.data);
+    auto res_or_err = symbolizer_.symbolizeCode(elf_file_,
+#if LLVM_VERSION_MAJOR >= 9
+      {item.data, llvm::object::SectionedAddress::UndefSection});
+#else
+      item.data);
+#endif
 
     if (res_or_err) {
       auto info = res_or_err.get();
-- 
2.24.0



More information about the devel mailing list