public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug symtab/17272] New: DW_TAG_GNU_template_parameter_pack
@ 2014-08-14 20:44 dje at google dot com
  2023-01-14  0:24 ` [Bug symtab/17272] DW_TAG_GNU_template_parameter_pack ed at catmur dot uk
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: dje at google dot com @ 2014-08-14 20:44 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=17272

            Bug ID: 17272
           Summary: DW_TAG_GNU_template_parameter_pack
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: symtab
          Assignee: unassigned at sourceware dot org
          Reporter: dje at google dot com

Setting complaints to 100 and debugging a file I noticed several messages like
this:

During symbol reading, unsupported tag: 'DW_TAG_GNU_template_parameter_pack'.

First I'd heard of this tag.
We need to look into what, if anything, is required to support it.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug symtab/17272] DW_TAG_GNU_template_parameter_pack
  2014-08-14 20:44 [Bug symtab/17272] New: DW_TAG_GNU_template_parameter_pack dje at google dot com
@ 2023-01-14  0:24 ` ed at catmur dot uk
  2023-01-14  1:57 ` tromey at sourceware dot org
                   ` (13 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: ed at catmur dot uk @ 2023-01-14  0:24 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=17272

--- Comment #5 from Ed Catmur <ed at catmur dot uk> ---
PR: https://github.com/ecatmur/binutils-gdb/pull/1

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug symtab/17272] DW_TAG_GNU_template_parameter_pack
  2014-08-14 20:44 [Bug symtab/17272] New: DW_TAG_GNU_template_parameter_pack dje at google dot com
  2023-01-14  0:24 ` [Bug symtab/17272] DW_TAG_GNU_template_parameter_pack ed at catmur dot uk
@ 2023-01-14  1:57 ` tromey at sourceware dot org
  2023-01-14 12:58 ` ssbssa at sourceware dot org
                   ` (12 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: tromey at sourceware dot org @ 2023-01-14  1:57 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=17272

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at sourceware dot org

--- Comment #6 from Tom Tromey <tromey at sourceware dot org> ---
(In reply to Ed Catmur from comment #5)
> PR: https://github.com/ecatmur/binutils-gdb/pull/1

gdb does not use github but rather email.
https://sourceware.org/gdb/wiki/ContributionChecklist

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug symtab/17272] DW_TAG_GNU_template_parameter_pack
  2014-08-14 20:44 [Bug symtab/17272] New: DW_TAG_GNU_template_parameter_pack dje at google dot com
  2023-01-14  0:24 ` [Bug symtab/17272] DW_TAG_GNU_template_parameter_pack ed at catmur dot uk
  2023-01-14  1:57 ` tromey at sourceware dot org
@ 2023-01-14 12:58 ` ssbssa at sourceware dot org
  2023-01-14 13:34 ` ed at catmur dot uk
                   ` (11 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: ssbssa at sourceware dot org @ 2023-01-14 12:58 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=17272

Hannes Domani <ssbssa at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=70536
                 CC|                            |ssbssa at sourceware dot org

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug symtab/17272] DW_TAG_GNU_template_parameter_pack
  2014-08-14 20:44 [Bug symtab/17272] New: DW_TAG_GNU_template_parameter_pack dje at google dot com
                   ` (2 preceding siblings ...)
  2023-01-14 12:58 ` ssbssa at sourceware dot org
@ 2023-01-14 13:34 ` ed at catmur dot uk
  2023-01-14 13:37 ` ed at catmur dot uk
                   ` (10 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: ed at catmur dot uk @ 2023-01-14 13:34 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=17272

--- Comment #7 from Ed Catmur <ed at catmur dot uk> ---
(In reply to Tom Tromey from comment #6)
> gdb does not use github but rather email.
> https://sourceware.org/gdb/wiki/ContributionChecklist

Yes, that's OK.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug symtab/17272] DW_TAG_GNU_template_parameter_pack
  2014-08-14 20:44 [Bug symtab/17272] New: DW_TAG_GNU_template_parameter_pack dje at google dot com
                   ` (3 preceding siblings ...)
  2023-01-14 13:34 ` ed at catmur dot uk
@ 2023-01-14 13:37 ` ed at catmur dot uk
  2023-01-15 22:44 ` ed at catmur dot uk
                   ` (9 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: ed at catmur dot uk @ 2023-01-14 13:37 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=17272

Ed Catmur <ed at catmur dot uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #9163|0                           |1
        is obsolete|                            |

--- Comment #8 from Ed Catmur <ed at catmur dot uk> ---
Created attachment 14596
  --> https://sourceware.org/bugzilla/attachment.cgi?id=14596&action=edit
master...ecatmur_binutils-gdb_bug-17272.diff.txt

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug symtab/17272] DW_TAG_GNU_template_parameter_pack
  2014-08-14 20:44 [Bug symtab/17272] New: DW_TAG_GNU_template_parameter_pack dje at google dot com
                   ` (4 preceding siblings ...)
  2023-01-14 13:37 ` ed at catmur dot uk
@ 2023-01-15 22:44 ` ed at catmur dot uk
  2023-01-16 23:37 ` tromey at sourceware dot org
                   ` (8 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: ed at catmur dot uk @ 2023-01-15 22:44 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=17272

--- Comment #9 from Ed Catmur <ed at catmur dot uk> ---
Sent: https://sourceware.org/pipermail/gdb-patches/2023-January/195791.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug symtab/17272] DW_TAG_GNU_template_parameter_pack
  2014-08-14 20:44 [Bug symtab/17272] New: DW_TAG_GNU_template_parameter_pack dje at google dot com
                   ` (5 preceding siblings ...)
  2023-01-15 22:44 ` ed at catmur dot uk
@ 2023-01-16 23:37 ` tromey at sourceware dot org
  2023-02-04 16:29 ` ed at catmur dot uk
                   ` (7 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: tromey at sourceware dot org @ 2023-01-16 23:37 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=17272

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jengelh at inai dot de

--- Comment #10 from Tom Tromey <tromey at sourceware dot org> ---
*** Bug 28946 has been marked as a duplicate of this bug. ***

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug symtab/17272] DW_TAG_GNU_template_parameter_pack
  2014-08-14 20:44 [Bug symtab/17272] New: DW_TAG_GNU_template_parameter_pack dje at google dot com
                   ` (6 preceding siblings ...)
  2023-01-16 23:37 ` tromey at sourceware dot org
@ 2023-02-04 16:29 ` ed at catmur dot uk
  2023-03-22 23:54 ` dblaikie at gmail dot com
                   ` (6 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: ed at catmur dot uk @ 2023-02-04 16:29 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=17272

--- Comment #11 from Ed Catmur <ed at catmur dot uk> ---
Resent just now (no changes, just a better description):
https://sourceware.org/pipermail/gdb-patches/2023-February/196618.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug symtab/17272] DW_TAG_GNU_template_parameter_pack
  2014-08-14 20:44 [Bug symtab/17272] New: DW_TAG_GNU_template_parameter_pack dje at google dot com
                   ` (7 preceding siblings ...)
  2023-02-04 16:29 ` ed at catmur dot uk
@ 2023-03-22 23:54 ` dblaikie at gmail dot com
  2023-07-17 21:02 ` tromey at sourceware dot org
                   ` (5 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: dblaikie at gmail dot com @ 2023-03-22 23:54 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=17272

David Blaikie <dblaikie at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dblaikie at gmail dot com

--- Comment #12 from David Blaikie <dblaikie at gmail dot com> ---
(In reply to Ed Catmur from comment #11)
> Resent just now (no changes, just a better description):
> https://sourceware.org/pipermail/gdb-patches/2023-February/196618.html

Tried testing this with Clang's debug info (based on your request
https://sourceware.org/bugzilla/show_bug.cgi?id=28946#c6 ) & at least for the
test case I had in mind/where I think the issue is visible, this patch didn't
seem to help.

Here's what I tried:
```
template<typename T, typename ...Ts>
struct single_and_pack {
};
int main() {
  single_and_pack<int, int> sap;
}
```
```
clang++ pack.cpp -g
```
```
gdb ./a.out
$ start
$ ptype sap
type = struct single_and_pack<int, int> [with T = int] {
    <no data fields>
}
```
There's the `T = int` part, but nothing for `Ts = {int}` or similar.
(I did get some errors about `No module named 'gdb'` in case that's relevant -
maybe something to do with how I'd build gdb)
& it's possible I've messed up some application of the patch to building gdb -
(I've had issues with lldb, for instance, where lldb is built - but it uses my
system installed lldb .so, so I was still getting the old behavior, not sure if
something similar might be happening with gdb)

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug symtab/17272] DW_TAG_GNU_template_parameter_pack
  2014-08-14 20:44 [Bug symtab/17272] New: DW_TAG_GNU_template_parameter_pack dje at google dot com
                   ` (8 preceding siblings ...)
  2023-03-22 23:54 ` dblaikie at gmail dot com
@ 2023-07-17 21:02 ` tromey at sourceware dot org
  2023-07-17 21:04 ` tromey at sourceware dot org
                   ` (4 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: tromey at sourceware dot org @ 2023-07-17 21:02 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=17272

--- Comment #13 from Tom Tromey <tromey at sourceware dot org> ---
I eventually sent a review:
https://inbox.sourceware.org/gdb-patches/871qixwwxy.fsf@tromey.com/

No response, I may just end up redoing it.
After reading a bit more I don't think the names are needed.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug symtab/17272] DW_TAG_GNU_template_parameter_pack
  2014-08-14 20:44 [Bug symtab/17272] New: DW_TAG_GNU_template_parameter_pack dje at google dot com
                   ` (9 preceding siblings ...)
  2023-07-17 21:02 ` tromey at sourceware dot org
@ 2023-07-17 21:04 ` tromey at sourceware dot org
  2023-07-17 21:13 ` tromey at sourceware dot org
                   ` (3 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: tromey at sourceware dot org @ 2023-07-17 21:04 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=17272

--- Comment #14 from Tom Tromey <tromey at sourceware dot org> ---
(In reply to David Blaikie from comment #12)

> There's the `T = int` part, but nothing for `Ts = {int}` or similar.

The patch adds the types from the pack as if they are template
arguments, but it doesn't add any notion of a template parameter pack.
That would be possible, but harder -- and I wonder if it's really useful.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug symtab/17272] DW_TAG_GNU_template_parameter_pack
  2014-08-14 20:44 [Bug symtab/17272] New: DW_TAG_GNU_template_parameter_pack dje at google dot com
                   ` (10 preceding siblings ...)
  2023-07-17 21:04 ` tromey at sourceware dot org
@ 2023-07-17 21:13 ` tromey at sourceware dot org
  2023-07-18 23:20 ` dblaikie at gmail dot com
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: tromey at sourceware dot org @ 2023-07-17 21:13 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=17272

--- Comment #15 from Tom Tromey <tromey at sourceware dot org> ---
... though it also seems a bit weird to "inline" the constituent
members of the parameter pack, because it's possible to create
types with multiple parameter packs.  So maybe introducing some
new "TYPE_CODE_PARAMETER_PACK" really is the way to go.

Not sure how hard this would be.  gdb doesn't have anything like it
right now.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug symtab/17272] DW_TAG_GNU_template_parameter_pack
  2014-08-14 20:44 [Bug symtab/17272] New: DW_TAG_GNU_template_parameter_pack dje at google dot com
                   ` (11 preceding siblings ...)
  2023-07-17 21:13 ` tromey at sourceware dot org
@ 2023-07-18 23:20 ` dblaikie at gmail dot com
  2023-12-10 17:01 ` ssbssa at sourceware dot org
  2023-12-11  7:28 ` dblaikie at gmail dot com
  14 siblings, 0 replies; 16+ messages in thread
From: dblaikie at gmail dot com @ 2023-07-18 23:20 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=17272

--- Comment #16 from David Blaikie <dblaikie at gmail dot com> ---
For types you can't have more than one pack, I think:
$ clang++-tot -std=c++2a pack_type.cpp 
pack_type.cpp:1:22: error: template parameter pack must be the last template
parameter
    1 | template<typename... T1s, typename... T2s>
      |                      ^
1 error generated.

But you can have multiple packs in a function template - and I think it'd be
good to represent it correctly - since there can be two functions, for
instance, with the same parameters but packed differently (eg:
`template<typename... T1s, typename ... T2s> void f1();` you could have
`f1<int>` where the int is in the first pack (and the second pack is empty) or
the other way around, and those are distinct overloads)

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug symtab/17272] DW_TAG_GNU_template_parameter_pack
  2014-08-14 20:44 [Bug symtab/17272] New: DW_TAG_GNU_template_parameter_pack dje at google dot com
                   ` (12 preceding siblings ...)
  2023-07-18 23:20 ` dblaikie at gmail dot com
@ 2023-12-10 17:01 ` ssbssa at sourceware dot org
  2023-12-11  7:28 ` dblaikie at gmail dot com
  14 siblings, 0 replies; 16+ messages in thread
From: ssbssa at sourceware dot org @ 2023-12-10 17:01 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=17272

--- Comment #17 from Hannes Domani <ssbssa at sourceware dot org> ---
(In reply to David Blaikie from comment #16)
> For types you can't have more than one pack, I think:
> $ clang++-tot -std=c++2a pack_type.cpp 
> pack_type.cpp:1:22: error: template parameter pack must be the last template
> parameter
>     1 | template<typename... T1s, typename... T2s>
>       |                      ^
> 1 error generated.
> 
> But you can have multiple packs in a function template - and I think it'd be
> good to represent it correctly - since there can be two functions, for
> instance, with the same parameters but packed differently (eg:
> `template<typename... T1s, typename ... T2s> void f1();` you could have
> `f1<int>` where the int is in the first pack (and the second pack is empty)
> or the other way around, and those are distinct overloads)

Could you share an example where the 2nd pack is not empty, because I could not
figure out how to do it?

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [Bug symtab/17272] DW_TAG_GNU_template_parameter_pack
  2014-08-14 20:44 [Bug symtab/17272] New: DW_TAG_GNU_template_parameter_pack dje at google dot com
                   ` (13 preceding siblings ...)
  2023-12-10 17:01 ` ssbssa at sourceware dot org
@ 2023-12-11  7:28 ` dblaikie at gmail dot com
  14 siblings, 0 replies; 16+ messages in thread
From: dblaikie at gmail dot com @ 2023-12-11  7:28 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=17272

--- Comment #18 from David Blaikie <dblaikie at gmail dot com> ---
(In reply to Hannes Domani from comment #17)
> (In reply to David Blaikie from comment #16)
> > For types you can't have more than one pack, I think:
> > $ clang++-tot -std=c++2a pack_type.cpp 
> > pack_type.cpp:1:22: error: template parameter pack must be the last template
> > parameter
> >     1 | template<typename... T1s, typename... T2s>
> >       |                      ^
> > 1 error generated.
> > 
> > But you can have multiple packs in a function template - and I think it'd be
> > good to represent it correctly - since there can be two functions, for
> > instance, with the same parameters but packed differently (eg:
> > `template<typename... T1s, typename ... T2s> void f1();` you could have
> > `f1<int>` where the int is in the first pack (and the second pack is empty)
> > or the other way around, and those are distinct overloads)
> 
> Could you share an example where the 2nd pack is not empty, because I could
> not figure out how to do it?

I don't think you can explicitly specify such arguments, they can only be
provided via template argument deduction, like this example:

https://godbolt.org/z/377YT7dfb

Notice that the two `f1` calls call distinct functions:
  _Z2f1IJEJiEEv2t1IJDpT_EES0_IJDpT0_EE
  _Z2f1IJiEJEEv2t1IJDpT_EES0_IJDpT0_EE
or, demangled:
  void f1<, int>(t1<>, t1<int>)
  void f1<int>(t1<int>, t1<>)

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2023-12-11  7:28 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-14 20:44 [Bug symtab/17272] New: DW_TAG_GNU_template_parameter_pack dje at google dot com
2023-01-14  0:24 ` [Bug symtab/17272] DW_TAG_GNU_template_parameter_pack ed at catmur dot uk
2023-01-14  1:57 ` tromey at sourceware dot org
2023-01-14 12:58 ` ssbssa at sourceware dot org
2023-01-14 13:34 ` ed at catmur dot uk
2023-01-14 13:37 ` ed at catmur dot uk
2023-01-15 22:44 ` ed at catmur dot uk
2023-01-16 23:37 ` tromey at sourceware dot org
2023-02-04 16:29 ` ed at catmur dot uk
2023-03-22 23:54 ` dblaikie at gmail dot com
2023-07-17 21:02 ` tromey at sourceware dot org
2023-07-17 21:04 ` tromey at sourceware dot org
2023-07-17 21:13 ` tromey at sourceware dot org
2023-07-18 23:20 ` dblaikie at gmail dot com
2023-12-10 17:01 ` ssbssa at sourceware dot org
2023-12-11  7:28 ` dblaikie at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).