[PATCH] D81585: [AIX][XCOFF][Patch1] Provide decoding trace back table information API for xcoff object file for llvm-objdump -d

Jason Liu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 8 14:35:27 PDT 2020


jasonliu added inline comments.


================
Comment at: llvm/lib/Object/XCOFFObjectFile.cpp:904
+  if (!Err && isFuncNamePresent()) {
+    uint16_t Len = DE.getU16(&offset_ptr, &Err);
+    if (!Err)
----------------
jasonliu wrote:
> DiggerLin wrote:
> > jasonliu wrote:
> > > Why do we need to declare a new variable?
> > yes , we need it . it been use here 
> > FunctionName = DE.getBytes(&offset_ptr, Len, &Err);
> > 
> > since after we get a value the point offset_ptr  moved, we can not get it second time.
> What's wrong with 
> ```
>     FunctionNameLen = DE.getU16(&OffsetPtr, &Err);
>     if (!Err)
>       FunctionName = DE.getBytes(&OffsetPtr, Len, &Err);
> ```
> ?
I meant
```
FunctionNameLen = DE.getU16(&OffsetPtr, &Err);
if (!Err)
  FunctionName = DE.getBytes(&OffsetPtr, FunctionNameLen, &Err);
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81585





More information about the llvm-commits mailing list