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]
Other format: [Raw text]

Re: [patch rfc] PUSH_ARGUMENTS() -> push_dummy_call()


On Mon, Mar 24, 2003 at 12:04:05PM -0500, Andrew Cagney wrote:
> >While you're rearranging this code,
> 
> Think of it as `shuffling deck chairs'.  It is still the same Titanic.
> 
> >  I'd like your thoughts on
> >something.  I was working on an old project last week - "catch catch"
> >and "catch throw".  A basic implementation is easy.  A more interesting
> >implementation, however, requires being able to extract the arguments
> >to __cxa_throw (one of the arguments is the object being thrown,
> >another is the typeinfo for it).
> 
> Have a look at objc-lang.c:FETCH_ARGUMENTS().  I suspect it should be 
> called FETCH_POINTER_ARGUMENT(frame, i).

Egads, that's disgusting.

> >This requires being able to figure out where a function which takes two
> >pointers expects them to be.  __cxa_throw will generally not have any
> >debug info.  This logic already exists in the push argument code.
> 
> While that method contains the relevant logic, I don't think it is 
> easily accessible.

You're probably right.

> >Is it too much overhead/PITA to restructure it so that we can use that
> >information?  If so I'll probably need to add a new architecture method
> >to get ths sort of information.
> 
> It is definitly beyond the scope of these cleanups.  The interface is 
> going to be sufficiently different to need a new architecture method anyway.
> 
> Would a FETCH_POINTER_ARGUMENT() method be sufficient for your immediate 
> needs?

Yes!  Thanks for the pointer.  I'll put together a patch to move it
into the architecture vector, for those architectures where it has a
clear implementation.  And try to write up some mostly-accurate
documentation for what it does...

Basically, it should work as long as the previous N arguments were all
pointers, and for reasonably small values of N (objc-lang never goes
above N == 2 I think).

-- 
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]