This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Moving to GDB_MULTI_ARCH_PARTIAL


> 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


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"

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]