This is the mail archive of the
mailing list for the GDB project.
Re: [PATCH] PPC - Stepping off breakpoints in non-stop mode
- From: Daniel Jacobowitz <drow at false dot org>
- To: Luis Machado <luisgpm at linux dot vnet dot ibm dot com>
- Cc: Pedro Alves <pedro at codesourcery dot com>, gdb-patches at sourceware dot org
- Date: Thu, 5 Jun 2008 16:02:49 -0400
- Subject: Re: [PATCH] PPC - Stepping off breakpoints in non-stop mode
- References: <1209753019.7131.29.camel@gargoyle> <email@example.com> <1211203623.6232.2.camel@gargoyle> <1212020293.15367.63.camel@gargoyle>
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
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.