You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/*
Contributed by Steve Chamberlain
#include "frame.h"
#include "obstack.h"
#include "symtab.h"
-#include <dis-asm.h>
+#include "dis-asm.h"
#include "gdbcmd.h"
#include "gdbtypes.h"
}
int
-print_insn (memaddr, stream)
- CORE_ADDR memaddr;
- FILE *stream;
+gdb_print_insn_h8300 (memaddr, info)
+ bfd_vma memaddr;
+ disassemble_info *info;
{
- disassemble_info info;
- GDB_INIT_DISASSEMBLE_INFO(info, stream);
if (h8300hmode)
- return print_insn_h8300h (memaddr, &info);
+ return print_insn_h8300h (memaddr, info);
else
- return print_insn_h8300 (memaddr, &info);
+ return print_insn_h8300 (memaddr, info);
}
/* Given a GDB frame, determine the address of the calling function's frame.
For us, the frame address is its stack pointer value, so we look up
the function prologue to determine the caller's sp value, and return it. */
-FRAME_ADDR
-FRAME_CHAIN (thisframe)
- FRAME thisframe;
+CORE_ADDR
+h8300_frame_chain (thisframe)
+ struct frame_info *thisframe;
{
frame_find_saved_regs (thisframe, (struct frame_saved_regs *) 0);
return thisframe->fsr->regs[SP_REGNUM];
examine_prologue (ip, limit, after_prolog_fp, fsr, fi)
register CORE_ADDR ip;
register CORE_ADDR limit;
- FRAME_ADDR after_prolog_fp;
+ CORE_ADDR after_prolog_fp;
struct frame_saved_regs *fsr;
struct frame_info *fi;
{
CORE_ADDR
frame_saved_pc (frame)
- FRAME frame;
+ struct frame_info *frame;
{
return frame->from_pc;
}
{
unsigned regnum;
struct frame_saved_regs fsr;
- struct frame_info *fi;
-
- FRAME frame = get_current_frame ();
+ struct frame_info *frame = get_current_frame ();
- fi = get_frame_info (frame);
- get_frame_saved_regs (fi, &fsr);
+ get_frame_saved_regs (frame, &fsr);
for (regnum = 0; regnum < 8; regnum++)
{
if (fsr.regs[regnum])
- {
- write_register (regnum, read_memory_integer(fsr.regs[regnum]), BINWORD);
- }
+ write_register (regnum, read_memory_integer(fsr.regs[regnum]), BINWORD);
flush_cached_frames ();
- set_current_frame (create_new_frame (read_register (FP_REGNUM),
- read_pc ()));
}
}
char *args;
int from_tty;
{
- printf ("\"set machine\" must be followed by h8300 or h8300h.\n");
- help_list (setmemorylist, "set memory ", -1, stdout);
+ printf_unfiltered ("\"set machine\" must be followed by h8300 or h8300h.\n");
+ help_list (setmemorylist, "set memory ", -1, gdb_stdout);
}
void
if (regno == 8)
{
/* CCR register */
-
int C, Z, N, V;
- unsigned char b[2];
+ unsigned char b[4];
unsigned char l;
-
read_relative_register_raw_bytes (regno, b);
- l = b[1];
- printf ("\t");
- printf ("I-%d - ", (l & 0x80) != 0);
- printf ("H-%d - ", (l & 0x20) != 0);
+ l = b[REGISTER_VIRTUAL_SIZE(8) -1];
+ printf_unfiltered ("\t");
+ printf_unfiltered ("I-%d - ", (l & 0x80) != 0);
+ printf_unfiltered ("H-%d - ", (l & 0x20) != 0);
N = (l & 0x8) != 0;
Z = (l & 0x4) != 0;
V = (l & 0x2) != 0;
C = (l & 0x1) != 0;
- printf ("N-%d ", N);
- printf ("Z-%d ", Z);
- printf ("V-%d ", V);
- printf ("C-%d ", C);
+ printf_unfiltered ("N-%d ", N);
+ printf_unfiltered ("Z-%d ", Z);
+ printf_unfiltered ("V-%d ", V);
+ printf_unfiltered ("C-%d ", C);
if ((C | Z) == 0)
- printf ("u> ");
+ printf_unfiltered ("u> ");
if ((C | Z) == 1)
- printf ("u<= ");
+ printf_unfiltered ("u<= ");
if ((C == 0))
- printf ("u>= ");
+ printf_unfiltered ("u>= ");
if (C == 1)
- printf ("u< ");
+ printf_unfiltered ("u< ");
if (Z == 0)
- printf ("!= ");
+ printf_unfiltered ("!= ");
if (Z == 1)
- printf ("== ");
+ printf_unfiltered ("== ");
if ((N ^ V) == 0)
- printf (">= ");
+ printf_unfiltered (">= ");
if ((N ^ V) == 1)
- printf ("< ");
+ printf_unfiltered ("< ");
if ((Z | (N ^ V)) == 0)
- printf ("> ");
+ printf_unfiltered ("> ");
if ((Z | (N ^ V)) == 1)
- printf ("<= ");
+ printf_unfiltered ("<= ");
}
}
-/* This doesn't quite fit either in the simulator or in gdb proper.
- Perhaps the simulator could return 1 to mean it loaded it and 0 to
- mean "you deal with it, caller". */
-
-int
-sim_load (abfd, prog)
-bfd *abfd;
-char *prog;
+void
+_initialize_h8300_tdep ()
{
- return sim_load_standard (abfd);
+ tm_print_insn = gdb_print_insn_h8300;
}