From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A51403858299; Wed, 29 Nov 2023 19:18:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A51403858299 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1701285521; bh=zE1MypIqkOlxcpOjjIAdXQKBqPUtlxhw9XBPU8MBsRQ=; h=From:To:Subject:Date:From; b=qwciQbhDL8Z33OWa8OpuGBBR5y+vqq/IFJM7RRH01XPBtzgHzsVUGOvKFSEnTAQQR jmWhB6sFBKjSNo8vnB1H3QXJtQQ77korOrXEzcz7I773EwC0qYRwY4iQqU+wnRPlQJ A2G77pxeLxFcGljnsJ8DFwzb+AIhrmKk48h5fk88= From: "ibhagat at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug debug/112768] New: btf: fix asm comment output for BTF_KIND_FUNC* kinds Date: Wed, 29 Nov 2023 19:18:41 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: debug X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: minor X-Bugzilla-Who: ibhagat at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D112768 Bug ID: 112768 Summary: btf: fix asm comment output for BTF_KIND_FUNC* kinds Product: gcc Version: unknown Status: UNCONFIRMED Severity: minor Priority: P3 Component: debug Assignee: unassigned at gcc dot gnu.org Reporter: ibhagat at gcc dot gnu.org Target Milestone: --- The BTF type of kind BTF_KIND_FUNC_PROTO is always anonymous. The machinery, via btf_collect_datasec (), resets the ctti_name to 0 to reflect that. The name string in the (ctf) type contained in the CTF container is, however, not updated. The latter is used to emit the type name in the asm comment output. E.g., for gcc/testsuite/gcc.dg/debug/btf/btf-function-6.c: extern int extfunc(int a, int b); int foo (int x) { int y =3D extfunc (x, x+1); return y; } a user may see the following in the comments in the -dA output: .long 0 # TYPE 2 BTF_KIND_FUNC_PROTO 'extfunc' .long 0xd000002 # btt_info: kind=3D13, kflag=3D0, vlen=3D2 .long 0x1 # btt_type: (BTF_KIND_INT 'int') .long 0 # farg_name .long 0x1 # farg_type: (BTF_KIND_INT 'int') .long 0 # farg_name .long 0x1 # farg_type: (BTF_KIND_INT 'int') .long 0 # TYPE 3 BTF_KIND_FUNC_PROTO 'foo' .long 0xd000001 # btt_info: kind=3D13, kflag=3D0, vlen=3D1 .long 0x1 # btt_type: (BTF_KIND_INT 'int') .long 0x68 # farg_name .long 0x1 # farg_type: (BTF_KIND_INT 'int') .long 0x5 # TYPE 4 BTF_KIND_FUNC '(null)' .long 0xc000002 # btt_info: kind=3D12, kflag=3D0, linkage=3D2 .long 0x2 # btt_type: (BTF_KIND_FUNC_PROTO 'extfunc') .long 0xd # TYPE 5 BTF_KIND_FUNC '(null)' .long 0xc000001 # btt_info: kind=3D12, kflag=3D0, linkage=3D1 .long 0x3 # btt_type: (BTF_KIND_FUNC_PROTO 'foo') The above may cause confusion to the reader: - Types of kind BTF_KIND_FUNC_PROTO are displayed with a name. - BTF_KIND_FUNC appears with 'null' It will be ideal to display: - BTF_KIND_FUNC_PROTO as anonymous - BTF_KIND_FUNC with the name of the function=