[PATCH] D153536: [Clang] Implement P2169 A nice placeholder with no name

Hubert Tong via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 6 18:48:21 PDT 2023


hubert.reinterpretcast added a comment.

In D153536#4474066 <https://reviews.llvm.org/D153536#4474066>, @cor3ntin wrote:

> Seems to work well enough @hubert.reinterpretcast

It seems the class member case trips up debuggers.

  union U {
    struct A { int _, _; } a;
    struct B { int x, y; } b;
  };
  U u = {{1, 2}};
  
  int main(void) { return u.b.x; }



  (lldb) b main
  Breakpoint 1: where = a.out`main + 28 at placeholderDbg.cc:7:18, address = 0x000000000001080c
  (lldb) r
  Process 2339034 launched: '/terrannew/hstong/.Lpcoral03/llvmbld/a.out' (powerpc64le)
  Process 2339034 stopped
  * thread #1, name = 'a.out', stop reason = breakpoint 1.1
      frame #0: 0x000000010001080c a.out`main at placeholderDbg.cc:7:18
     4    };
     5    U u = {{1, 2}};
     6
  -> 7    int main(void) { return u.b.x; }
  (lldb) print u
  (U) {
    a = (_ = 1)
    b = (x = 1, y = 2)
  }
  (lldb)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D153536



More information about the cfe-commits mailing list