* [patch/rfc] Provide a default ``info float''
@ 2002-08-10 12:09 Andrew Cagney
2002-08-12 9:30 ` Kevin Buettner
2002-08-15 16:44 ` Andrew Cagney
0 siblings, 2 replies; 5+ messages in thread
From: Andrew Cagney @ 2002-08-10 12:09 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 591 bytes --]
Hello,
It has always struck me as weird that GDB would report:
(gdb) info float
No floating point info available for this processor.
when debugging platforms that I knew had floating-point registers (PPC,
...).
This patch modifies the ``info float'' command so that, if there is no
architecture specific code, it at least prints the floating-point registers.
(If GDB ever gets register attributes, this function can be changed to
print registers with the floating-point attribute (rather than
floating-point type).)
thoughts?
I'll leave this for a week I guess,
enojoy,
Andrew
[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 4895 bytes --]
2002-08-10 Andrew Cagney <ac131313@redhat.com>
* gdbarch.sh (PRINT_FLOAT_INFO): Change to a predicate method.
Add `args' parameter.
* gdbarch.h, gdbarch.c: Regenerate.
* arm-tdep.c (arm_print_float_info): Add the parameter `args'.
* infcmd.c (float_info): Call print_float_info.
(print_float_info): New function. By default, print the
floating-point registers.
* arch-utils.h (default_print_float_info): Delete declaration.
* arch-utils.c (default_print_float_info): Delete function.
Index: arch-utils.c
===================================================================
RCS file: /cvs/src/src/gdb/arch-utils.c,v
retrieving revision 1.64
diff -u -r1.64 arch-utils.c
--- arch-utils.c 10 Aug 2002 02:00:16 -0000 1.64
+++ arch-utils.c 10 Aug 2002 18:35:08 -0000
@@ -250,21 +250,6 @@
}
}
-void
-default_print_float_info (struct gdbarch *gdbarch, struct ui_file *file,
- struct frame_info *frame)
-{
-#ifdef FLOAT_INFO
-#if GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL
-#error "FLOAT_INFO defined in multi-arch"
-#endif
- FLOAT_INFO;
-#else
- fprintf_filtered (file, "\
-No floating point info available for this processor.\n");
-#endif
-}
-
/* Misc helper functions for targets. */
int
Index: arch-utils.h
===================================================================
RCS file: /cvs/src/src/gdb/arch-utils.h,v
retrieving revision 1.38
diff -u -r1.38 arch-utils.h
--- arch-utils.h 10 Aug 2002 02:00:16 -0000 1.38
+++ arch-utils.h 10 Aug 2002 18:37:17 -0000
@@ -146,10 +146,6 @@
extern int generic_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR pc);
-extern void default_print_float_info (struct gdbarch *gdbarch,
- struct ui_file *file,
- struct frame_info *frame);
-
/* Assume that the world is sane, a registers raw and virtual size
both match its type. */
Index: arm-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/arm-tdep.c,v
retrieving revision 1.67
diff -u -r1.67 arm-tdep.c
--- arm-tdep.c 11 Jul 2002 19:25:13 -0000 1.67
+++ arm-tdep.c 10 Aug 2002 18:40:34 -0000
@@ -1585,7 +1585,7 @@
(if present) or emulator. */
static void
arm_print_float_info (struct gdbarch *gdbarch, struct ui_file *file,
- struct frame_info *frame)
+ struct frame_info *frame, const char *args)
{
register unsigned long status = read_register (ARM_FPS_REGNUM);
int type;
Index: gdbarch.sh
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.sh,v
retrieving revision 1.153
diff -u -r1.153 gdbarch.sh
--- gdbarch.sh 10 Aug 2002 02:00:16 -0000 1.153
+++ gdbarch.sh 10 Aug 2002 18:41:13 -0000
@@ -468,7 +468,7 @@
v:2:MAX_REGISTER_VIRTUAL_SIZE:int:max_register_virtual_size::::0:-1
f:2:REGISTER_VIRTUAL_TYPE:struct type *:register_virtual_type:int reg_nr:reg_nr::0:0
f:2:DO_REGISTERS_INFO:void:do_registers_info:int reg_nr, int fpregs:reg_nr, fpregs:::do_registers_info::0
-m:2:PRINT_FLOAT_INFO:void:print_float_info:struct ui_file *file, struct frame_info *frame:file, frame:::default_print_float_info::0
+M:2:PRINT_FLOAT_INFO:void:print_float_info:struct ui_file *file, struct frame_info *frame, const char *args:file, frame, args
# MAP a GDB RAW register number onto a simulator register number. See
# also include/...-sim.h.
f:2:REGISTER_SIM_REGNO:int:register_sim_regno:int reg_nr:reg_nr:::legacy_register_sim_regno::0
Index: infcmd.c
===================================================================
RCS file: /cvs/src/src/gdb/infcmd.c,v
retrieving revision 1.49
diff -u -r1.49 infcmd.c
--- infcmd.c 3 Jul 2002 20:36:54 -0000 1.49
+++ infcmd.c 10 Aug 2002 18:41:14 -0000
@@ -1845,9 +1845,44 @@
/* ARGSUSED */
static void
-float_info (char *addr_exp, int from_tty)
+print_float_info (struct gdbarch *gdbarch, struct ui_file *file,
+ struct frame_info *frame, const char *args)
{
- gdbarch_print_float_info (current_gdbarch, gdb_stdout, selected_frame);
+ if (gdbarch_print_float_info_p (gdbarch))
+ gdbarch_print_float_info (gdbarch, file, frame, args);
+ else
+ {
+#ifdef FLOAT_INFO
+#if GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL
+#error "FLOAT_INFO defined in multi-arch"
+#endif
+ FLOAT_INFO;
+#else
+ int regnum;
+ int printed_something = 0;
+ for (regnum = 0; regnum < NUM_REGS + NUM_PSEUDO_REGS; regnum++)
+ {
+ if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (regnum)) == TYPE_CODE_FLT)
+ {
+ printed_something = 1;
+#if 0
+ gdbarch_print_registers_info (gdbarch, file, frame, regnum, 1);
+#else
+ do_registers_info (regnum, 1);
+#endif
+ }
+ }
+ if (!printed_something)
+ fprintf_filtered (file, "\
+No floating-point info available for this processor.\n");
+#endif
+ }
+}
+
+static void
+float_info (char *args, int from_tty)
+{
+ print_float_info (current_gdbarch, gdb_stdout, selected_frame, args);
}
\f
/* ARGSUSED */
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch/rfc] Provide a default ``info float''
2002-08-10 12:09 [patch/rfc] Provide a default ``info float'' Andrew Cagney
@ 2002-08-12 9:30 ` Kevin Buettner
2002-08-12 11:55 ` Andrew Cagney
2002-08-15 16:44 ` Andrew Cagney
1 sibling, 1 reply; 5+ messages in thread
From: Kevin Buettner @ 2002-08-12 9:30 UTC (permalink / raw)
To: Andrew Cagney, gdb-patches
On Aug 10, 3:09pm, Andrew Cagney wrote:
> It has always struck me as weird that GDB would report:
>
> (gdb) info float
> No floating point info available for this processor.
>
> when debugging platforms that I knew had floating-point registers (PPC,
> ...).
>
> This patch modifies the ``info float'' command so that, if there is no
> architecture specific code, it at least prints the floating-point registers.
What does it do when there truly are no floating point registers?
(I think I remember seeing some complaints in the past regarding the
fact that fp registers were being displayed even though the processor
being used had no fp registers. Personally, this never bothered me,
but clearly it bothers some folks.)
Kevin
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch/rfc] Provide a default ``info float''
2002-08-12 9:30 ` Kevin Buettner
@ 2002-08-12 11:55 ` Andrew Cagney
0 siblings, 0 replies; 5+ messages in thread
From: Andrew Cagney @ 2002-08-12 11:55 UTC (permalink / raw)
To: Kevin Buettner; +Cc: gdb-patches
> On Aug 10, 3:09pm, Andrew Cagney wrote:
>
>
>> It has always struck me as weird that GDB would report:
>>
>> (gdb) info float
>> No floating point info available for this processor.
>>
>> when debugging platforms that I knew had floating-point registers (PPC,
>> ...).
>>
>> This patch modifies the ``info float'' command so that, if there is no
>> architecture specific code, it at least prints the floating-point registers.
>
>
> What does it do when there truly are no floating point registers?
>
> (I think I remember seeing some complaints in the past regarding the
> fact that fp registers were being displayed even though the processor
> being used had no fp registers. Personally, this never bothered me,
> but clearly it bothers some folks.)
It prints [dig dig]
+
fprintf_filtered (file, "\
+No floating-point info available for this processor.\n");
Andrew
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch/rfc] Provide a default ``info float''
2002-08-10 12:09 [patch/rfc] Provide a default ``info float'' Andrew Cagney
2002-08-12 9:30 ` Kevin Buettner
@ 2002-08-15 16:44 ` Andrew Cagney
2002-08-15 17:02 ` Andrew Cagney
1 sibling, 1 reply; 5+ messages in thread
From: Andrew Cagney @ 2002-08-15 16:44 UTC (permalink / raw)
To: gdb-patches
> 2002-08-10 Andrew Cagney <ac131313@redhat.com>
>
> * gdbarch.sh (PRINT_FLOAT_INFO): Change to a predicate method.
> Add `args' parameter.
> * gdbarch.h, gdbarch.c: Regenerate.
>
> * arm-tdep.c (arm_print_float_info): Add the parameter `args'.
>
> * infcmd.c (float_info): Call print_float_info.
> (print_float_info): New function. By default, print the
> floating-point registers.
>
> * arch-utils.h (default_print_float_info): Delete declaration.
> * arch-utils.c (default_print_float_info): Delete function.
>
I've checked this in.
Andrew
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch/rfc] Provide a default ``info float''
2002-08-15 16:44 ` Andrew Cagney
@ 2002-08-15 17:02 ` Andrew Cagney
0 siblings, 0 replies; 5+ messages in thread
From: Andrew Cagney @ 2002-08-15 17:02 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 635 bytes --]
> 2002-08-10 Andrew Cagney <ac131313@redhat.com>
>
> * gdbarch.sh (PRINT_FLOAT_INFO): Change to a predicate method.
> Add `args' parameter.
> * gdbarch.h, gdbarch.c: Regenerate.
>
> * arm-tdep.c (arm_print_float_info): Add the parameter `args'.
>
> * infcmd.c (float_info): Call print_float_info.
> (print_float_info): New function. By default, print the
> floating-point registers.
>
> * arch-utils.h (default_print_float_info): Delete declaration.
> * arch-utils.c (default_print_float_info): Delete function.
>
> I've checked this in.
Followed quickly by ...
enjoy,
Andrew
[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 1299 bytes --]
2002-08-15 Andrew Cagney <ac131313@redhat.com>
* i387-tdep.h (i387_print_float_info): Add `args' parameter.
* i387-tdep.c (i387_print_float_info): Add `args' parameter.
Index: i387-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i387-tdep.c,v
retrieving revision 1.20
diff -u -r1.20 i387-tdep.c
--- i387-tdep.c 15 Aug 2002 23:06:54 -0000 1.20
+++ i387-tdep.c 16 Aug 2002 00:01:04 -0000
@@ -318,7 +318,7 @@
void
i387_print_float_info (struct gdbarch *gdbarch, struct ui_file *file,
- struct frame_info *frame)
+ struct frame_info *frame, const char *args)
{
unsigned int fctrl;
unsigned int fstat;
Index: i387-tdep.h
===================================================================
RCS file: /cvs/src/src/gdb/i387-tdep.h,v
retrieving revision 1.2
diff -u -r1.2 i387-tdep.h
--- i387-tdep.h 15 Aug 2002 17:36:57 -0000 1.2
+++ i387-tdep.h 16 Aug 2002 00:01:04 -0000
@@ -25,7 +25,8 @@
extern void i387_print_float_info (struct gdbarch *gdbarch,
struct ui_file *file,
- struct frame_info *frame);
+ struct frame_info *frame,
+ const char *args);
/* Fill register REGNUM in GDB's register array with the appropriate
value from *FSAVE. This function masks off any of the reserved
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2002-08-16 0:02 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-10 12:09 [patch/rfc] Provide a default ``info float'' Andrew Cagney
2002-08-12 9:30 ` Kevin Buettner
2002-08-12 11:55 ` Andrew Cagney
2002-08-15 16:44 ` Andrew Cagney
2002-08-15 17:02 ` Andrew Cagney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox