mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-23 19:50:13 +08:00
* nlm/ppc.c (set_step_traps clear_step_traps): Cleanups.
* nlm/gdbserve.def: Autoload clib.
This commit is contained in:
@ -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)
|
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
|
* gdbtypes.h: Declare f77_create_literal_string_type and
|
||||||
f77_create_literal_complex_type.
|
f77_create_literal_complex_type.
|
||||||
* valops.c (f77_value_literal_string, f77_value_substring,
|
* valops.c (f77_value_literal_string, f77_value_substring,
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
description "GDB debugger stub"
|
description "GDB debugger stub"
|
||||||
version 1,2,0
|
version 1,2,0
|
||||||
#debug
|
#debug
|
||||||
|
module clib
|
||||||
screenname "System Console"
|
screenname "System Console"
|
||||||
input gdbserve.O
|
input gdbserve.O
|
||||||
output gdbserve.nlm
|
output gdbserve.nlm
|
||||||
|
@ -134,64 +134,62 @@ union inst
|
|||||||
};
|
};
|
||||||
|
|
||||||
static LONG saved_inst;
|
static LONG saved_inst;
|
||||||
static char *saved_inst_pc = 0;
|
static LONG *saved_inst_pc = 0;
|
||||||
static LONG saved_target_inst;
|
static LONG saved_target_inst;
|
||||||
static char *saved_target_inst_pc = 0;
|
static LONG *saved_target_inst_pc = 0;
|
||||||
|
|
||||||
void
|
void
|
||||||
set_step_traps (frame)
|
set_step_traps (frame)
|
||||||
struct StackFrame *frame;
|
struct StackFrame *frame;
|
||||||
{
|
{
|
||||||
union inst inst;
|
union inst inst;
|
||||||
char *target;
|
LONG *target;
|
||||||
int opcode;
|
int opcode;
|
||||||
int ra, rb;
|
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;
|
opcode = inst.inst.variant.b.opcode;
|
||||||
|
|
||||||
|
target = pc;
|
||||||
|
|
||||||
switch (opcode)
|
switch (opcode)
|
||||||
{
|
{
|
||||||
case 18: /* Unconditional branch */
|
case 18: /* Unconditional branch */
|
||||||
target = (char *)(inst.inst.variant.b.li << 2);
|
|
||||||
|
|
||||||
if (!inst.inst.variant.b.aa) /* Relative? */
|
if (inst.inst.variant.b.aa) /* Absolute? */
|
||||||
target += (long)pc;
|
target = 0;
|
||||||
|
target += inst.inst.variant.b.li;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 16: /* Conditional branch */
|
case 16: /* Conditional branch */
|
||||||
target = (char *)(inst.inst.variant.bc.bd << 2);
|
|
||||||
|
|
||||||
if (!inst.inst.variant.bc.aa) /* Relative? */
|
if (!inst.inst.variant.bc.aa) /* Absolute? */
|
||||||
target += (long)pc;
|
target = 0;
|
||||||
|
target += inst.inst.variant.bc.bd;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 19: /* Cond. branch via ctr or lr reg */
|
case 19: /* Cond. branch via ctr or lr reg */
|
||||||
switch (inst.inst.variant.bclr.type)
|
switch (inst.inst.variant.bclr.type)
|
||||||
{
|
{
|
||||||
case 528: /* ctr */
|
case 528: /* ctr */
|
||||||
target = (char *)frame->ExceptionState.u.SpecialRegistersEnumerated.CsavedCTR;
|
target = (LONG *)frame->ExceptionState.u.SpecialRegistersEnumerated.CsavedCTR;
|
||||||
break;
|
break;
|
||||||
case 16: /* lr */
|
case 16: /* lr */
|
||||||
target = (char *)frame->ExceptionState.u.SpecialRegistersEnumerated.CsavedLR;
|
target = (LONG *)frame->ExceptionState.u.SpecialRegistersEnumerated.CsavedLR;
|
||||||
break;
|
break;
|
||||||
default:
|
|
||||||
target = pc;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
|
||||||
target = pc;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
saved_inst = *(LONG *)pc;
|
saved_inst = *pc;
|
||||||
mem_write (pc, breakpoint_insn, BREAKPOINT_SIZE);
|
mem_write (pc, breakpoint_insn, BREAKPOINT_SIZE);
|
||||||
saved_inst_pc = pc;
|
saved_inst_pc = pc;
|
||||||
|
|
||||||
if (target != pc)
|
if (target != pc)
|
||||||
{
|
{
|
||||||
saved_target_inst = *(LONG *)target;
|
saved_target_inst = *target;
|
||||||
mem_write (target, breakpoint_insn, BREAKPOINT_SIZE);
|
mem_write (target, breakpoint_insn, BREAKPOINT_SIZE);
|
||||||
saved_target_inst_pc = target;
|
saved_target_inst_pc = target;
|
||||||
}
|
}
|
||||||
@ -206,7 +204,7 @@ clear_step_traps (frame)
|
|||||||
struct StackFrame *frame;
|
struct StackFrame *frame;
|
||||||
{
|
{
|
||||||
int retcode;
|
int retcode;
|
||||||
char *pc = (char *)frame->ExceptionPC;
|
LONG *pc = (LONG *)frame->ExceptionPC;
|
||||||
|
|
||||||
if (saved_inst_pc == pc || saved_target_inst_pc == pc)
|
if (saved_inst_pc == pc || saved_target_inst_pc == pc)
|
||||||
retcode = 1;
|
retcode = 1;
|
||||||
@ -255,6 +253,7 @@ do_status (ptr, frame)
|
|||||||
*ptr = '\000';
|
*ptr = '\000';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
/*
|
/*
|
||||||
* strtol : convert a string to long.
|
* strtol : convert a string to long.
|
||||||
*
|
*
|
||||||
@ -404,6 +403,7 @@ strtoul(s, ptr, base)
|
|||||||
*ptr = (char *) ((did_conversion) ? (char *)s : (char *)start);
|
*ptr = (char *) ((did_conversion) ? (char *)s : (char *)start);
|
||||||
return negate ? -total : total;
|
return negate ? -total : total;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void _exit (int foo) __attribute__ ((noreturn));
|
void _exit (int foo) __attribute__ ((noreturn));
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user