2004-06-21 Andrew Cagney <cagney@gnu.org>
* gdbarch.sh: For gdbarch_dump, print the "function" rather than macro name, and the function rather than macro value. Only wrap macro print statements in #ifdef. Move format logic to where it is needed. * gdbarch.c: Re-generate.
This commit is contained in:
parent
283354d860
commit
48f7351b33
3 changed files with 483 additions and 557 deletions
|
@ -1,5 +1,11 @@
|
||||||
2004-06-21 Andrew Cagney <cagney@gnu.org>
|
2004-06-21 Andrew Cagney <cagney@gnu.org>
|
||||||
|
|
||||||
|
* gdbarch.sh: For gdbarch_dump, print the "function" rather than
|
||||||
|
macro name, and the function rather than macro value. Only wrap
|
||||||
|
macro print statements in #ifdef. Move format logic to where it
|
||||||
|
is needed.
|
||||||
|
* gdbarch.c: Re-generate.
|
||||||
|
|
||||||
* gdbarch.sh (read): Delete "print_p" and "description", add
|
* gdbarch.sh (read): Delete "print_p" and "description", add
|
||||||
"garbage_at_eol". Check for non-empty garbage at end-of-line.
|
"garbage_at_eol". Check for non-empty garbage at end-of-line.
|
||||||
Delete references to print_p.
|
Delete references to print_p.
|
||||||
|
|
951
gdb/gdbarch.c
951
gdb/gdbarch.c
File diff suppressed because it is too large
Load diff
|
@ -109,23 +109,6 @@ EOF
|
||||||
* ) test "${staticdefault}" || staticdefault=0 ;;
|
* ) test "${staticdefault}" || staticdefault=0 ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# come up with a format, use a few guesses for variables
|
|
||||||
case ":${class}:${fmt}:${print}:" in
|
|
||||||
:[vV]::: )
|
|
||||||
if [ "${returntype}" = int ]
|
|
||||||
then
|
|
||||||
fmt="%d"
|
|
||||||
print="${macro}"
|
|
||||||
elif [ "${returntype}" = long ]
|
|
||||||
then
|
|
||||||
fmt="%ld"
|
|
||||||
print="${macro}"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
test "${fmt}" || fmt="%ld"
|
|
||||||
test "${print}" || print="(long) ${macro}"
|
|
||||||
|
|
||||||
case "${class}" in
|
case "${class}" in
|
||||||
F | V | M )
|
F | V | M )
|
||||||
case "${invalid_p}" in
|
case "${invalid_p}" in
|
||||||
|
@ -1550,32 +1533,22 @@ do
|
||||||
# First the predicate
|
# First the predicate
|
||||||
if class_is_predicate_p
|
if class_is_predicate_p
|
||||||
then
|
then
|
||||||
if class_is_multiarch_p
|
if test -n "${macro}"
|
||||||
then
|
then
|
||||||
printf " fprintf_unfiltered (file,\n"
|
|
||||||
printf " \"gdbarch_dump: gdbarch_${function}_p() = %%d\\\\n\",\n"
|
|
||||||
printf " gdbarch_${function}_p (current_gdbarch));\n"
|
|
||||||
else
|
|
||||||
printf "#ifdef ${macro}_P\n"
|
printf "#ifdef ${macro}_P\n"
|
||||||
printf " fprintf_unfiltered (file,\n"
|
printf " fprintf_unfiltered (file,\n"
|
||||||
printf " \"gdbarch_dump: %%s # %%s\\\\n\",\n"
|
printf " \"gdbarch_dump: %%s # %%s\\\\n\",\n"
|
||||||
printf " \"${macro}_P()\",\n"
|
printf " \"${macro}_P()\",\n"
|
||||||
printf " XSTRING (${macro}_P ()));\n"
|
printf " XSTRING (${macro}_P ()));\n"
|
||||||
printf " fprintf_unfiltered (file,\n"
|
|
||||||
printf " \"gdbarch_dump: ${macro}_P() = %%d\\\\n\",\n"
|
|
||||||
printf " ${macro}_P ());\n"
|
|
||||||
printf "#endif\n"
|
printf "#endif\n"
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
# multiarch functions don't have macros.
|
|
||||||
if class_is_multiarch_p
|
|
||||||
then
|
|
||||||
printf " fprintf_unfiltered (file,\n"
|
printf " fprintf_unfiltered (file,\n"
|
||||||
printf " \"gdbarch_dump: ${function} = 0x%%08lx\\\\n\",\n"
|
printf " \"gdbarch_dump: gdbarch_${function}_p() = %%d\\\\n\",\n"
|
||||||
printf " (long) current_gdbarch->${function});\n"
|
printf " gdbarch_${function}_p (current_gdbarch));\n"
|
||||||
continue
|
|
||||||
fi
|
fi
|
||||||
# Print the macro definition.
|
# Print the macro definition.
|
||||||
|
if test -n "${macro}"
|
||||||
|
then
|
||||||
printf "#ifdef ${macro}\n"
|
printf "#ifdef ${macro}\n"
|
||||||
if class_is_function_p
|
if class_is_function_p
|
||||||
then
|
then
|
||||||
|
@ -1588,18 +1561,34 @@ do
|
||||||
printf " \"gdbarch_dump: ${macro} # %%s\\\\n\",\n"
|
printf " \"gdbarch_dump: ${macro} # %%s\\\\n\",\n"
|
||||||
printf " XSTRING (${macro}));\n"
|
printf " XSTRING (${macro}));\n"
|
||||||
fi
|
fi
|
||||||
|
printf "#endif\n"
|
||||||
|
fi
|
||||||
|
# Print the corresponding value.
|
||||||
if class_is_function_p
|
if class_is_function_p
|
||||||
then
|
then
|
||||||
printf " fprintf_unfiltered (file,\n"
|
printf " fprintf_unfiltered (file,\n"
|
||||||
printf " \"gdbarch_dump: ${macro} = <0x%%08lx>\\\\n\",\n"
|
printf " \"gdbarch_dump: ${function} = <0x%%lx>\\\\n\",\n"
|
||||||
printf " (long) current_gdbarch->${function}\n"
|
printf " (long) current_gdbarch->${function});\n"
|
||||||
printf " /*${macro} ()*/);\n"
|
|
||||||
else
|
else
|
||||||
|
# It is a variable
|
||||||
|
case "${fmt}:${print}:${returntype}" in
|
||||||
|
::CORE_ADDR )
|
||||||
|
fmt="0x%s"
|
||||||
|
print="paddr_nz (current_gdbarch->${function})"
|
||||||
|
;;
|
||||||
|
::* )
|
||||||
|
fmt="%s"
|
||||||
|
print="paddr_d (current_gdbarch->${function})"
|
||||||
|
;;
|
||||||
|
* )
|
||||||
|
test "${fmt}" || fmt="%ld"
|
||||||
|
test "${print}" || print="(long) (current_gdbarch->${function})"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
printf " fprintf_unfiltered (file,\n"
|
printf " fprintf_unfiltered (file,\n"
|
||||||
printf " \"gdbarch_dump: ${macro} = %s\\\\n\",\n" "${fmt}"
|
printf " \"gdbarch_dump: ${function} = %s\\\\n\",\n" "${fmt}"
|
||||||
printf " ${print});\n"
|
printf " ${print});\n"
|
||||||
fi
|
fi
|
||||||
printf "#endif\n"
|
|
||||||
done
|
done
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
if (current_gdbarch->dump_tdep != NULL)
|
if (current_gdbarch->dump_tdep != NULL)
|
||||||
|
|
Loading…
Add table
Reference in a new issue