diff options
author | Yao Qi <yao@codesourcery.com> | 2014-12-18 20:47:28 +0800 |
---|---|---|
committer | Yao Qi <yao@codesourcery.com> | 2014-12-18 20:47:28 +0800 |
commit | cc86d1cb9510dbba32bf19e5d2699f2972efbc03 (patch) | |
tree | 408ae0ba1bbe54f9a50cd5eee1687f6c8234b9bf /gdb/gdbarch.c | |
parent | 2ad47ec43319b87774a276506f48e8e4496bb310 (diff) | |
download | gdb-cc86d1cb9510dbba32bf19e5d2699f2972efbc03.zip gdb-cc86d1cb9510dbba32bf19e5d2699f2972efbc03.tar.gz gdb-cc86d1cb9510dbba32bf19e5d2699f2972efbc03.tar.bz2 |
Refactor gdbarch method print_float_info
This patch is to change print_float_info gdbarch method for the
following two reasons,
1. we want to add a default implementation of print_float_info to
dump the float pointer registers. It can be reused by backend to
print something more than float point registers.
2. we want to simplify the caller of print_float_info,
infcmd.c:print_float_info.
gdb:
2014-12-18 Yao Qi <yao@codesourcery.com>
* gdbarch.sh (print_float_info): Change its type from 'M' to 'm'.
* gdbarch.c: Re-generated.
* gdbarch.h: Likewise.
* infcmd.c (default_print_float_info): New function.
(print_float_info): Removed. Move code to
default_print_float_info.
(float_info): Adjust to call gdbarch_print_float_info.
* inferior.h (default_print_float_info): Declare it.
Diffstat (limited to 'gdb/gdbarch.c')
-rw-r--r-- | gdb/gdbarch.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index 657708e..93110af 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -379,6 +379,7 @@ gdbarch_alloc (const struct gdbarch_info *info, gdbarch->deprecated_fp_regnum = -1; gdbarch->call_dummy_location = AT_ENTRY_POINT; gdbarch->print_registers_info = default_print_registers_info; + gdbarch->print_float_info = default_print_float_info; gdbarch->register_sim_regno = legacy_register_sim_regno; gdbarch->cannot_fetch_register = cannot_register_not; gdbarch->cannot_store_register = cannot_register_not; @@ -531,7 +532,7 @@ verify_gdbarch (struct gdbarch *gdbarch) /* Skip verify of call_dummy_location, invalid_p == 0 */ /* Skip verify of push_dummy_code, has predicate. */ /* Skip verify of print_registers_info, invalid_p == 0 */ - /* Skip verify of print_float_info, has predicate. */ + /* Skip verify of print_float_info, invalid_p == 0 */ /* Skip verify of print_vector_info, has predicate. */ /* Skip verify of register_sim_regno, invalid_p == 0 */ /* Skip verify of cannot_fetch_register, invalid_p == 0 */ @@ -1089,9 +1090,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) "gdbarch_dump: pointer_to_address = <%s>\n", host_address_to_string (gdbarch->pointer_to_address)); fprintf_unfiltered (file, - "gdbarch_dump: gdbarch_print_float_info_p() = %d\n", - gdbarch_print_float_info_p (gdbarch)); - fprintf_unfiltered (file, "gdbarch_dump: print_float_info = <%s>\n", host_address_to_string (gdbarch->print_float_info)); fprintf_unfiltered (file, @@ -2235,13 +2233,6 @@ set_gdbarch_print_registers_info (struct gdbarch *gdbarch, gdbarch->print_registers_info = print_registers_info; } -int -gdbarch_print_float_info_p (struct gdbarch *gdbarch) -{ - gdb_assert (gdbarch != NULL); - return gdbarch->print_float_info != NULL; -} - void gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args) { |