This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] PPC - Stepping off breakpoints in non-stop mode


On Wed, May 28, 2008 at 09:18:12PM -0300, Luis Machado wrote:
> > > Using unsigned int, char and unsigned long in a tdep file isn't
> > > safe.  Can you switch to gdb_bytes and CORE_ADDR's?  This file
> > > is used for cross-debugging.
> > 
> > Yes, that's true. I'll get this fixed. Thanks!
> 
> Attached the updated patch with the types fixed and some additional
> comments.

Sorry, the problem Pedro spotted is still there :-(

> +  /* Since we use simple_displaced_step_copy_insn, our closure is a
> +     copy of the instruction.  */
> +  ULONGEST *insn  = (ULONGEST *) closure;

For instance, what's at closure is four bytes in target byte order.
It may not be the size of a ULONGEST.  The >> 32 is also a hint; you
can see that won't work well on a 32-bit host.

About the rest I'll just have to trust you; I don't know enough about
PowerPC to be sure you got everything.

> +  /* Check for breakpoints in the inferior.  If we've found one, place the PC
> +     right at the breakpoint instruction.  */
> +  else if ((*insn & BP_MASK) == BP_INSN)
> +    regcache_cooked_write_unsigned (regs, gdbarch_pc_regnum (gdbarch), from);

I'm not sure this is the sensible thing to do in a GDB context but
it's what we do for i386 so it seems fine.

-- 
Daniel Jacobowitz
CodeSourcery


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]