From patchwork Fri Jul 9 12:38:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Marie de Rodat X-Patchwork-Id: 1503108 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=adacore-com.20150623.gappssmtp.com header.i=@adacore-com.20150623.gappssmtp.com header.a=rsa-sha256 header.s=20150623 header.b=IVFEQvO5; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GLtHl3Sd2z9sRN for ; Fri, 9 Jul 2021 22:48:19 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D1B553988031 for ; Fri, 9 Jul 2021 12:48:16 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by sourceware.org (Postfix) with ESMTPS id D84EE398703E for ; Fri, 9 Jul 2021 12:38:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D84EE398703E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-lf1-x12d.google.com with SMTP id v14so23030407lfb.4 for ; Fri, 09 Jul 2021 05:38:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=G61SSbQVM5IVDk0LRhxrjagg+mPSE3ywlqieBQpCtKc=; b=IVFEQvO5a7NQvqfvfwjvxsYNkxedVqK+qyqywP0O7usw8oqjxaq5TuVcJzAsdCTwRd UU9RZ+jrzjYHNJNl+60Hmg6wkzm3iPUHf1yxRh/vr4qGeP0/nmbaQ+81jfjS/P8cNjET zDyyVVvIRueL5c9LNPB/sPuR9NluAN6syoY7IxRTIUh/TbyHyOp1rm/FWWYg9crdgtnq BQhdE40YCjFU1v81cLtGB3I4qw2MDwtw7fLzW1I3/GLE3ckH7tVEQcSt3VmYL2TrkpXV KXK75FxMu5V8jwGXlwjvgVWpS3xRs1vCsqAXp56aU46ogAh/O9VSYwzoQY1E8Pl6BNZU G86Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=G61SSbQVM5IVDk0LRhxrjagg+mPSE3ywlqieBQpCtKc=; b=LTW/95o9V20256IXR0GJc6AhGAHRwEyX6n/qxtaZvSTP4FgCVh5cKYFV1uW4FiQ2gF Ma8zQjWRDOu3NWRKLtpHV7Gu/vSDBBI1xvpLfmEm09cFLnlpGQuJRsoWYSuHO+wa+phi xrHZq55se8xXJt/LXchUb0xf7wUy9bhfQ4JGFybu+FnaKmaaGU2TK1+qkjiGk7ilyjl1 n8gEr4r3u6nbSsgTWzGplgtOn00rN/95TQqkra+6KCC4S/9FeiRPjBU588mIOrbAXEaQ DLFYdbMoD7GF6HJ8jLVKIv8TkhMaoLrDU2pjXQy7NRqpEtQkrjmrpB0BKfXcmTycUGT5 f4XA== X-Gm-Message-State: AOAM531913fNVqb1H87NweBMq8ez7fQ5flufG9YOqtU9NS+7UULlDTQ/ ncUrHeT6LzTdv3X1jKEnfGQ0eeMuHNrYFQ== X-Google-Smtp-Source: ABdhPJySjKXs89bXsWyS39DeXHRt9fvm7ce082s1etm7sMjsTVUsysRlVkJLYsM8FPaI63PVNIz3ng== X-Received: by 2002:a05:6512:400e:: with SMTP id br14mr25057158lfb.332.1625834306728; Fri, 09 Jul 2021 05:38:26 -0700 (PDT) Received: from adacore.com ([2a02:2ab8:224:2ce:72b5:e8ff:feef:ee60]) by smtp.gmail.com with ESMTPSA id e7sm545325ljn.139.2021.07.09.05.38.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Jul 2021 05:38:25 -0700 (PDT) Date: Fri, 9 Jul 2021 12:38:24 +0000 From: Pierre-Marie de Rodat To: gcc-patches@gcc.gnu.org Subject: [Ada] Add source file name to gnat bug box Message-ID: <20210709123824.GA3875841@adacore.com> MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-13.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bob Duff Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" ...in case Current_Error_Node is Empty, which will cause it to print "No source file position information available". At least now we have the file name being compiled. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * comperr.adb (Compiler_Abort): Print source file name. diff --git a/gcc/ada/comperr.adb b/gcc/ada/comperr.adb --- a/gcc/ada/comperr.adb +++ b/gcc/ada/comperr.adb @@ -244,12 +244,17 @@ package body Comperr is end if; End_Line; + else Write_Str ("| Error detected at "); Write_Location (Sloc (Current_Error_Node)); End_Line; end if; + Write_Str ("| Compiling "); + Write_Str (Get_First_Main_File_Name); + End_Line; + -- There are two cases now. If the file gnat_bug.box exists, -- we use the contents of this file at this point.