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

Christian Mauderer christianm at rtems.org
Wed Dec 18 08:12:18 UTC 2019


Module:    rtems-tools
Branch:    master
Commit:    beeeb59cea76a347e72bc2971f5dbd1e2971e682
Changeset: http://git.rtems.org/rtems-tools/commit/?id=beeeb59cea76a347e72bc2971f5dbd1e2971e682

Author:    Christian Mauderer <Christian.Mauderer at embedded-brains.de>
Date:      Tue Dec 17 14:51:19 2019 +0100

record: Allow to compile with recent llvm version.

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 f37106b..c84f40b 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();



More information about the vc mailing list