From patchwork Wed Dec 20 01:23:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 82539 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A6C7B385E006 for ; Wed, 20 Dec 2023 01:24:27 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id 25D84385803B for ; Wed, 20 Dec 2023 01:24:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 25D84385803B Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 25D84385803B Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=140.211.166.183 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703035444; cv=none; b=LmEYJKs+JnSS1poDRMhwpcAit6JBdffNVqXyAdW1+XxOdqc9Dmzl5zj5kvkbYilm81PnxOT4dp66vuPuqAVcvmCCputt2+TOhFbIA+MlnCibWqdO22vD/n6xm4IlKvZDFA2lpzL4coH/7wJrT2uyLSXnaYmnWpB5FDOA6hwl4Co= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703035444; c=relaxed/simple; bh=Ou1XbtoCWZFLQZ5a8ciy4NAB/29VvvYhAGwWI/rg40k=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=odxchQIZBQR9ONCOsRQixla/hdQ5/ZG3QR2qVVBHIewRJDhllnlkrLuXM4Mm1YqnN+FIfRdbrTy70qPwLiCBlId5QBH2i/j50dF3nW9LkbH1KT8ircmwz9bFdRrNk77MEcRN2BYkSHInbMmrY08rgwhT9qhCYprwCqj+9KtD0zs= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by smtp.gentoo.org (Postfix, from userid 559) id B33333406C2; Wed, 20 Dec 2023 01:24:01 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH 3/3] sim: mloop: add #line pragmas everywhere Date: Tue, 19 Dec 2023 20:23:54 -0500 Message-ID: <20231220012354.15032-3-vapier@gentoo.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231220012354.15032-1-vapier@gentoo.org> References: <20231220012354.15032-1-vapier@gentoo.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org This will make compiler diagnostics much better with generated code so people can understand the original source file. --- sim/common/genmloop.sh | 32 ++++++++++++++++++++++++++++++++ sim/cris/mloop.in | 5 +++++ sim/frv/mloop.in | 4 ++++ sim/iq2000/mloop.in | 4 ++++ sim/lm32/mloop.in | 4 ++++ sim/m32r/mloop.in | 4 ++++ sim/m32r/mloop2.in | 3 +++ sim/m32r/mloopx.in | 3 +++ sim/or1k/mloop.in | 4 ++++ 9 files changed, 63 insertions(+) diff --git a/sim/common/genmloop.sh b/sim/common/genmloop.sh index 73ff2fdc100e..8c42f8f21bf6 100755 --- a/sim/common/genmloop.sh +++ b/sim/common/genmloop.sh @@ -314,6 +314,7 @@ exec 1>${outprefix}tmp-mloop-$$.cin # here. cat << EOF +#line $LINENO "$0" /* This file is generated by the genmloop script. DO NOT EDIT! */ /* This must come before any other includes. */ @@ -410,6 +411,7 @@ load_infile_section support if [ x$scache != xyes -a x$pbb != xyes ] ; then cat << EOF +#line $LINENO "$0" #define FAST_P 0 @@ -429,6 +431,7 @@ EOF case x$parallel in xread | xwrite) cat << EOF +#line $LINENO "$0" PAREXEC pbufs[MAX_PARALLEL_INSNS]; PAREXEC *par_exec; @@ -442,6 +445,7 @@ load_infile_section init if [ x$parallel = xread ] ; then cat << EOF +#line $LINENO "$0" #if defined (__GNUC__) { @@ -459,6 +463,7 @@ EOF fi cat << EOF +#line $LINENO "$0" if (! CPU_IDESC_SEM_INIT_P (current_cpu)) { @@ -482,6 +487,7 @@ EOF load_infile_section full-exec-simple cat << EOF +#line $LINENO "$0" /* end full-exec-simple */ ++ CPU_INSN_COUNT (current_cpu); @@ -501,6 +507,7 @@ EOF if [ x$fast = xyes ] ; then cat << EOF +#line $LINENO "$0" #define FAST_P 1 @@ -522,6 +529,7 @@ fi # simple engine if [ x$scache = xyes -a x$parallel = xno ] ; then cat << EOF +#line $LINENO "$0" static INLINE SCACHE * @prefix@_scache_lookup (SIM_CPU *current_cpu, PCADDR vpc, SCACHE *scache, @@ -543,6 +551,7 @@ EOF load_infile_section extract-scache cat << EOF +#line $LINENO "$0" /* end extract-scache */ } else if (! FAST_P) @@ -573,6 +582,7 @@ EOF load_infile_section init cat << EOF +#line $LINENO "$0" if (! CPU_IDESC_SEM_INIT_P (current_cpu)) { @@ -596,6 +606,7 @@ EOF load_infile_section full-exec-scache cat << EOF +#line $LINENO "$0" /* end full-exec-scache */ SET_H_PC (vpc); @@ -616,6 +627,7 @@ EOF if [ x$fast = xyes ] ; then cat << EOF +#line $LINENO "$0" #define FAST_P 1 @@ -634,6 +646,7 @@ EOF load_infile_section init cat << EOF +#line $LINENO "$0" if (! CPU_IDESC_SEM_INIT_P (current_cpu)) { @@ -663,6 +676,7 @@ EOF load_infile_section fast-exec-scache cat << EOF +#line $LINENO "$0" /* end fast-exec-scache */ SET_H_PC (vpc); @@ -689,6 +703,7 @@ fi # -scache && ! parallel if [ x$scache = xyes -a x$parallel != xno ] ; then cat << EOF +#line $LINENO "$0" static INLINE SCACHE * @prefix@_scache_lookup (SIM_CPU *current_cpu, PCADDR vpc, SCACHE *scache, @@ -711,6 +726,7 @@ EOF load_infile_section extract-scache cat << EOF +#line $LINENO "$0" /* end extract-scache */ #undef SET_LAST_INSN_P } @@ -743,6 +759,7 @@ load_infile_section init if [ x$parallel = xread ] ; then cat << EOF +#line $LINENO "$0" #if defined (__GNUC__) { if (! CPU_IDESC_READ_INIT_P (current_cpu)) @@ -759,6 +776,7 @@ EOF fi cat << EOF +#line $LINENO "$0" if (! CPU_IDESC_SEM_INIT_P (current_cpu)) { @@ -778,6 +796,7 @@ EOF load_infile_section full-exec-scache cat << EOF +#line $LINENO "$0" /* end full-exec-scache */ } while (0 /*CPU_RUNNING_P (current_cpu)*/); @@ -794,6 +813,7 @@ EOF if [ x$fast = xyes ] ; then cat << EOF +#line $LINENO "$0" #define FAST_P 1 @@ -815,6 +835,7 @@ load_infile_section init if [ x$parallel = xread ] ; then cat << EOF +#line $LINENO "$0" #if defined (__GNUC__) { @@ -832,6 +853,7 @@ EOF fi cat << EOF +#line $LINENO "$0" if (! CPU_IDESC_SEM_INIT_P (current_cpu)) { @@ -857,6 +879,7 @@ EOF load_infile_section fast-exec-scache cat << EOF +#line $LINENO "$0" /* end fast-exec-scache */ } while (0 /*CPU_RUNNING_P (current_cpu)*/); @@ -881,6 +904,7 @@ fi # -scache && parallel if [ x$pbb = xyes ] ; then cat << EOF +#line $LINENO "$0" /* Record address of cti terminating a pbb. */ #define SET_CTI_VPC(sc) do { _cti_sc = (sc); } while (0) @@ -964,6 +988,7 @@ EOF load_infile_section extract-pbb cat << EOF +#line $LINENO "$0" /* end extract-pbb */ /* The last one is a pseudo-insn to link to the next chain. @@ -1187,6 +1212,7 @@ EOF case x$parallel in xread | xwrite) cat << EOF +#line $LINENO "$0" PAREXEC pbufs[MAX_PARALLEL_INSNS]; PAREXEC *par_exec = &pbufs[0]; @@ -1199,6 +1225,7 @@ esac load_infile_section init cat << EOF +#line $LINENO "$0" if (! CPU_IDESC_SEM_INIT_P (current_cpu)) { @@ -1242,6 +1269,7 @@ EOF load_infile_section full-exec-pbb cat << EOF +#line $LINENO "$0" /* end full-exec-pbb */ } while (CPU_RUNNING_P (current_cpu)); @@ -1258,6 +1286,7 @@ EOF if [ x$fast = xyes ] ; then cat << EOF +#line $LINENO "$0" #define FAST_P 1 @@ -1279,6 +1308,7 @@ EOF case x$parallel in xread | xwrite) cat << EOF +#line $LINENO "$0" PAREXEC pbufs[MAX_PARALLEL_INSNS]; PAREXEC *par_exec = &pbufs[0]; @@ -1291,6 +1321,7 @@ esac load_infile_section init cat << EOF +#line $LINENO "$0" if (! CPU_IDESC_SEM_INIT_P (current_cpu)) { @@ -1334,6 +1365,7 @@ EOF load_infile_section fast-exec-pbb cat << EOF +#line $LINENO "$0" /* end fast-exec-pbb */ } while (CPU_RUNNING_P (current_cpu)); diff --git a/sim/cris/mloop.in b/sim/cris/mloop.in index 21cbb6923baa..d0f3ee534167 100644 --- a/sim/cris/mloop.in +++ b/sim/cris/mloop.in @@ -42,6 +42,7 @@ case "x$1" in xsupport) cat < /* It seems we don't have a templated header file corresponding to @@ -142,6 +143,7 @@ EOF xinit) cat < static INLINE const IDESC * @@ -139,6 +140,7 @@ xextract-simple | xextract-scache) # Outputs: sc filled in cat < static INLINE const IDESC * @@ -130,6 +131,7 @@ xinit) xextract-simple | xextract-scache) cat < static INLINE const IDESC * @@ -157,6 +158,7 @@ xinit) xextract-simple | xextract-scache) cat < static INLINE const IDESC * @@ -144,6 +145,7 @@ xinit) xextract-simple | xextract-scache) cat <