This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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: Request of new __attribute__ for switch statements (elimination of the bounds check)


On Wed, Oct 16, 2002 at 09:23:40AM +0100, Joseph S. Myers wrote:
> On Tue, 15 Oct 2002, Zack Weinberg wrote:
> 
> > (If I had a nickel for every time I've wanted a "step backward"
> > command in gdb...)
> 
> <http://www.uwsg.iu.edu/hypermail/linux/kernel/9901.2/0531.html>:
> 
> #  I have enough information available in the proxy ptrace filter to
> #  implement PTRACE_SINGLESTEP_BACKWARDS. How would you like to have that
> #  capability in gdb? "Execute backwards until this data watchpoint
> #  changes." Imagine a graphical debugger with a scrollbar for time,
> #  where the top is "beginning of execution" and the bottom is "end of
> #  execution."
> 
> (AFAIK there still isn't a useful "step backwards" capability based on
> this technology.)

Well, it can be a bogglingly hard computational problem to do this in
any program which does significant computation. From what I can see
this works by recording the state of the program at system calls and
the effects of system calls on the process.

One downside of using this information for step-backwards would be,
you'd need to replay from the last syscall checkpoint up to the point
you want to step backwards from.  Which would probably involve keeping
a tremendous amount of data (in order to know what memory looked like
at the last checkpoint) and working out the effect of a possibly large
number of instructions since that last syscall point.

Also note that it says it doesn't support signals or shared memory. 
They break the complete-control model that it uses to run replays.  I
suspect it has problems with a lot of recent forms of IPC, too.

I've got to give Michael credit, this is an amazing hack he put
together.  I don't know that it scales in the modern world, though.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


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