From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-xd34.google.com (mail-io1-xd34.google.com [IPv6:2607:f8b0:4864:20::d34]) by sourceware.org (Postfix) with ESMTPS id 01E783858D1E for ; Thu, 28 Mar 2024 19:34:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 01E783858D1E Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 01E783858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::d34 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711654468; cv=none; b=MpmhdB5nVostVwmHkMe/E4gKdNOsbLQaUOm0ws/beQ1wUyvw9E3WEiqpJGVoWV47zuFY+nckqqr4Fd59NuIp5YV3zM2Y6D43RPfYO49n09O/ctKDo34TVK/2oDI3/UKQvFzKdijJU63UZG5I7y7G0+TA+uozKHj0zSmSh7DfQ8A= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711654468; c=relaxed/simple; bh=cPi66TeqGqJ6NM3ck+nyuAGkfXnhRPftbul9KCD2G/M=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=J9E+3WgHKWrk9O4YfcfcPWSv2qazz+SESvj7gDxFwkFU9a57CnpDYkgZF+eBWgnL+OGWreqb8i2AocKrFd7PDnL0luoRcTOLMZDepuZh7jLDf9boZfx+YDctpGYD33w8EPgzQx2JHt3+JM7VYoe5APEDjrXWFBT39EGy2FQwrM0= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-io1-xd34.google.com with SMTP id ca18e2360f4ac-7cc0e0dba0fso44154139f.3 for ; Thu, 28 Mar 2024 12:34:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1711654466; x=1712259266; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=oezhiCb4rWYdteZNZEwitcQ0G/zni5gLJq5C4dfVKWA=; b=HzP6xs9vk9ZrE8ZwkRi4OuDY/KTIYAcnOTRD8hnJEBSN+kcRQ2YKf88xx/YDOZTIk1 hRyD0uriKuzZ0pooJy/mUqzCMdrszGksUZa9+6unuP2S+H3r65pWQ7Bl4BssBUpLdYxc IawsvCnhUTX5tNOYkYLEoLx1F5JVTaVOHm7Alh9ici/tVdFOPxpn0IKcC4WJDWCzJuh0 ddGd13BBTIiYBjSP7BPir7BzYOAZO7EpBJ6+vCSOyWiL2yH9sjkE4T1K7cUKFXd8fiHV a4w1tdZT3yFGW5IeEyvvfouW0bp5YKyW4gHsRGSpVHnzVHH8GdTF8EIVoeBbFtMU1c90 CA5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711654466; x=1712259266; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=oezhiCb4rWYdteZNZEwitcQ0G/zni5gLJq5C4dfVKWA=; b=qHHlxf6c+3ZLUCn5n3p6/isRfz1ABuua9x6SNXJv22+KfCpq2tIhE7jv8aOpqKgeKt OH7PZh7qAeoY9jzxQVlDx8Zj7c377mYadzluB10bfJfS6WZ0o32az6b8agsqwRBsqicx ch2jk+zRHMQcPOfr/dDeK/HX72sd2KxCkNNP7ZBUTLLSpbQAMFBJHXVmvbXs5OUP2a1p BAl9KBb+K3yAZUtnIq70SyOAismGDqOiUldAC1pAu5GQ36CwahCPyvKceVkUaNHCuyPm 6iPfSuFr1xTlgR+DoRlQEC9OO+aYjYpcaXXQVWbX+JnacwNO/9KjWjhuA3zPPKRuae0S 1wLA== X-Gm-Message-State: AOJu0YwC4iqkkd9PD6+tov/k0ylEwMayjhDf/mXLNQmxzZ3SDGjrXE3R 9uWqGK2W7HETJDmyXxSiYWY6/AYhl2A80CswmKpBvr2DzJR/X1HG9QJ5fDK9xEHV80Yyjt7EPhQ = X-Google-Smtp-Source: AGHT+IEJEskerZhd2UGJTqdPn7ptred2sA9+Ln2kwC2oTu2DoaIwrBFb9f3EFI3/BXY382+HZ7LwaQ== X-Received: by 2002:a5e:8801:0:b0:7d0:8b9e:e27d with SMTP id l1-20020a5e8801000000b007d08b9ee27dmr150764ioj.15.1711654466180; Thu, 28 Mar 2024 12:34:26 -0700 (PDT) Received: from localhost.localdomain (97-122-82-115.hlrn.qwest.net. [97.122.82.115]) by smtp.gmail.com with ESMTPSA id h24-20020a0566380f9800b00477511d2d1asm534022jal.176.2024.03.28.12.34.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 12:34:25 -0700 (PDT) From: Tom Tromey To: gcc-patches@gcc.gnu.org Cc: Tom Tromey Subject: [PATCH] Prettify output of debug_dwarf_die Date: Thu, 28 Mar 2024 13:34:13 -0600 Message-ID: <20240328193413.1566475-1-tromey@adacore.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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: 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. 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 == 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