[Lldb-commits] [PATCH] D155107: Add support for llvm::MCInstPrinter::setPrintBranchImmAsAddress

Jason Molenda via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Jul 19 23:38:31 PDT 2023


jasonmolenda added a comment.

PrintBranchImmAsAddress is used in the RISCV, aarch64, PPC, Mips, and X86 instruction printers - most of them in one or two spots.  I tried a quick attempt at writing a program that would change output with the aarch64 instruction printer but didn't succeed at first blush.  Setting this will change some values from being an immediate to an address, but my primary concern was the symbolication we get with the aarch64 printer, like Greg noted, we already have the full address printed without this setting on aarch64, e.g.

  a.out[0x100003f3c] <+64>:  b      0x100003f40               ; <+68> at a.c:8:7

I forget what callback we register to construct the comment in lldb's disassembler offhand (the `; <+68> at a.c:8:7`) - it's weird that Ted isn't seeing that with the RISCV disassembly.

I don't have an objection to try setting PrintBranchImmAsAddress if we can't find an arch printer that prints something undesirable with it enabled.  (my five minute stab at x86-64 and aarch64 couldn't find one).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155107/new/

https://reviews.llvm.org/D155107



More information about the lldb-commits mailing list