This is the mail archive of the gdb-patches@sources.redhat.com 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]

Re: [RFA]: infrun.c/proceed change


Michael Snyder wrote:
> 
> Oops, I sent this as a PATCH, when what I really want is approval.
> Validation, actually...
> 
> This looks reasonable to me, but being as it's infrun,
> I thought I'd be paranoid and get other people's opinions.
> Comments tell the story...

Should it be (from some bits of infcmd.c):

          frame = get_current_frame ();
          if (!frame)           /* Avoid coredump here.  Why tho? */
            error ("No current frame");
          step_frame_address = FRAME_FP (frame);
          step_sp = read_sp ();

It looks harmless enough although I'm not sure what situtation was
encountered to prompt the change?


If you're going to do this, why not just change it to:

	if (oneproc || step)
	   step_frame... = ...;
	   step_sp = ...;

with step_frame... and step_sp local to infrun.c.  Looking through:

	grep 'proceed *(' *.c

all cases if proceed(step=1) appear to be in infcmd.c and they are all
proceeded by code saving fp/sp so can also be moved.

	Andrew


> ***************
> *** 1041,1049 ****
>   #endif /* HP_OS_BUG */
> 
>     if (oneproc)
> !     /* We will get a trace trap after one instruction.
> !        Continue it automatically and insert breakpoints then.  */
> !     trap_expected = 1;
>     else
>       {
>         int temp = insert_breakpoints ();
> --- 1041,1059 ----
>   #endif /* HP_OS_BUG */
> 
>     if (oneproc)
> !     {
> !       /* We will get a trace trap after one instruction.
> !        Continue it automatically and insert breakpoints then.  */
> !       trap_expected = 1;
> !
> !       /* Oh, and if we weren't explicitly told to single-step, our
> !          caller may not have updated "step_sp", so do it ourselves. */
> !       if (!step)
> !       {
> !         step_frame_address = FRAME_FP (get_current_frame ());
> !         step_sp = read_sp ();
> !       }
> !     }
>     else
>       {
>         int temp = insert_breakpoints ();

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