From: Andrew Cagney <ac131313@cygnus.com>
To: Richard.Earnshaw@arm.com
Cc: gdb@sources.redhat.com
Subject: Re: Moving to GDB_MULTI_ARCH_PARTIAL
Date: Thu, 07 Feb 2002 19:45:00 -0000 [thread overview]
Message-ID: <3C6349CB.5080700@cygnus.com> (raw)
In-Reply-To: <200202061721.RAA02197@cam-mail2.cambridge.arm.com>
[-- Attachment #1: Type: text/plain, Size: 1236 bytes --]
> I'm trying to get the ARM target building now at multi-arch partial. It
> seems that the auto-generated definitions at this level are to an extent
> inconsistent.
>
> For example, gdbarch_validate() requires that PUSH_ARGUMENTS is fully
> implemented as a multi-arch call, but the code in gdbarch.h does not fault
> a partial definition of this.
>
> That is, in gdbarch.h we have
>
> #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PUSH_ARGUMENTS)
> #error "Non multi-arch definition of PUSH_ARGUMENTS"
> #endif
> #if GDB_MULTI_ARCH
> #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PUSH_ARGUMENTS)
> #define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr)
> (gdbarch_pus
> h_arguments (current_gdbarch, nargs, args, sp, struct_return, struct_addr))
> #endif
> #endif
>
> but then in gdbarch_validate,
>
> if ((GDB_MULTI_ARCH >= 1)
> && (gdbarch->push_arguments == 0))
> fprintf_unfiltered (log, "\n\tpush_arguments");
>
>
> Surely these two should be brought into line (one tests with ">" and the
> other with ">=").
Er, yes. Good point. Try the attached. If it works, I'll try to
simplify the .c file as well
In the mean time I'll re-build everything :-/
Andrew
[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 4024 bytes --]
2002-02-07 Andrew Cagney <ac131313@redhat.com>
* gdbarch.sh: For for level one methods, disallow a definition
when partially multi-arched. Check for bad field.
* gdbarch.h: Re-generate.
Index: gdbarch.sh
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.sh,v
retrieving revision 1.108
diff -u -r1.108 gdbarch.sh
--- gdbarch.sh 2002/02/06 13:00:45 1.108
+++ gdbarch.sh 2002/02/08 03:42:28
@@ -25,7 +25,7 @@
if test ! -r ${file}
then
echo "${file} missing? cp new-${file} ${file}" 1>&2
- elif diff -c ${file} new-${file}
+ elif diff ${file} new-${file}
then
echo "${file} unchanged" 1>&2
else
@@ -76,6 +76,13 @@
fi
done
+ case "${level}" in
+ 1 ) gt_level=">= GDB_MULTI_ARCH_PARTIAL" ;;
+ 2 ) gt_level="> GDB_MULTI_ARCH_PARTIAL" ;;
+ "" ) ;;
+ * ) error "Error: bad level for ${function}" 1>&2 ; kill $$ ; exit 1 ;;
+ esac
+
case "${class}" in
m ) staticdefault="${predefault}" ;;
M ) staticdefault="0" ;;
@@ -354,7 +361,9 @@
# Currently unused.
- *) exit 1;;
+ *)
+ echo "Bad field ${field}"
+ exit 1;;
esac
done
@@ -736,11 +745,11 @@
printf "\n"
printf "extern ${returntype} gdbarch_${function} (struct gdbarch *gdbarch);\n"
printf "/* set_gdbarch_${function}() - not applicable - pre-initialized. */\n"
- printf "#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (${macro})\n"
+ printf "#if (GDB_MULTI_ARCH ${gt_level}) && defined (${macro})\n"
printf "#error \"Non multi-arch definition of ${macro}\"\n"
printf "#endif\n"
printf "#if GDB_MULTI_ARCH\n"
- printf "#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (${macro})\n"
+ printf "#if (GDB_MULTI_ARCH ${gt_level}) || !defined (${macro})\n"
printf "#define ${macro} (gdbarch_${function} (current_gdbarch))\n"
printf "#endif\n"
printf "#endif\n"
@@ -785,10 +794,10 @@
printf "#endif\n"
printf "\n"
printf "extern int gdbarch_${function}_p (struct gdbarch *gdbarch);\n"
- printf "#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (${macro}_P)\n"
+ printf "#if (GDB_MULTI_ARCH ${gt_level}) && defined (${macro}_P)\n"
printf "#error \"Non multi-arch definition of ${macro}\"\n"
printf "#endif\n"
- printf "#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (${macro}_P)\n"
+ printf "#if (GDB_MULTI_ARCH ${gt_level}) || !defined (${macro}_P)\n"
printf "#define ${macro}_P() (gdbarch_${function}_p (current_gdbarch))\n"
printf "#endif\n"
fi
@@ -807,11 +816,11 @@
printf "\n"
printf "extern ${returntype} gdbarch_${function} (struct gdbarch *gdbarch);\n"
printf "extern void set_gdbarch_${function} (struct gdbarch *gdbarch, ${returntype} ${function});\n"
- printf "#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (${macro})\n"
+ printf "#if (GDB_MULTI_ARCH ${gt_level}) && defined (${macro})\n"
printf "#error \"Non multi-arch definition of ${macro}\"\n"
printf "#endif\n"
printf "#if GDB_MULTI_ARCH\n"
- printf "#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (${macro})\n"
+ printf "#if (GDB_MULTI_ARCH ${gt_level}) || !defined (${macro})\n"
printf "#define ${macro} (gdbarch_${function} (current_gdbarch))\n"
printf "#endif\n"
printf "#endif\n"
@@ -853,11 +862,11 @@
printf "extern void set_gdbarch_${function} (struct gdbarch *gdbarch, gdbarch_${function}_ftype *${function});\n"
if class_is_multiarch_p ; then :
else
- printf "#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (${macro})\n"
+ printf "#if (GDB_MULTI_ARCH ${gt_level}) && defined (${macro})\n"
printf "#error \"Non multi-arch definition of ${macro}\"\n"
printf "#endif\n"
printf "#if GDB_MULTI_ARCH\n"
- printf "#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (${macro})\n"
+ printf "#if (GDB_MULTI_ARCH ${gt_level}) || !defined (${macro})\n"
if [ "x${actual}" = "x" ]
then
printf "#define ${macro}() (gdbarch_${function} (current_gdbarch))\n"
next prev parent reply other threads:[~2002-02-08 3:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-02-06 9:21 Richard Earnshaw
2002-02-07 19:45 ` Andrew Cagney [this message]
2002-02-07 23:08 ` Andrew Cagney
2002-02-08 1:38 ` Richard Earnshaw
2002-02-08 7:19 ` Andrew Cagney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3C6349CB.5080700@cygnus.com \
--to=ac131313@cygnus.com \
--cc=Richard.Earnshaw@arm.com \
--cc=gdb@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox