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: [RFC/RFA] continue stepping if landed in new range of same line


On Wed, Dec 19, 2007 at 11:59:03AM +0400, Joel Brobecker wrote:
> After the jump, the inferior stops and GDB finds that we stepped
> inside the last line of our function, and decides that we should
> stop:
> 
>   if (ecs->stop_func_end && ecs->sal.end >= ecs->stop_func_end)
>     {
>       /* If this is the last line of the function, don't keep stepping
>          (it would probably step us out of the function).
>          This is particularly necessary for a one-line function,
>          in which after skipping the prologue we better stop even though
>          we will be in mid-line.  */
> 
> This code predates the public CVS so I wasn't able to find much
> besides the comment. After reading this comment, I am no longer
> sure of what to do.
> 
> The behavior that I observed is a bit surprising, and I am not sure that
> the comment above meant to include a case like mine. However, can we
> still maintain support for one-line functions, and yet handle the case
> above? After thinking about it for a while, I think it's possible, but
> it requires a bit a processing.

I don't like your patch very much, since it assumes things about code
based on the structure of the source (and there are some pathological
cases, like functions which start in one file and end in another).
I'd rather figure out if the above quoted code is still necessary.  If
we were on the last line of the function and told to step, why
shouldn't we step out of it?


-- 
Daniel Jacobowitz
CodeSourcery


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