[PATCH] D121100: [clang][DebugInfo] clang should not generate DW_TAG_subprogram entry without DW_AT_name

2022-05-26 Thread Adrian Prantl via Phabricator via cfe-commits
aprantl added a comment.

In D121100#3530683 , @alok wrote:

> GNU gdb is now modified to accept functions with linkage name.
>
>   commit 6f9b09edaee43ea34d34b1998fe7b844834f251a
>   Author: Alok Kumar Sharma 
>   Date:   Sun May 22 21:46:06 2022 +0530

Nice work!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121100

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D121100: [clang][DebugInfo] clang should not generate DW_TAG_subprogram entry without DW_AT_name

2022-05-22 Thread Alok Kumar Sharma via Phabricator via cfe-commits
alok abandoned this revision.
alok added a comment.

GNU gdb is now modified to accept functions with linkage name.

  commit 6f9b09edaee43ea34d34b1998fe7b844834f251a
  Author: Alok Kumar Sharma 
  Date:   Sun May 22 21:46:06 2022 +0530


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121100

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D121100: [clang][DebugInfo] clang should not generate DW_TAG_subprogram entry without DW_AT_name

2022-03-10 Thread Adrian Prantl via Phabricator via cfe-commits
aprantl added a comment.

Ideally, this would be fixed in GDB. If that's really not feasibly I would 
rather like to see this as a gdb debugger tuning instead f the default behavior.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121100

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D121100: [clang][DebugInfo] clang should not generate DW_TAG_subprogram entry without DW_AT_name

2022-03-10 Thread David Blaikie via Phabricator via cfe-commits
dblaikie added a comment.

Yeah, happy to hear other perspectives - but my rough reaction is similar: 
putting mangled names in the "name" field seems problematic (consumer wouldn't 
necessarily know that the name should be demangled, for instance? Maybe?). So 
at the IR level maybe it's better to leave those in the linkage name - and 
maybe we workaround it in the backend when tuning for gdb - putting it in the 
DW_AT_name field because it's not ideal but the best we can do for GDB? (anyone 
filed a bug with GDB and/or DWARF for this? (I'd start with GDB and see if 
they're open to the idea directly - don't use the DWARF committee as an 
indirect way to request feature work for GDB unless they'd prefer it to be 
formalized before implementing it))

The various _ and __ names are probably OK as names, but the tests that end up 
producing mangled names into linkage names seem like not the right direction - 
maybe those entities need/are missing real names anyway? Might be worth 
comparing/contrasting with GCC's behavior for similar entities (at a glance at 
the tests, looks like some thunks are in this situation?)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121100

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D121100: [clang][DebugInfo] clang should not generate DW_TAG_subprogram entry without DW_AT_name

2022-03-10 Thread Djordje Todorovic via Phabricator via cfe-commits
djtodoro added a comment.

Hmmm... if this should be done within compiler side, I am wondering whether 
this should be resolved in AsmPrinter/DwarfDebug instead.
@aprantl please let me know wyt?

However, it looks like that after this hack the `name` here isn't the 
appropriate one... and it looks like something that debuggers should know how 
to workout ...


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121100

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D121100: [clang][DebugInfo] clang should not generate DW_TAG_subprogram entry without DW_AT_name

2022-03-07 Thread Alok Kumar Sharma via Phabricator via cfe-commits
alok created this revision.
alok added reviewers: aprantl, djtodoro, jini.susan.
alok added a project: debug-info.
Herald added a project: All.
alok requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Currently Clang is generating subprograms without DW_AT_name. which is fine for 
LLDB but other debuggers (GNU gdb) can not be forced to accept such DWARF due 
to DWARF standard mandating DW_AT_name attribute for subprograms.

As per DWARF standard Subroutine must have DW_AT_name attribute.
Please consider below lines from DWARF(5) document

  3.3.1 General Subroutine and Entry Point Information
   The subroutine or entry point entry has a DW_AT_name attribute whose value is
   a null-terminated string containing the subroutine or entry point name. It 
may
   also have a DW_AT_linkage_name attribute as described in Section 2.22 on
   page 56.

Current behavior of Clang prevents gdb to show variables in shared/private 
clause of Openmp task construct.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D121100

Files:
  clang/lib/CodeGen/CGDebugInfo.cpp
  clang/test/CodeGen/constructor-attribute.c
  clang/test/CodeGen/debug-info-oslog.c
  clang/test/CodeGenCXX/aix-static-init-debug-info.cpp
  clang/test/CodeGenCXX/debug-info-blocks.cpp
  clang/test/CodeGenCXX/debug-info-thunk.cpp
  clang/test/CodeGenCXX/difile_entry.cpp
  clang/test/CodeGenCXX/globalinit-loc.cpp
  clang/test/CodeGenObjC/block-byref-debuginfo.m
  clang/test/CodeGenObjC/debug-info-block-helper.m
  clang/test/CodeGenObjC/debug-info-blocks.m
  clang/test/CodeGenObjC/nontrivial-c-struct-exception.m
  clang/test/OpenMP/master_taskloop_reduction_codegen.cpp
  clang/test/OpenMP/master_taskloop_simd_reduction_codegen.cpp
  clang/test/OpenMP/parallel_master_taskloop_reduction_codegen.cpp
  clang/test/OpenMP/parallel_master_taskloop_simd_reduction_codegen.cpp
  clang/test/OpenMP/simd_codegen.cpp
  clang/test/OpenMP/taskgroup_task_reduction_codegen.cpp
  clang/test/OpenMP/taskloop_reduction_codegen.cpp
  clang/test/OpenMP/taskloop_simd_reduction_codegen.cpp

