Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jim Blandy <jimb@redhat.com>
To: gdb-patches@sources.redhat.com
Subject: Re: [RFA] New GDB target iq2000
Date: Tue, 01 Mar 2005 22:13:00 -0000	[thread overview]
Message-ID: <vt2ekez584s.fsf@zenia.home> (raw)
In-Reply-To: <20050222114141.GA18314@cygbert.vinschen.de>


Hi, Corinna.

> +/* Function: gdbarch_init
> +   Initializer function for the iq2000 gdbarch vector.
> +   Called by gdbarch.  Sets up the gdbarch vector(s) for this target.  */
> +
> +static struct gdbarch *
> +iq2000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
> +{
> +  struct gdbarch *gdbarch;
> +
> +  /* Look up list for candidates - only one.  */
> +  arches = gdbarch_list_lookup_by_info (arches, &info);
> +  if (arches != NULL)
> +    return arches->gdbarch;
> +
> +  gdbarch = gdbarch_alloc (&info, NULL);
> +
> +  set_gdbarch_num_regs             (gdbarch, E_NUM_REGS);
> +  set_gdbarch_num_pseudo_regs      (gdbarch, 0);
> +  set_gdbarch_sp_regnum            (gdbarch, E_SP_REGNUM);
> +  set_gdbarch_pc_regnum            (gdbarch, E_PC_REGNUM);
> +  set_gdbarch_register_name        (gdbarch, iq2000_register_name);
> +  set_gdbarch_address_to_pointer   (gdbarch, iq2000_address_to_pointer);
> +  set_gdbarch_pointer_to_address   (gdbarch, iq2000_pointer_to_address);
> +  set_gdbarch_ptr_bit              (gdbarch, 4 * TARGET_CHAR_BIT);
> +  set_gdbarch_short_bit            (gdbarch, 2 * TARGET_CHAR_BIT);
> +  set_gdbarch_int_bit              (gdbarch, 4 * TARGET_CHAR_BIT);
> +  set_gdbarch_long_bit             (gdbarch, 4 * TARGET_CHAR_BIT);
> +  set_gdbarch_long_long_bit        (gdbarch, 8 * TARGET_CHAR_BIT);
> +  set_gdbarch_float_bit            (gdbarch, 4 * TARGET_CHAR_BIT);
> +  set_gdbarch_double_bit           (gdbarch, 8 * TARGET_CHAR_BIT);
> +  set_gdbarch_long_double_bit      (gdbarch, 8 * TARGET_CHAR_BIT);
> +  set_gdbarch_float_format         (gdbarch, & floatformat_ieee_single_big);
> +  set_gdbarch_double_format        (gdbarch, & floatformat_ieee_double_big);
> +  set_gdbarch_long_double_format   (gdbarch, & floatformat_ieee_double_big);
> +  set_gdbarch_return_value	   (gdbarch, iq2000_return_value);
> +  set_gdbarch_breakpoint_from_pc   (gdbarch, iq2000_breakpoint_from_pc);
> +  set_gdbarch_frame_args_skip      (gdbarch, 0);
> +  set_gdbarch_skip_prologue        (gdbarch, iq2000_skip_prologue);
> +  set_gdbarch_decr_pc_after_break  (gdbarch, 0);
> +  set_gdbarch_inner_than           (gdbarch, core_addr_lessthan);
> +  set_gdbarch_print_insn           (gdbarch, print_insn_iq2000);
> +  set_gdbarch_register_type (gdbarch, iq2000_register_type);
> +  set_gdbarch_frame_align (gdbarch, iq2000_frame_align);
> +  set_gdbarch_unwind_sp (gdbarch, iq2000_unwind_sp);
> +  set_gdbarch_unwind_pc (gdbarch, iq2000_unwind_pc);
> +  set_gdbarch_unwind_dummy_id (gdbarch, iq2000_unwind_dummy_id);
> +  frame_base_set_default (gdbarch, &iq2000_frame_base);
> +  set_gdbarch_push_dummy_call (gdbarch, iq2000_push_dummy_call);
> +
> +  gdbarch_init_osabi (info, gdbarch);
> +
> +  frame_unwind_append_sniffer (gdbarch, dwarf2_frame_sniffer);
> +  frame_unwind_append_sniffer (gdbarch, iq2000_frame_sniffer);
> +
> +  return gdbarch;
> +}

I think all the calls to set_gdbarch_<type>_bit can be left out,
because they just re-state the default values.  Same for
decr_pc_after_break, no?

+static enum return_value_convention
+iq2000_return_value (struct gdbarch *gdbarch, struct type *type,
+		     struct regcache *regcache,
+		     void *readbuf, const void *writebuf)
+{
+  if (iq2000_use_struct_convention (type))
+    return RETURN_VALUE_STRUCT_CONVENTION;
+  if (writebuf)
+    iq2000_store_return_value (type, regcache, writebuf);
+  else if (readbuf)
+    iq2000_extract_return_value (type, regcache, readbuf);
+  return RETURN_VALUE_REGISTER_CONVENTION;
+}

The other return_value implementations I've seen allow one to pass
both a readbuf and a writebuf, and do the read before the write.  I
can't find any place where it's actually used this way, but it seems
to be allowed by the interface.  In any case, it's easy enough to make
iq2000_return_value behave like the others.


  reply	other threads:[~2005-03-01 22:13 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-22 16:35 Corinna Vinschen
2005-03-01 22:13 ` Jim Blandy [this message]
2005-03-01 22:19   ` Daniel Jacobowitz
2005-03-02  9:08   ` Corinna Vinschen
2005-03-03 17:34 ` Daniel Jacobowitz
2005-03-03 17:46   ` Kevin Buettner
2005-03-03 17:51     ` Daniel Jacobowitz
2005-03-03 19:17       ` Kevin Buettner
2005-03-04  9:46   ` Corinna Vinschen
2005-03-04 14:14     ` Daniel Jacobowitz
2005-03-04 15:01       ` Corinna Vinschen
2005-03-04 15:06         ` Daniel Jacobowitz
2005-03-04 15:51           ` Corinna Vinschen
2005-03-04 16:01             ` Daniel Jacobowitz
2005-03-04 22:01         ` Daniel Jacobowitz
2005-03-05 11:29           ` Mark Kettenis
2005-03-05 16:44             ` Daniel Jacobowitz
2005-03-05 18:13               ` Mark Kettenis
2005-03-05 19:37                 ` Daniel Jacobowitz
2005-03-05 20:18                   ` Mark Kettenis
2005-03-05 20:20                     ` Daniel Jacobowitz
2005-03-07 10:08                       ` Corinna Vinschen
2005-03-07 14:05                         ` Daniel Jacobowitz
2005-03-07 20:17                           ` Corinna Vinschen
2005-03-07 20:37                             ` Daniel Jacobowitz
2005-03-08  9:00                               ` Corinna Vinschen
2005-03-08 13:32                                 ` Daniel Jacobowitz
2005-03-07 21:32                   ` Daniel Jacobowitz
2005-03-07 21:35 ` Daniel Jacobowitz
2005-03-08  9:00   ` Corinna Vinschen

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=vt2ekez584s.fsf@zenia.home \
    --to=jimb@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    /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