aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorStu Grossman <grossman@cygnus>1994-08-24 00:27:38 +0000
committerStu Grossman <grossman@cygnus>1994-08-24 00:27:38 +0000
commit8edf00160b485e912a95e5bb221fe121b28319f9 (patch)
treeb2b8b5e0a6e58ecade3c74a7f4e298a709536c51 /gdb
parente44075d3aaf417c6622fc67e82ac0eb5b82c86a0 (diff)
downloadgdb-8edf00160b485e912a95e5bb221fe121b28319f9.zip
gdb-8edf00160b485e912a95e5bb221fe121b28319f9.tar.gz
gdb-8edf00160b485e912a95e5bb221fe121b28319f9.tar.bz2
* nlm/ppc.c (set_step_traps clear_step_traps): Cleanups.
* nlm/gdbserve.def: Autoload clib.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/nlm/gdbserve.def1
-rw-r--r--gdb/nlm/ppc.c40
3 files changed, 28 insertions, 20 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 11c0c54..4f32937 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,12 @@
+Tue Aug 23 16:54:16 1994 Stu Grossman (grossman@cygnus.com)
+
+ * nlm/ppc.c (set_step_traps clear_step_traps): Cleanups.
+ * nlm/gdbserve.def: Autoload clib.
+
Tue Aug 23 12:05:19 1994 Jim Kingdon (kingdon@cygnus.com)
+ * breakpoint.c (condition_command): Call breakpoints_changed.
+
* gdbtypes.h: Declare f77_create_literal_string_type and
f77_create_literal_complex_type.
* valops.c (f77_value_literal_string, f77_value_substring,
diff --git a/gdb/nlm/gdbserve.def b/gdb/nlm/gdbserve.def
index a4e7f9d..dceb56a 100644
--- a/gdb/nlm/gdbserve.def
+++ b/gdb/nlm/gdbserve.def
@@ -1,6 +1,7 @@
description "GDB debugger stub"
version 1,2,0
#debug
+module clib
screenname "System Console"
input gdbserve.O
output gdbserve.nlm
diff --git a/gdb/nlm/ppc.c b/gdb/nlm/ppc.c
index a683d69..d869e01 100644
--- a/gdb/nlm/ppc.c
+++ b/gdb/nlm/ppc.c
@@ -134,64 +134,62 @@ union inst
};
static LONG saved_inst;
-static char *saved_inst_pc = 0;
+static LONG *saved_inst_pc = 0;
static LONG saved_target_inst;
-static char *saved_target_inst_pc = 0;
+static LONG *saved_target_inst_pc = 0;
void
set_step_traps (frame)
struct StackFrame *frame;
{
union inst inst;
- char *target;
+ LONG *target;
int opcode;
int ra, rb;
- char *pc = (char *)frame->ExceptionPC;
+ LONG *pc = (LONG *)frame->ExceptionPC;
- inst.l = *(LONG *)pc;
+ inst.l = *pc++;
opcode = inst.inst.variant.b.opcode;
+ target = pc;
+
switch (opcode)
{
case 18: /* Unconditional branch */
- target = (char *)(inst.inst.variant.b.li << 2);
- if (!inst.inst.variant.b.aa) /* Relative? */
- target += (long)pc;
+ if (inst.inst.variant.b.aa) /* Absolute? */
+ target = 0;
+ target += inst.inst.variant.b.li;
break;
case 16: /* Conditional branch */
- target = (char *)(inst.inst.variant.bc.bd << 2);
- if (!inst.inst.variant.bc.aa) /* Relative? */
- target += (long)pc;
+ if (!inst.inst.variant.bc.aa) /* Absolute? */
+ target = 0;
+ target += inst.inst.variant.bc.bd;
break;
case 19: /* Cond. branch via ctr or lr reg */
switch (inst.inst.variant.bclr.type)
{
case 528: /* ctr */
- target = (char *)frame->ExceptionState.u.SpecialRegistersEnumerated.CsavedCTR;
+ target = (LONG *)frame->ExceptionState.u.SpecialRegistersEnumerated.CsavedCTR;
break;
case 16: /* lr */
- target = (char *)frame->ExceptionState.u.SpecialRegistersEnumerated.CsavedLR;
+ target = (LONG *)frame->ExceptionState.u.SpecialRegistersEnumerated.CsavedLR;
break;
- default:
- target = pc;
}
break;
- default:
- target = pc;
}
- saved_inst = *(LONG *)pc;
+ saved_inst = *pc;
mem_write (pc, breakpoint_insn, BREAKPOINT_SIZE);
saved_inst_pc = pc;
if (target != pc)
{
- saved_target_inst = *(LONG *)target;
+ saved_target_inst = *target;
mem_write (target, breakpoint_insn, BREAKPOINT_SIZE);
saved_target_inst_pc = target;
}
@@ -206,7 +204,7 @@ clear_step_traps (frame)
struct StackFrame *frame;
{
int retcode;
- char *pc = (char *)frame->ExceptionPC;
+ LONG *pc = (LONG *)frame->ExceptionPC;
if (saved_inst_pc == pc || saved_target_inst_pc == pc)
retcode = 1;
@@ -255,6 +253,7 @@ do_status (ptr, frame)
*ptr = '\000';
}
+#if 0
/*
* strtol : convert a string to long.
*
@@ -404,6 +403,7 @@ strtoul(s, ptr, base)
*ptr = (char *) ((did_conversion) ? (char *)s : (char *)start);
return negate ? -total : total;
}
+#endif
void _exit (int foo) __attribute__ ((noreturn));