This is the mail archive of the frysk@sources.redhat.com mailing list for the frysk 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: First try of breakpoint support


Hi Wu Zhou,

On Thu, 2006-08-17 at 11:43 +0800, Wu Zhou wrote:
> And because the opcode of TRAP is ISA dependent. Our point is that it is 
> better to declare it as a memeber of ISA class, and its subclass 
> (IsaIA32, IsaEM64T, IsaPPC64...) can inherit and overwrite it in the 
> time of initialization. In the time of creating a breakpoint, 
> Breakpoint.java can get the ISA depedent TRAP instruction and its length 
> at the same time.

That seems like a good thing. We should move it into the ISA.

I forgot to mention one other architecture dependent thing. In TaskState
when we get the breakpoint trap instruction on x86 and x86_64 we do the
following:

        // FIXME This might not hold for all architectures.
        // Should probably be handled by the Isa.
        long address;
        try
          {
            address = task.getIsa().pc(task) - 1;
          }
        catch (TaskException tte)

Because the trap is reported with the process counter already advanced.
On other architectures this might not be the case and the address as
reported is actually the breakpoint address itself. This should either
be moved into the Isa, or we might want to consider to do the adjusting
of the pc on a trap instruction inside sys/Wait.

> > Interesting ideas. I had assumed there was already a way to do that. But
> > it seems even gdb uses hardware registers. I don't know if that is
> > because nobody ever implemented watchpoints by page-faulting, or that
> > page-faulting is just too inefficient (you could get a lot of false
> > traps if the page is large).
> >   
> Really?  in what way can we do that? I am very happy to be educated.
> In the aspect of efficiency, page-faulting is obviously weaker than 
> hardware watchpoint, but much more efficient than single step simulated 
> ones. To consider what if there is no hardware support or available 
> hardware resource are used up. 

I also don't know too much about this. So I was just wondering why gdb
doesn't use this technique. Elena tells me there is actually a fork of
gdb (called wildebeest) that does use page-faulting. But I haven't found
or studied that fork yet.

Cheers,

Mark

Attachment: signature.asc
Description: This is a digitally signed message part


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