This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] Improvements for sh double register display
- From: Michael Snyder <msnyder at redhat dot com>
- To: Elena Zannoni <ezannoni at redhat dot com>
- Cc: gdb-patches at sources dot redhat dot com, ezannoni<ezannoni at sources dot redhat dot com>, "vinschen >> Corinna Vinschen"<vinschen at redhat dot com>
- Date: Tue, 15 Jul 2003 15:33:57 -0700
- Subject: Re: [RFA] Improvements for sh double register display
- Organization: Red Hat, Inc.
- References: <3F031E03.3040206@redhat.com> <16148.21516.843971.449438@localhost.redhat.com>
Elena Zannoni wrote:
Michael Snyder writes:
> 2003-07-02 Michael Snyder <msnyder@redhat.com>
>
> * sh-tdep.c (do_dr_register_info): Fix register number output
> (0, 2, 4, ... not 0, 1, 2...). Display DP register both in
> hex and in floating point (noting when it is not valid FP).
>
> Index: sh-tdep.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/sh-tdep.c,v
> retrieving revision 1.132
> diff -p -r1.132 sh-tdep.c
> *** sh-tdep.c 13 Jun 2003 04:40:34 -0000 1.132
> --- sh-tdep.c 2 Jul 2003 18:00:22 -0000
> *************** static void
> *** 3928,3938 ****
> do_dr_register_info (int dr_regnum)
> {
> int first_fp_reg_num = dr_reg_base_num (dr_regnum);
>
> ! printf_filtered ("dr%d\t0x%08x%08x\n",
> ! dr_regnum - gdbarch_tdep (current_gdbarch)->DR0_REGNUM,
> ! (int) read_register (first_fp_reg_num),
> ! (int) read_register (first_fp_reg_num + 1));
> }
>
> /* Double precision registers, compact mode. */
> --- 3928,3962 ----
> do_dr_register_info (int dr_regnum)
> {
> int first_fp_reg_num = dr_reg_base_num (dr_regnum);
> + char *raw_buffer;
> + double dbl;
> + int inv;
>
> ! /* Allocate space for the float. */
> ! raw_buffer = (char *) alloca (2 * REGISTER_RAW_SIZE (FP0_REGNUM));
Can you use something other than alloca here? Also, this will collide
in mid air with Corinna's revamp. Maybe you can revisit this after she
is done? Otherwise it's ok.
OK, I'll touch space-helmets with Corinna.
BTW, what's wrong with alloca?