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

David Blaikie via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 18 16:37:50 PDT 2023


dblaikie added a comment.

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

> @dblaikie Would you be willing to look at the debugger side of things in a subsequent patch? I'm not familiar with debug symbol code gen so I'm not sure I'd be able to improve thing the right way.

Not sure I've got the time to do the fix myself, but might be able to provide pointers.

but at least at a first blush I can't reproduce the failures shown...

  struct t1 {
    int _;
    int _;
  };
  t1 v1;
  int main() {
    int _;
    int _;
  }

  0x0000002e:   DW_TAG_structure_type
                  DW_AT_calling_convention        (DW_CC_pass_by_value)
                  DW_AT_name      ("t1")
                  DW_AT_byte_size (0x08)
                  DW_AT_decl_file ("/usr/local/google/home/blaikie/dev/scratch/unused_member.cpp")
                  DW_AT_decl_line (1)
  
  0x00000034:     DW_TAG_member
                    DW_AT_name    ("_")
                    DW_AT_type    (0x00000047 "int")
                    DW_AT_decl_file       ("/usr/local/google/home/blaikie/dev/scratch/unused_member.cpp")
                    DW_AT_decl_line       (2)
                    DW_AT_data_member_location    (0x00)
  
  0x0000003d:     DW_TAG_member
                    DW_AT_name    ("_")
                    DW_AT_type    (0x00000047 "int")
                    DW_AT_decl_file       ("/usr/local/google/home/blaikie/dev/scratch/unused_member.cpp")
                    DW_AT_decl_line       (2)
                    DW_AT_data_member_location    (0x00)
  
  0x00000046:     NULL
  
  0x00000047:   DW_TAG_base_type
                  DW_AT_name      ("int")
                  DW_AT_encoding  (DW_ATE_signed)
                  DW_AT_byte_size (0x04)
  
  0x0000004b:   DW_TAG_subprogram
                  DW_AT_low_pc    (0x0000000000000000)
                  DW_AT_high_pc   (0x0000000000000008)
                  DW_AT_frame_base        (DW_OP_reg6 RBP)
                  DW_AT_name      ("main")
                  DW_AT_decl_file ("/usr/local/google/home/blaikie/dev/scratch/unused_member.cpp")
                  DW_AT_decl_line (6)
                  DW_AT_type      (0x00000047 "int")
                  DW_AT_external  (true)
  
  0x0000005a:     DW_TAG_variable
                    DW_AT_location        (DW_OP_fbreg -4)
                    DW_AT_name    ("_")
                    DW_AT_decl_file       ("/usr/local/google/home/blaikie/dev/scratch/unused_member.cpp")
                    DW_AT_decl_line       (7)
                    DW_AT_type    (0x00000047 "int")
  
  0x00000065:     DW_TAG_variable
                    DW_AT_location        (DW_OP_fbreg -8)
                    DW_AT_name    ("_")
                    DW_AT_decl_file       ("/usr/local/google/home/blaikie/dev/scratch/unused_member.cpp")
                    DW_AT_decl_line       (8)
                    DW_AT_type    (0x00000047 "int")

Looks OK to me - two local variables with the same name, two member variables with the same name.

so probably at least one bug in lldb because it does seem to think `t1` has only one member. But the DWARF I see for the local variables doesn't seem to match the dump shown in https://reviews.llvm.org/D153536#4483191


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