public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "nilsgladitz at gmail dot com" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug c++/27556] New: "<no data fields>" for some C++ coroutine frame types
Date: Wed, 10 Mar 2021 12:00:12 +0000	[thread overview]
Message-ID: <bug-27556-4717@http.sourceware.org/bugzilla/> (raw)

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

            Bug ID: 27556
           Summary: "<no data fields>" for some C++ coroutine frame types
           Product: gdb
           Version: 10.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
          Assignee: unassigned at sourceware dot org
          Reporter: nilsgladitz at gmail dot com
  Target Milestone: ---

Created attachment 13298
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13298&action=edit
Test case source code

Given the attached source code compiled with GCC 10.2.0 thusly:
  g++ -fcoroutines -std=c++20 -g test.cpp -o test

There are two seemingly identical coroutines.
One having global scope (function1) and one being a static struct member
(function2).

Setting a breakpoint at the co_return line in function1 lets me inspect
"*frame_ptr" (frame_ptr being a pointer to the gcc generated coroutine frame):

type = struct _ZL9function1i.frame {
    void (*__resume)(_ZL9function1i.frame *);
    void (*__destroy)(_ZL9function1i.frame *);
    std::__n4861::__coroutine_traits_impl<task, void>::promise_type __p;
    bool __frame_needs_free;
    unsigned short __resume_at;
    std::__n4861::coroutine_handle<task::promise_type> __self_h;
    int __parm.fooParameter;
    bool __i_a_r_c.1.1;
    std::__n4861::suspend_always __Is.2.2;
    int __fooLocal1.2.3;
    int __fooLocal2.2.3;
    std::__n4861::suspend_always __Fs.2.4;
} *


Doing the same in function2 however seems to indicate that the corresponding
coroutine frame type does not have any members:

type = struct Foo::_ZN3Foo9function2Ei.frame {
    <no data fields>
} *

I tried looking into the debug information via dwarfdump and as far as I can
tell both coroutine frame types are present including member definitions.

I can't tell if there is something gdb is overlooking / mishandling or if gcc
is not correctly generating debug information or generating it in some
unexpected fashion.

FWIW the gcc implementation is still pretty fresh and other aspects of
corresponding debug information are currently expected to be lacking e.g.:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99215

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

             reply	other threads:[~2021-03-10 12:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-10 12:00 nilsgladitz at gmail dot com [this message]
2021-03-10 12:01 ` [Bug c++/27556] " nilsgladitz at gmail dot com
2021-03-12 19:16 ` tromey at sourceware dot org
2021-03-13  9:42 ` nilsgladitz at gmail dot com
2021-03-16 13:11 ` nilsgladitz at gmail dot com
2021-03-31 19:45 ` tromey at sourceware dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-27556-4717@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).