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

Digger Lin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 8 06:21:08 PDT 2023


DiggerLin marked an inline comment as done.
DiggerLin added inline comments.


================
Comment at: llvm/tools/llvm-objdump/XCOFFDump.cpp:378
+  if (Remaining >= 8) {
+    while (Remaining > 0 && Bytes[Size - Remaining] == 0)
+      --Remaining;
----------------
xingxue wrote:
> 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? 
Print out no-zero value will letting user know what is non-zero value of the padding(in our llvm xcoff ojbect writer, the padding will always zero for sections, if not zero means ,something wrong, and printing out non-zero will let user get more info)
@hubert.reinterpretcast , do you have any option on above xing's comment ?


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