Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: deuling@de.ibm.com (Markus Deuling)
Cc: gdb-patches@sourceware.org (GDB Patches)
Subject: Re: [rfc]: Replace current_gdbarch in hppa
Date: Fri, 15 Feb 2008 18:39:00 -0000	[thread overview]
Message-ID: <200802151838.m1FIcnFC028614@d12av02.megacenter.de.ibm.com> (raw)
In-Reply-To: <47B5354A.4090404@de.ibm.com> from "Markus Deuling" at Feb 15, 2008 07:46:34 AM

Markus Deuling wrote:

>     * hppa-tdep.h (find_global_pointer): Add gdbarch as parameter.
> 
>     * hppa-hpux-tdep.c (hppa32_hpux_find_global_pointer): Likewise. Replace
>     current_gdbarch by gdbarch.
>     (hppa64_hpux_find_global_pointer): Likewise.
>     * hppa-tdep.c (hppa_find_global_pointer): Likewise.
>     (hppa32_push_dummy_call, hppa64_push_dummy_call): Update call for
>     find_global_pointer.
> 
>     * hppabsd-tdep.c (hppabsd_find_global_pointer): Add gdbarch as
>     parameter.
>     * hppa-linux-tdep.c (hppa_linux_find_global_pointer): Likewise.
> 
>     * hppa-linux-nat.c (hppa_linux_register_addr): Add gdbarch as parameter.
>     (fetch_register, store_register): Update call for
>     hppa_linux_register_addr.
> 
>     * hppa-hpux-tdep.c (hppa_hpux_sr_for_addr): Add gdbarch as parameter and
>     replace current_gdbarch by gdbarch.    
>     (hppa_hpux_push_dummy_code): Update call for hppa_hpux_sr_for_addr.

Most of these are OK, except:


> diff -urpN src/gdb/hppa-linux-nat.c dev/gdb/hppa-linux-nat.c
> --- src/gdb/hppa-linux-nat.c	2008-01-01 23:53:10.000000000 +0100
> +++ dev/gdb/hppa-linux-nat.c	2008-02-15 06:52:13.000000000 +0100
> @@ -149,11 +149,12 @@ static const int u_offsets[] =
>    };
>  
>  static CORE_ADDR
> -hppa_linux_register_addr (int regno, CORE_ADDR blockend)
> +hppa_linux_register_addr (struct gdbarch *gdbarch, int regno,
> +			  CORE_ADDR blockend)
>  {
>    CORE_ADDR addr;
>  
> -  if ((unsigned) regno >= gdbarch_num_regs (current_gdbarch))
> +  if ((unsigned) regno >= gdbarch_num_regs (gdbarch))
>      error (_("Invalid register number %d."), regno);
>  
>    if (u_offsets[regno] == -1)

This is really the wrong check.  It should really just verify that
no out-of-bounds access to u_offsets happens, so the line should 
just be something like:

   if ((unsigned) regno >= ARRAY_SIZE (u_offsets))


Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


  reply	other threads:[~2008-02-15 18:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-15  6:48 Markus Deuling
2008-02-15 18:39 ` Ulrich Weigand [this message]
2008-02-15 20:19   ` Pedro Alves
2008-02-15 20:22     ` Daniel Jacobowitz
2008-02-18 14:28   ` Markus Deuling
2008-02-18 14:37     ` Ulrich Weigand
2008-02-18 14:47       ` Markus Deuling
2008-02-18 16:04         ` Ulrich Weigand
2008-02-18 16:12           ` Markus Deuling

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200802151838.m1FIcnFC028614@d12av02.megacenter.de.ibm.com \
    --to=uweigand@de.ibm.com \
    --cc=deuling@de.ibm.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox