#endif
#endif
+/*v:1:TARGET_CHAR_BIT:int:char_bit::::8 * sizeof (char):0 */
+
extern int gdbarch_short_bit (struct gdbarch *gdbarch);
extern void set_gdbarch_short_bit (struct gdbarch *gdbarch, int short_bit);
#if GDB_MULTI_ARCH
#endif
#endif
+/* This macro gives the number of pseudo-registers that live in the
+ register namespace but do not get fetched or stored on the target.
+ These pseudo-registers may be aliases for other registers,
+ combinations of other registers, or they may be computed by GDB. */
+
/* Default (value) for non- multi-arch platforms. */
#if (!GDB_MULTI_ARCH) && !defined (NUM_PSEUDO_REGS)
#define NUM_PSEUDO_REGS (0)
#endif
#endif
+/* This function is called when the value of a pseudo-register needs to
+ be updated. Typically it will be defined on a per-architecture
+ basis. */
+
/* Default (function) for non- multi-arch platforms. */
#if (!GDB_MULTI_ARCH) && !defined (FETCH_PSEUDO_REGISTER)
#define FETCH_PSEUDO_REGISTER(regnum) (internal_error ("FETCH_PSEUDO_REGISTER"), 0)
#endif
#endif
+/* This function is called when the value of a pseudo-register needs to
+ be set or stored. Typically it will be defined on a
+ per-architecture basis. */
+
/* Default (function) for non- multi-arch platforms. */
#if (!GDB_MULTI_ARCH) && !defined (STORE_PSEUDO_REGISTER)
#define STORE_PSEUDO_REGISTER(regnum) (internal_error ("STORE_PSEUDO_REGISTER"), 0)
#endif
#endif
+/* I wish that these would just go away.... */
+
/* Default (function) for non- multi-arch platforms. */
#if (!GDB_MULTI_ARCH) && !defined (D10V_MAKE_DADDR)
#define D10V_MAKE_DADDR(x) (internal_error ("D10V_MAKE_DADDR"), 0)
do_read ()
{
- if eval read $read
- then
- test "${staticdefault}" || staticdefault=0
- # NOT YET: Breaks BELIEVE_PCC_PROMOTION and confuses non-
- # multi-arch defaults.
- # test "${predefault}" || predefault=0
- test "${fmt}" || fmt="%ld"
- test "${print}" || print="(long) ${macro}"
- case "${invalid_p}" in
- 0 ) valid_p=1 ;;
- "" )
- if [ "${predefault}" ]
- then
- #invalid_p="gdbarch->${function} == ${predefault}"
- valid_p="gdbarch->${function} != ${predefault}"
- else
- #invalid_p="gdbarch->${function} == 0"
- valid_p="gdbarch->${function} != 0"
- fi
- ;;
- * ) valid_p="!(${invalid_p})"
- esac
-
- # PREDEFAULT is a valid fallback definition of MEMBER when
- # multi-arch is not enabled. This ensures that the default
- # value, when multi-arch is the same as the default value when
- # not multi-arch. POSTDEFAULT is always a valid definition of
- # MEMBER as this again ensures consistency.
- if [ "${postdefault}" != "" ]
+ comment=""
+ class=""
+ while read line
+ do
+ if test "${line}" = ""
+ then
+ continue
+ elif test "${line}" = "#" -a "${comment}" = ""
then
- fallbackdefault="${postdefault}"
- elif [ "${predefault}" != "" ]
+ continue
+ elif expr "${line}" : "#" > /dev/null
then
- fallbackdefault="${predefault}"
+ comment="${comment}
+${line}"
else
- fallbackdefault=""
+ OFS="${IFS}" ; IFS=":"
+ eval read ${read} <<EOF
+${line}
+EOF
+ IFS="${OFS}"
+
+ test "${staticdefault}" || staticdefault=0
+ # NOT YET: Breaks BELIEVE_PCC_PROMOTION and confuses non-
+ # multi-arch defaults.
+ # test "${predefault}" || predefault=0
+ test "${fmt}" || fmt="%ld"
+ test "${print}" || print="(long) ${macro}"
+ case "${invalid_p}" in
+ 0 ) valid_p=1 ;;
+ "" )
+ if [ "${predefault}" ]
+ then
+ #invalid_p="gdbarch->${function} == ${predefault}"
+ valid_p="gdbarch->${function} != ${predefault}"
+ else
+ #invalid_p="gdbarch->${function} == 0"
+ valid_p="gdbarch->${function} != 0"
+ fi
+ ;;
+ * ) valid_p="!(${invalid_p})"
+ esac
+
+ # PREDEFAULT is a valid fallback definition of MEMBER when
+ # multi-arch is not enabled. This ensures that the
+ # default value, when multi-arch is the same as the
+ # default value when not multi-arch. POSTDEFAULT is
+ # always a valid definition of MEMBER as this again
+ # ensures consistency.
+
+ if [ "${postdefault}" != "" ]
+ then
+ fallbackdefault="${postdefault}"
+ elif [ "${predefault}" != "" ]
+ then
+ fallbackdefault="${predefault}"
+ else
+ fallbackdefault=""
+ fi
+
+ #NOT YET: See gdbarch.log for basic verification of
+ # database
+
+ break
fi
- #NOT YET:
- # See gdbarch.log for basic verification of database
- :
+ done
+ if [ "${class}" ]
+ then
+ true
else
false
fi
esac
done
-IFS=:
function_list ()
{
# See below (DOCO) for description of each field
- cat <<EOF |
+ cat <<EOF
i:2:TARGET_ARCHITECTURE:const struct bfd_arch_info *:bfd_arch_info::::&bfd_default_arch_struct::::%s:TARGET_ARCHITECTURE->printable_name:TARGET_ARCHITECTURE != NULL
#
i:2:TARGET_BYTE_ORDER:int:byte_order::::BIG_ENDIAN
f:1:REGISTER_CONVERTIBLE:int:register_convertible:int nr:nr:::generic_register_convertible_not::0
f:2:REGISTER_CONVERT_TO_VIRTUAL:void:register_convert_to_virtual:int regnum, struct type *type, char *from, char *to:regnum, type, from, to:::0::0
f:2:REGISTER_CONVERT_TO_RAW:void:register_convert_to_raw:struct type *type, int regnum, char *from, char *to:type, regnum, from, to:::0::0
-#This function is called when the value of a pseudo-register needs
-#to be updated. Typically it will be defined on a per-architecture
-#basis.
+# This function is called when the value of a pseudo-register needs to
+# be updated. Typically it will be defined on a per-architecture
+# basis.
f:2:FETCH_PSEUDO_REGISTER:void:fetch_pseudo_register:int regnum:regnum:::0::0
-#This function is called when the value of a pseudo-register needs
-#to be set or stored. Typically it will be defined on a per-architecture
-#basis.
+# This function is called when the value of a pseudo-register needs to
+# be set or stored. Typically it will be defined on a
+# per-architecture basis.
f:2:STORE_PSEUDO_REGISTER:void:store_pseudo_register:int regnum:regnum:::0::0
#
f:2:POINTER_TO_ADDRESS:CORE_ADDR:pointer_to_address:struct type *type, void *buf:type, buf:::unsigned_pointer_to_address::0
v:2:TARGET_DOUBLE_FORMAT:const struct floatformat *:double_format::::::default_double_format (gdbarch)
v:2:TARGET_LONG_DOUBLE_FORMAT:const struct floatformat *:long_double_format::::::&floatformat_unknown
EOF
- grep -v '^#'
}
#
# The .log file
#
exec > new-gdbarch.log
-function_list | while do_read # eval read $read
+function_list | while do_read
do
cat <<EOF
${class} ${macro}(${actual})
echo ""
echo ""
echo "/* The following are pre-initialized by GDBARCH. */"
-function_list | while do_read # eval read $read
+function_list | while do_read
do
if class_is_info_p
then
echo ""
echo ""
echo "/* The following are initialized by the target dependant code. */"
-function_list | while do_read # eval read $read
+function_list | while do_read
do
+ if [ "${comment}" ]
+ then
+ echo "${comment}" | sed \
+ -e '2 s,#,/*,' \
+ -e '3,$ s,#, ,' \
+ -e '$ s,$, */,'
+ fi
if class_is_predicate_p
then
echo ""
echo "struct gdbarch"
echo "{"
echo " /* basic architectural information */"
-function_list | while do_read # eval read $read
+function_list | while do_read
do
if class_is_info_p
then
*/
EOF
-function_list | while do_read # eval read $read
+function_list | while do_read
do
if class_is_variable_p
then
0, NULL, NULL,
/* Multi-arch values */
EOF
-function_list | while do_read # eval read $read
+function_list | while do_read
do
if class_is_function_p || class_is_variable_p
then
gdbarch->tdep = tdep;
EOF
echo ""
-function_list | while do_read # eval read $read
+function_list | while do_read
do
if class_is_info_p
then
done
echo ""
echo " /* Force the explicit initialization of these. */"
-function_list | while do_read # eval read $read
+function_list | while do_read
do
if class_is_function_p || class_is_variable_p
then
internal_error ("verify_gdbarch: bfd_arch_info unset");
/* Check those that need to be defined for the given multi-arch level. */
EOF
-function_list | while do_read # eval read $read
+function_list | while do_read
do
if class_is_function_p || class_is_variable_p
then
EOF
function_list | while do_read
do
- if [ ${returntype} == "void" ]
+ if [ "${returntype}" == "void" ]
then
echo "#if defined (${macro}) && GDB_MULTI_ARCH"
echo " /* Macro might contain \`[{}]' when not multi-arch */"
}
EOF
echo ""
-function_list | while do_read # eval read $read
+function_list | while do_read
do
if class_is_predicate_p
then
data-pointer. */
void *
-gdbarch_data (data)
- struct gdbarch_data *data;
+gdbarch_data (struct gdbarch_data *data)
{
if (data->index >= current_gdbarch->nr_data)
internal_error ("gdbarch_data: request for non-existant data.");
extern void _initialize_gdbarch (void);
void
-_initialize_gdbarch ()
+_initialize_gdbarch (void)
{
struct cmd_list_element *c;