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

Hubert Tong via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Jul 8 20:54:48 PDT 2023


hubert.reinterpretcast added a comment.

In D153536#4483182 <https://reviews.llvm.org/D153536#4483182>, @hubert.reinterpretcast wrote:

> If `llvm-dwarfdump` is to be believed, it looks like a compiler bug (two members reported at the same offset).

Similarly, only one local variable out of two in the same line reported:

  $ cat placeholderDbg2.cc
  extern "C" int printf(const char *, ...);
  struct A {
    A(int x) : x(x) { }
    ~A() { printf("%d\n", x); }
    int x;
  };
  int main() {
    A _ = 0, _ = 1;
    return 0;
  }
  Return:  0x00:0   Sat Jul  8 23:52:46 2023 EDT



  (lldb) target create "a.out"
  Current executable set to '/terrannew/hstong/.Lpcoral03/llvmbld/a.out' (powerpc64le).
  (lldb) b 9
  Breakpoint 1: where = a.out`main + 68 at placeholderDbg2.cc:9:3, address = 0x0000000000010ab4
  (lldb) r
  Process 2951717 launched: '/terrannew/hstong/.Lpcoral03/llvmbld/a.out' (powerpc64le)
  Process 2951717 stopped
  * thread #1, name = 'a.out', stop reason = breakpoint 1.1
      frame #0: 0x0000000100010ab4 a.out`main at placeholderDbg2.cc:9:3
     6    };
     7    int main() {
     8      A _ = 0, _ = 1;
  -> 9      return 0;
     10   }
  (lldb) var
  (A) _ = (x = 0)
  (lldb) c
  Process 2951717 resuming
  1
  0
  Process 2951717 exited with status = 0 (0x00000000)
  (lldb) q



  0x0000009b:   DW_TAG_subprogram [14] * (0x0000000b)
                  DW_AT_low_pc [DW_FORM_addr]     (0x0000000000010a70)
                  DW_AT_high_pc [DW_FORM_data4]   (0x000000b4)
                  DW_AT_frame_base [DW_FORM_exprloc]      (DW_OP_reg31 X31)
                  DW_AT_name [DW_FORM_strp]       ( .debug_str[0x00000086] = "main")
                  DW_AT_decl_file [DW_FORM_data1] ("/terrannew/hstong/.Lpcoral03/llvmbld/placeholderDbg2.cc")
                  DW_AT_decl_line [DW_FORM_data1] (7)
                  DW_AT_type [DW_FORM_ref4]       (cu + 0x008f => {0x0000008f} "int")
                  DW_AT_external [DW_FORM_flag_present]   (true)
  
  0x000000b4:     DW_TAG_variable [15]   (0x0000009b)
                    DW_AT_location [DW_FORM_exprloc]      (DW_OP_fbreg +128)
                    DW_AT_name [DW_FORM_strp]     ( .debug_str[0x0000008b] = "_")
                    DW_AT_decl_file [DW_FORM_data1]       ("/terrannew/hstong/.Lpcoral03/llvmbld/placeholderDbg2.cc")
                    DW_AT_decl_line [DW_FORM_data1]       (8)
                    DW_AT_type [DW_FORM_ref4]     (cu + 0x005a => {0x0000005a} "A")
  
  0x000000c3:     NULL


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