[PATCH] D89049: [AIX][XCOFF] print out the traceback info

Xing Xue via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 3 08:22:55 PDT 2023


xingxue added inline comments.


================
Comment at: llvm/tools/llvm-objdump/XCOFFDump.cpp:378
+  if (Remaining >= 8) {
+    while (Remaining > 0 && Bytes[Size - Remaining] == 0)
+      --Remaining;
----------------
DiggerLin wrote:
> xingxue wrote:
> > If the remaining bytes are paddings, why do we differentiate if a padding is zero or not? Can we just print `...` or `... # Paddings` for paddings?
> it just to print out the "... # Paddings" if all the remaining is zero and there are 8  or more bytes remaining in the end. 
> 
> otherwise, it will print all the bytes out with following code.
> 
> 
> ```
>  uint16_t AlignmentLen = 4 - Index % 4;
>   printRawData(Bytes.slice(Index, AlignmentLen), Address + Index, OS, STI);
>   OS << "\t# Padding\n";
>   Index += AlignmentLen;
>   while (Index < End - Address) {
>     printRawData(Bytes.slice(Index, 4), Address + Index, OS, STI);
>     OS << "\t# Padding\n";
>     Index += 4;
>   }
> ```
> 
I meant to print `...` or `...\t# Paddings` to indicate the rest are paddings regardless of whether a padding byte is zero or not. @stephenpeckham @jhenderson, what do you think? 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D89049



More information about the llvm-commits mailing list