Index: clang/test/OpenMP/taskloop_simd_reduction_codegen.cpp
===
--- clang/test/OpenMP/taskloop_simd_reduction_codegen.cpp
+++ clang/test/OpenMP/taskloop_simd_reduction_codegen.cpp
@@ -213,12 +213,12 @@
 // CHECK: store float %{{.+}}, float* %
 // CHECK: ret void
 
-// CHECK-DAG: !DISubprogram(linkageName: "[[RED_INIT1]]"
-// CHECK-DAG: !DISubprogram(linkageName: "[[RED_COMB1]]"
-// CHECK-DAG: !DISubprogram(linkageName: "[[RED_INIT2]]"
-// CHECK-DAG: !DISubprogram(linkageName: "[[RED_FINI2]]"
-// CHECK-DAG: !DISubprogram(linkageName: "[[RED_COMB2]]"
-// CHECK-DAG: !DISubprogram(linkageName: "[[RED_INIT3]]"
-// CHECK-DAG: !DISubprogram(linkageName: "[[RED_COMB3]]"
-// CHECK-DAG: !DISubprogram(linkageName: "[[RED_INIT4]]"
-// CHECK-DAG: !DISubprogram(linkageName: "[[RED_COMB4]]"
+// CHECK-DAG: !DISubprogram(name: "[[RED_INIT1]]"
+// CHECK-DAG: !DISubprogram(name: "[[RED_COMB1]]"
+// CHECK-DAG: !DISubprogram(name: "[[RED_INIT2]]"
+// CHECK-DAG: !DISubprogram(name: "[[RED_FINI2]]"
+// CHECK-DAG: !DISubprogram(name: "[[RED_COMB2]]"
+// CHECK-DAG: !DISubprogram(name: "[[RED_INIT3]]"
+// CHECK-DAG: !DISubprogram(name: "[[RED_COMB3]]"
+// CHECK-DAG: !DISubprogram(name: "[[RED_INIT4]]"
+// CHECK-DAG: !DISubprogram(name: "[[RED_COMB4]]"
Index: clang/test/OpenMP/taskloop_reduction_codegen.cpp
===
--- clang/test/OpenMP/taskloop_reduction_codegen.cpp
+++ clang/test/OpenMP/taskloop_reduction_codegen.cpp
@@ -220,13 +220,13 @@
 // CHECK: call i8* @__kmpc_task_reduction_get_th_data(
 // CHECK: call i8* @__kmpc_task_reduction_get_th_data(
 
-// CHECK-DAG: distinct !DISubprogram(linkageName: "[[TASK]]", scope: !
-// CHECK-DAG: !DISubprogram(linkageName: "[[RED_INIT1]]"
-// CHECK-DAG: !DISubprogram(linkageName: "[[RED_COMB1]]"
-// CHECK-DAG: !DISubprogram(linkageName: "[[RED_INIT2]]"
-// CHECK-DAG: !DISubprogram(linkageName: "[[RED_FINI2]]"
-// CHECK-DAG: !DISubprogram(linkageName: "[[RED_COMB2]]"
-// CHECK-DAG: !DISubprogram(linkageName: "[[RED_INIT3]]"
-// CHECK-DAG: !DISubprogram(linkageName: "[[RED_COMB3]]"
-// CHECK-DAG: !DISubprogram(linkageName: "[[RED_INIT4]]"
-// CHECK-DAG: !DISubprogram(linkageName: "[[RED_COMB4]]"
+// CHECK-DAG: distinct !DISubprogram(name: "[[TASK]]", scope: !
+// CHECK-DAG: !DISubprogram(name: "[[RED_INIT1]]"
+// CHECK-DAG: !DISubprogram(name: "[[RED_COMB1]]"
+// CHECK-DAG: !DISubprogram(name: "[[RED_INIT2]]"
+// CHECK-DAG: !DISubprogram(name: "[[RED_FINI2]]"
+// CHECK-DAG: !DISubprogram(name: "[[RED_COMB2]]"
+// CHECK-DAG: !DISubprogram(name: "[[RED_INIT3]]"
+// CHECK-DAG: !DISubprogram(name: "[[RED_COMB3]]"
+// CHECK-DAG: !DISubprogram(name: "[[RED_INIT4]]"
+// CHECK-DAG: !DISubprogram(name: "[[RED_COMB4]]"
Index: clang/test/OpenMP/taskgroup_task_reduction_codegen.cpp