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,ARM] Fix single step on vfork


On Wednesday 01 September 2010 17:56:32, Yao Qi wrote:
> 
> +  /* Don't consider single-stepping when the inferior is 
> +     waiting_for_vfork_done, either software or hardware step.  In
> +     software step, child process will hit the software single step
> +     breakpoint inserted in parent process.  In hardware step, GDB
> +     can resumes inferior, and waiting for vfork_done event.  */

This last sentence looks incomplete?  At least, I can't seem to
parse it.

> +  if (current_inferior()->waiting_for_vfork_done)

Space before parens.

> +    {
> +      if (debug_infrun)
> +       fprintf_unfiltered (gdb_stdlog,
> +                           "infrun: resume : clear step\n");
> +      step = 0;
> +    }
> +
>    if (debug_infrun)
>      fprintf_unfiltered (gdb_stdlog,
>                          "infrun: resume (step=%d, signal=%d), "
> @@ -1577,11 +1590,16 @@ a command like `return' or `jump' to continue execution."));
>       We can't use displaced stepping when we have a signal to deliver;
>       the comments for displaced_step_prepare explain why.  The
>       comments in the handle_inferior event for dealing with 'random
> -     signals' explain what we do instead.  */
> +     signals' explain what we do instead.
> +
> +     We can't use displaced stepping when we are waiting for vfork_done
> +     event, displaced stepping breaks the vfork child similarly as single
> +     step software breakpoint.  */
>    if (use_displaced_stepping (gdbarch)
>        && (tp->trap_expected
>           || (step && gdbarch_software_single_step_p (gdbarch)))
> -      && sig == TARGET_SIGNAL_0)
> +      && sig == TARGET_SIGNAL_0
> +      && !current_inferior()->waiting_for_vfork_done)

Space before parens.

Otherwise okay.  Thanks!

-- 
Pedro Alves


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