Re: Powerpc and software single step

Daniel Jacobowitz
2003-08-19T19:13:02Z

On Tue, Aug 19, 2003 at 10:55:13AM -0700, Kevin Buettner wrote:
> On Aug 12, 6:31pm, Jimi Xenidis wrote:
>
> > The AIX kernel does not support single step but the Linux kernel does.
> >
> > However, I am working with a remote machine level debugger for PowerPC
> > that allows me to debug a running Linux kernel and cannot support
> > single stepping. For this I require that when debugging a Linux
> > target I need to turn on SOFTWARE_SINGLE_STEP.
> >
> > I would like to add this to an "obscure" setting that will turn it on
> > even under Linux.
> > Here is the patch.. please accept, feel free to mangle the symbol
> > names to taste.
>
> The patch looks mostly okay to me. I do have some comments and questions
> though...
>
> 1) It is customary to provide ChangeLog entries with patch submissions.
>
> 2) Why is ``ppc_linux_single_step_mode'' an extern in tm-linux.h? I
> would really prefer that it be local to ppc-linux-tdep.c. If
> there's some compelling reason for it to not be local, then we can
> discuss adding it to ppc-tdep.h.

Could we do this slightly differently? SOFTWARE_SINGLE_STEP_P is used
in two non-platform-specific files: infptrace.c for a sanity check, and
infrun.c. In infrun, the only line which matters for this case is in
resume:
if (SOFTWARE_SINGLE_STEP_P () && step)

Why not add a hook to check there which lets the user use software
single step? It'll require playing with the target macros; we'd need
something like:
SOFTWARE_SINGLE_STEP - perform software single step
SOFTWARE_SINGLE_STEP_P - SOFTWARE_SINGLE_STEP available
SOFTWARE_SINGLE_STEP_ONLY_P - no hardware singlestep available
(check that in infptrace instead of SOFTWARE_SINGLE_STEP_P?)

I've wanted to flip back and forth at runtime before.

--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer