From: Nathan Sidwell <nathan@codesourcery.com>
To: msnyder@redhat.com
Cc: gdb-patches@sources.redhat.com
Subject: [patch] Add ms2 support
Date: Thu, 01 Dec 2005 13:41:00 -0000 [thread overview]
Message-ID: <438EFD86.6060306@codesourcery.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 343 bytes --]
This patch adds support for ms2 to gdb. I unfortunately committed a part of
this patch with the warning cleanup. This changelog mentions that piece.
tested on ms2-elf, ok?
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk
[-- Attachment #2: all.diff --]
[-- Type: text/plain, Size: 4724 bytes --]
2005-12-01 Nathan Sidwell <nathan@codesourcery.com>
Add ms2 support.
* ms1-tdep.c (ms1_register_type): Check for ms2.
(ms1_breakpoint_from_pc): ms2 has a different break instruction.
(ms1_pseudo_register_read, ms1_pseudo_register_write,
ms1_registers_info): Add ms2.
Index: ms1-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/ms1-tdep.c,v
retrieving revision 1.2
diff -c -3 -p -r1.2 ms1-tdep.c
*** ms1-tdep.c 1 Dec 2005 13:19:58 -0000 1.2
--- ms1-tdep.c 1 Dec 2005 13:32:47 -0000
*************** ms1_register_type (struct gdbarch *arch,
*** 198,204 ****
case MS1_COPRO_PSEUDOREG_REGNUM:
return copro_type;
case MS1_MAC_PSEUDOREG_REGNUM:
! if (gdbarch_bfd_arch_info (arch)->mach == bfd_mach_mrisc2)
return builtin_type_uint64;
else
return builtin_type_uint32;
--- 198,205 ----
case MS1_COPRO_PSEUDOREG_REGNUM:
return copro_type;
case MS1_MAC_PSEUDOREG_REGNUM:
! if (gdbarch_bfd_arch_info (arch)->mach == bfd_mach_mrisc2
! || gdbarch_bfd_arch_info (arch)->mach == bfd_mach_ms2)
return builtin_type_uint64;
else
return builtin_type_uint32;
*************** ms1_skip_prologue (CORE_ADDR pc)
*** 362,376 ****
/* The breakpoint instruction must be the same size as the smallest
instruction in the instruction set.
! The BP for ms1 is defined as 0x68000000. */
static const gdb_byte *
ms1_breakpoint_from_pc (CORE_ADDR *bp_addr, int *bp_size)
{
! static gdb_byte breakpoint[] = { 0x68, 0, 0, 0 };
*bp_size = 4;
! return breakpoint;
}
/* Fetch the pseudo registers:
--- 363,382 ----
/* The breakpoint instruction must be the same size as the smallest
instruction in the instruction set.
! The BP for ms1 is defined as 0x68000000 (BREAK).
! The BP for ms2 is defined as 0x69000000 (illegal) */
static const gdb_byte *
ms1_breakpoint_from_pc (CORE_ADDR *bp_addr, int *bp_size)
{
! static gdb_byte ms1_breakpoint[] = { 0x68, 0, 0, 0 };
! static gdb_byte ms2_breakpoint[] = { 0x69, 0, 0, 0 };
*bp_size = 4;
! if (gdbarch_bfd_arch_info (current_gdbarch)->mach == bfd_mach_ms2)
! return ms2_breakpoint;
!
! return ms1_breakpoint;
}
/* Fetch the pseudo registers:
*************** ms1_pseudo_register_read (struct gdbarch
*** 394,400 ****
break;
case MS1_MAC_REGNUM:
case MS1_MAC_PSEUDOREG_REGNUM:
! if (gdbarch_bfd_arch_info (gdbarch)->mach == bfd_mach_mrisc2)
{
ULONGEST oldmac = 0, ext_mac = 0;
ULONGEST newmac;
--- 400,407 ----
break;
case MS1_MAC_REGNUM:
case MS1_MAC_PSEUDOREG_REGNUM:
! if (gdbarch_bfd_arch_info (gdbarch)->mach == bfd_mach_mrisc2
! || gdbarch_bfd_arch_info (gdbarch)->mach == bfd_mach_ms2)
{
ULONGEST oldmac = 0, ext_mac = 0;
ULONGEST newmac;
*************** ms1_pseudo_register_write (struct gdbarc
*** 438,444 ****
break;
case MS1_MAC_REGNUM:
case MS1_MAC_PSEUDOREG_REGNUM:
! if (gdbarch_bfd_arch_info (gdbarch)->mach == bfd_mach_mrisc2)
{
/* The 8-byte MAC pseudo-register must be broken down into two
32-byte registers. */
--- 445,452 ----
break;
case MS1_MAC_REGNUM:
case MS1_MAC_PSEUDOREG_REGNUM:
! if (gdbarch_bfd_arch_info (gdbarch)->mach == bfd_mach_mrisc2
! || gdbarch_bfd_arch_info (gdbarch)->mach == bfd_mach_ms2)
{
/* The 8-byte MAC pseudo-register must be broken down into two
32-byte registers. */
*************** ms1_registers_info (struct gdbarch *gdba
*** 549,564 ****
/* Get the two "real" mac registers. */
frame_register_read (frame, MS1_MAC_REGNUM, buf);
! oldmac = extract_unsigned_integer (buf,
! register_size (gdbarch,
! MS1_MAC_REGNUM));
if (gdbarch_bfd_arch_info (gdbarch)->mach == bfd_mach_mrisc2
|| gdbarch_bfd_arch_info (gdbarch)->mach == bfd_mach_ms2)
{
frame_register_read (frame, MS1_EXMAC_REGNUM, buf);
! ext_mac = extract_unsigned_integer (buf,
! register_size (gdbarch,
! MS1_EXMAC_REGNUM));
}
else
ext_mac = 0;
--- 557,570 ----
/* Get the two "real" mac registers. */
frame_register_read (frame, MS1_MAC_REGNUM, buf);
! oldmac = extract_unsigned_integer
! (buf, register_size (gdbarch, MS1_MAC_REGNUM));
if (gdbarch_bfd_arch_info (gdbarch)->mach == bfd_mach_mrisc2
|| gdbarch_bfd_arch_info (gdbarch)->mach == bfd_mach_ms2)
{
frame_register_read (frame, MS1_EXMAC_REGNUM, buf);
! ext_mac = extract_unsigned_integer
! (buf, register_size (gdbarch, MS1_EXMAC_REGNUM));
}
else
ext_mac = 0;
next reply other threads:[~2005-12-01 13:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-01 13:41 Nathan Sidwell [this message]
2005-12-02 8:12 ` Eli Zaretskii
2005-12-02 18:28 ` Kevin Buettner
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=438EFD86.6060306@codesourcery.com \
--to=nathan@codesourcery.com \
--cc=gdb-patches@sources.redhat.com \
--cc=msnyder@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