summaryrefslogtreecommitdiff
path: root/gdb/gdbarch.sh
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2003-11-10 01:10:55 +0000
committerAndrew Cagney <cagney@redhat.com>2003-11-10 01:10:55 +0000
commit13129d0c9f39f38aff64afe97af81b76edeb5d27 (patch)
tree9605f0cfbb930cca5d25a612793d3ed2d98ead11 /gdb/gdbarch.sh
parentf1fb3aedccaf66676be3b31812b0daba25ad83a4 (diff)
downloadgdb-13129d0c9f39f38aff64afe97af81b76edeb5d27.tar.gz
2003-11-09 Andrew Cagney <cagney@redhat.com>
* gdbarch.sh (verify_gdbarch, gdbarch_dump): Rename "gdbarch" parameter to "current_gdbarch". Add comment explaining why. (TARGET_FLOAT_FORMAT: Pass "current_gdbarch" to default_double_format. (TARGET_DOUBLE_FORMAT,TARGET_LONG_DOUBLE_FORMAT): Ditto. * gdbarch.c: Re-generate.
Diffstat (limited to 'gdb/gdbarch.sh')
-rwxr-xr-xgdb/gdbarch.sh46
1 files changed, 26 insertions, 20 deletions
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index afc5e02cdec..7453276f01b 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -323,8 +323,9 @@ do
# You cannot specify both a zero INVALID_P and a POSTDEFAULT.
- # Variable declarations can refer to ``gdbarch'' which will
- # contain the current architecture. Care should be taken.
+ # Variable declarations can refer to ``current_gdbarch'' which
+ # will contain the current architecture. Care should be
+ # taken.
invalid_p ) : ;;
@@ -668,9 +669,9 @@ m:::int:stabs_argument_has_addr:struct type *type:type:::default_stabs_argument_
v::FRAME_RED_ZONE_SIZE:int:frame_red_zone_size
v:2:PARM_BOUNDARY:int:parm_boundary
#
-v:2:TARGET_FLOAT_FORMAT:const struct floatformat *:float_format::::::default_float_format (gdbarch)::%s:(TARGET_FLOAT_FORMAT)->name
-v:2:TARGET_DOUBLE_FORMAT:const struct floatformat *:double_format::::::default_double_format (gdbarch)::%s:(TARGET_DOUBLE_FORMAT)->name
-v:2:TARGET_LONG_DOUBLE_FORMAT:const struct floatformat *:long_double_format::::::default_double_format (gdbarch)::%s:(TARGET_LONG_DOUBLE_FORMAT)->name
+v:2:TARGET_FLOAT_FORMAT:const struct floatformat *:float_format::::::default_float_format (current_gdbarch)::%s:(TARGET_FLOAT_FORMAT)->name
+v:2:TARGET_DOUBLE_FORMAT:const struct floatformat *:double_format::::::default_double_format (current_gdbarch)::%s:(TARGET_DOUBLE_FORMAT)->name
+v:2:TARGET_LONG_DOUBLE_FORMAT:const struct floatformat *:long_double_format::::::default_double_format (current_gdbarch)::%s:(TARGET_LONG_DOUBLE_FORMAT)->name
m:::CORE_ADDR:convert_from_func_ptr_addr:CORE_ADDR addr, struct target_ops *targ:addr, targ:::convert_from_func_ptr_addr_identity::0
# On some machines there are bits in addresses which are not really
# part of the address, but are used by the kernel, the hardware, etc.
@@ -1293,7 +1294,6 @@ cat <<EOF
/* Static function declarations */
-static void verify_gdbarch (struct gdbarch *gdbarch);
static void alloc_gdbarch_data (struct gdbarch *);
static void init_gdbarch_swap (struct gdbarch *);
static void clear_gdbarch_swap (struct gdbarch *);
@@ -1530,13 +1530,19 @@ gdbarch_free (struct gdbarch *arch)
EOF
# verify a new architecture
-printf "\n"
-printf "\n"
-printf "/* Ensure that all values in a GDBARCH are reasonable. */\n"
-printf "\n"
cat <<EOF
+
+
+/* Ensure that all values in a GDBARCH are reasonable. */
+
+/* NOTE/WARNING: The parameter is called \`\`current_gdbarch'' so that it
+ just happens to match the global variable \`\`current_gdbarch''. That
+ way macros refering to that variable get the local and not the global
+ version - ulgh. Once everything is parameterised with gdbarch, this
+ will go away. */
+
static void
-verify_gdbarch (struct gdbarch *gdbarch)
+verify_gdbarch (struct gdbarch *current_gdbarch)
{
struct ui_file *log;
struct cleanup *cleanups;
@@ -1545,9 +1551,9 @@ verify_gdbarch (struct gdbarch *gdbarch)
log = mem_fileopen ();
cleanups = make_cleanup_ui_file_delete (log);
/* fundamental */
- if (gdbarch->byte_order == BFD_ENDIAN_UNKNOWN)
+ if (current_gdbarch->byte_order == BFD_ENDIAN_UNKNOWN)
fprintf_unfiltered (log, "\n\tbyte-order");
- if (gdbarch->bfd_arch_info == NULL)
+ if (current_gdbarch->bfd_arch_info == NULL)
fprintf_unfiltered (log, "\n\tbfd_arch_info");
/* Check those that need to be defined for the given multi-arch level. */
EOF
@@ -1565,15 +1571,15 @@ do
elif [ -n "${invalid_p}" -a -n "${postdefault}" ]
then
printf " if (${invalid_p})\n"
- printf " gdbarch->${function} = ${postdefault};\n"
+ printf " current_gdbarch->${function} = ${postdefault};\n"
elif [ -n "${predefault}" -a -n "${postdefault}" ]
then
- printf " if (gdbarch->${function} == ${predefault})\n"
- printf " gdbarch->${function} = ${postdefault};\n"
+ printf " if (current_gdbarch->${function} == ${predefault})\n"
+ printf " current_gdbarch->${function} = ${postdefault};\n"
elif [ -n "${postdefault}" ]
then
- printf " if (gdbarch->${function} == 0)\n"
- printf " gdbarch->${function} = ${postdefault};\n"
+ printf " if (current_gdbarch->${function} == 0)\n"
+ printf " current_gdbarch->${function} = ${postdefault};\n"
elif [ -n "${invalid_p}" ]
then
printf " if ((GDB_MULTI_ARCH ${gt_level})\n"
@@ -1582,7 +1588,7 @@ do
elif [ -n "${predefault}" ]
then
printf " if ((GDB_MULTI_ARCH ${gt_level})\n"
- printf " && (gdbarch->${function} == ${predefault}))\n"
+ printf " && (current_gdbarch->${function} == ${predefault}))\n"
printf " fprintf_unfiltered (log, \"\\\\n\\\\t${function}\");\n"
fi
fi
@@ -1611,7 +1617,7 @@ cat <<EOF
will go away. */
void
-gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
+gdbarch_dump (struct gdbarch *current_gdbarch, struct ui_file *file)
{
fprintf_unfiltered (file,
"gdbarch_dump: GDB_MULTI_ARCH = %d\\n",