aboutsummaryrefslogtreecommitdiff
path: root/sim/common
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2023-12-19 20:13:22 -0500
committerMike Frysinger <vapier@gentoo.org>2023-12-21 20:16:26 -0500
commit6003fe166df2cd80030ae4a228ac105ae13f477e (patch)
tree9d50df58ef62f89ed1f1ad1b9326f10a8c07c333 /sim/common
parentc0e97c852595b9516d54688643c08918a446f36c (diff)
downloadgdb-6003fe166df2cd80030ae4a228ac105ae13f477e.zip
gdb-6003fe166df2cd80030ae4a228ac105ae13f477e.tar.gz
gdb-6003fe166df2cd80030ae4a228ac105ae13f477e.tar.bz2
sim: mloop: add #line pragmas everywhere
This will make compiler diagnostics much better with generated code so people can understand the original source file.
Diffstat (limited to 'sim/common')
-rwxr-xr-xsim/common/genmloop.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/sim/common/genmloop.sh b/sim/common/genmloop.sh
index 007582e..765cce8 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.
@@ -1185,6 +1210,7 @@ EOF
case x$parallel in
xread | xwrite)
cat << EOF
+#line $LINENO "$0"
PAREXEC pbufs[MAX_PARALLEL_INSNS];
PAREXEC *par_exec = &pbufs[0];
@@ -1197,6 +1223,7 @@ esac
load_infile_section init
cat << EOF
+#line $LINENO "$0"
if (! CPU_IDESC_SEM_INIT_P (current_cpu))
{
@@ -1240,6 +1267,7 @@ EOF
load_infile_section full-exec-pbb
cat << EOF
+#line $LINENO "$0"
/* end full-exec-pbb */
}
while (CPU_RUNNING_P (current_cpu));
@@ -1256,6 +1284,7 @@ EOF
if [ x$fast = xyes ] ; then
cat << EOF
+#line $LINENO "$0"
#define FAST_P 1
@@ -1275,6 +1304,7 @@ EOF
case x$parallel in
xread | xwrite)
cat << EOF
+#line $LINENO "$0"
PAREXEC pbufs[MAX_PARALLEL_INSNS];
PAREXEC *par_exec = &pbufs[0];
@@ -1287,6 +1317,7 @@ esac
load_infile_section init
cat << EOF
+#line $LINENO "$0"
if (! CPU_IDESC_SEM_INIT_P (current_cpu))
{
@@ -1330,6 +1361,7 @@ EOF
load_infile_section fast-exec-pbb
cat << EOF
+#line $LINENO "$0"
/* end fast-exec-pbb */
}
while (CPU_RUNNING_P (current_cpu));