From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [IPv6:2a00:1450:4864:20::230]) by sourceware.org (Postfix) with ESMTPS id 102223858D28 for ; Tue, 2 Apr 2024 06:57:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 102223858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 102223858D28 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::230 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712041025; cv=none; b=hQ0K3l7oZCTPdIGye0DHGJFYRSmGraotOpJLUBBPOA/JKd0VEG7zxyr/z8pAY+bBhz6AdQGNJAaAywpJz+d7SxvgbemYLbu8XyXIAONXcWrUO3PjP6S8zkp6NaOLIjAWb6JeZw9a7PNPuDL87g1kJenYy7gTjgUfUWa1NEavobw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712041025; c=relaxed/simple; bh=M0P0q5WpmbtJAVfdKDTPI2rkKdbp1PUj1vpSXTkUydY=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=fEtijnVAmN2hWGo5JYUjZcAdhJovDMjMQlSoOYN/n1PdIJle7j/IIQecSKt2M2J+qplCNAxi5Iprfu7q3eqaI/D4Ci2dvTMj9f08Nu+aFTMlWNIOg9TosJZRy9KGGbPv+JDvy53/672czrh1Exoo/4yU2P2yoMsiV8CH52nATvQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lj1-x230.google.com with SMTP id 38308e7fff4ca-2d23114b19dso65681981fa.3 for ; Mon, 01 Apr 2024 23:57:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712041020; x=1712645820; darn=gcc.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=TeOx1mK4n6MTlrv9V6067CopVP81r7M6ClqIOgyrP3c=; b=ODobUc0uscQtE4b4bv/yW5UUFELNnlEOpV2BqTlTARcYBbFqWbAzmjQbpn3Ku6nZfg rcQY6HBdjd1LlGcXSUtA3tYEZ7OtRXzCtLhZHZcRRQl41LnGaNLRmFRqPL4dyCFMrsGl eAlrnKahVEhWq93/xG421fXwXmh70KaDsc6+ijwEt62EeznAEPkzEXuoYBsFZiRVgaZX A9AVdwcqyZ2tzDWLxy748OOhAImfCpGxISItz3aoaGvWe/af5ly6eV1+pp5tI4BWOAyO sD4PFwuhjp62zutXo1w0YCMxjh+imNuK9POsXXTh3CJ5UVsCBv0FN8wvJUnz9UK/RPIW OpPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712041020; x=1712645820; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TeOx1mK4n6MTlrv9V6067CopVP81r7M6ClqIOgyrP3c=; b=D0AXJBCR9IBrYijqqdQptTGIf+7QtM4wX9oMxcH05gKKRdBe0N0g3l7MT4cr9+s7+U wOezGjeVMVOXiVJG9Vb/lftROscnscBkUA0NLR+S+x58PVrm2T1ly0pzghYrKgSyHR1x 7xm5GwBL9XE1/IkSTa/7oniX6JmQhPSG2BecWgwjsLWQu+nd67PnoiT/QyPG03ahK9Ls x2LlU0PytXDAnQFIt/HN/ynImPLQeNG3sKwN/Qcefo5FwwpSFXkV27oPk6o6JDbLrsT6 fOWJls3F/KWsD32rWG9NOtoChwdkS3d7MHaJCB+bdcBZu/S5BePqMFh4y44RtO4/GSD9 v2ww== X-Gm-Message-State: AOJu0Yz7Wu2PwpMfnCq4lfrbOtXG14MLPwOCgUOUwOxQYPgIu9hpwb9M o7TIU1BbeT9f8w1OoO9oWjK82YeNW6VokbN/j/+Yh8civ0XkFkil8JxrZ4i2q6/+mVL7QirfU5A ny/g3hX+xM48V0tPg/fSc/55Eiug= X-Google-Smtp-Source: AGHT+IGbStAHrnP/SX3OMCwKEa3hPsGvhg/aF7ZJg1Sbhf3dxMz0IAb+xVlQPSy9+u/EqJZK2X5yrYEcnW8InzxUWZc= X-Received: by 2002:a2e:8895:0:b0:2d6:c672:b301 with SMTP id k21-20020a2e8895000000b002d6c672b301mr6184797lji.50.1712041020230; Mon, 01 Apr 2024 23:57:00 -0700 (PDT) MIME-Version: 1.0 References: <20240328193413.1566475-1-tromey@adacore.com> In-Reply-To: <20240328193413.1566475-1-tromey@adacore.com> From: Richard Biener Date: Tue, 2 Apr 2024 08:56:48 +0200 Message-ID: Subject: Re: [PATCH] Prettify output of debug_dwarf_die To: Tom Tromey Cc: gcc-patches@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Thu, Mar 28, 2024 at 8:35=E2=80=AFPM Tom Tromey wro= te: > > When debugging gcc, I tried calling debug_dwarf_die and I saw this > output: > > DW_AT_location: location descriptor: > (0x7fffe9c2e870) DW_OP_dup 0, 0 > (0x7fffe9c2e8c0) DW_OP_bra location descriptor (0x7fffe9c2e640) > , 0 > (0x7fffe9c2e820) DW_OP_lit4 4, 0 > (0x7fffe9c2e910) DW_OP_skip location descriptor (0x7fffe9c2e9b0) > , 0 > (0x7fffe9c2e640) DW_OP_dup 0, 0 > > I think those ", 0" should not appear on their own lines. The issue > seems to be that print_dw_val should not generally emit a newline, > except when recursing. OK. > gcc/ChangeLog > > * dwarf2out.cc (print_dw_val) : Don't > print newline when not recursing. > --- > gcc/dwarf2out.cc | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/gcc/dwarf2out.cc b/gcc/dwarf2out.cc > index 8f18bc4fe64..1b0e8b5a5b2 100644 > --- a/gcc/dwarf2out.cc > +++ b/gcc/dwarf2out.cc > @@ -6651,7 +6651,7 @@ print_dw_val (dw_val_node *val, bool recurse, FILE = *outfile) > case dw_val_class_loc: > fprintf (outfile, "location descriptor"); > if (val->v.val_loc =3D=3D NULL) > - fprintf (outfile, " -> \n"); > + fprintf (outfile, " -> "); > else if (recurse) > { > fprintf (outfile, ":\n"); > @@ -6662,9 +6662,9 @@ print_dw_val (dw_val_node *val, bool recurse, FILE = *outfile) > else > { > if (flag_dump_noaddr || flag_dump_unnumbered) > - fprintf (outfile, " #\n"); > + fprintf (outfile, " #"); > else > - fprintf (outfile, " (%p)\n", (void *) val->v.val_loc); > + fprintf (outfile, " (%p)", (void *) val->v.val_loc); > } > break; > case dw_val_class_loc_list: > -- > 2.43.0 >