[Lldb-commits] [PATCH] D151950: [lldb] Unconditionally increment depth when printing children

Adrian Prantl via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Jun 8 08:31:42 PDT 2023


aprantl accepted this revision.
aprantl added inline comments.


================
Comment at: lldb/source/DataFormatters/ValueObjectPrinter.cpp:610
 
   if (child_sp.get()) {
     ValueObjectPrinter child_printer(
----------------
I would probably factor out:
```
if (does_consume_ptr_depth)
   --curr_ptr_depth;
```


================
Comment at: lldb/test/API/lang/cpp/frame-var-depth-and-elem-count/main.cpp:15
+  C *c = new C[5];
+  return 0; // break here
+}
----------------
Setting a breakpoint on the return is risky because there may not be any code associated with it. Something like
```
int puts(const char *s);

puts("break here");
```
is safer.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D151950



More information about the lldb-commits mailing list