* Re: objc-lang.c portability (Was Re: [PATCH] Step over Objective-C dispatch function)
2003-03-26 23:31 ` objc-lang.c portability (Was Re: [PATCH] Step over Objective-C dispatch function) Adam Fedor
@ 2003-03-26 23:35 ` Daniel Jacobowitz
2003-03-27 15:53 ` Andrew Cagney
1 sibling, 0 replies; 3+ messages in thread
From: Daniel Jacobowitz @ 2003-03-26 23:35 UTC (permalink / raw)
To: Adam Fedor; +Cc: Andrew Cagney, gdb
On Wed, Mar 26, 2003 at 04:31:23PM -0700, Adam Fedor wrote:
>
> On Thursday, March 20, 2003, at 02:08 PM, Andrew Cagney wrote:
> >
> >I've looked at what the underlying code is trying to do and,
> >unfortunatly, the original objc-lang.c botched its portability(1),
> >sigh! The file is currently native only so infrun.c can't directly
> >refer to objc-lang.c, and hence, will need to go via a dispatch table.
> > Going via a dispatch table wouldn't hurt anyway.
> >
> >(1) I noticed that the parameter extract methods assume host=target.
> >
>
> I'm wondering what's not portable with objc-lang.c? With the remaining
> patches I have that require this, I was thinking it might be easier to
> just fix it now. The alternative appears to be adding a whole bunch of
> things to the language_defn structure. I admit I don't really
> understand the problem though.
At the very least FETCH_ARGUMENT and CONVERT_FUNCPTR need to go into
the architecture vector. They're completely incorrect:
- they assume host == target
- they will prevent GDB from compiling on host !< {i386, ppc, sparc, hppa}
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: objc-lang.c portability (Was Re: [PATCH] Step over Objective-C dispatch function)
2003-03-26 23:31 ` objc-lang.c portability (Was Re: [PATCH] Step over Objective-C dispatch function) Adam Fedor
2003-03-26 23:35 ` Daniel Jacobowitz
@ 2003-03-27 15:53 ` Andrew Cagney
1 sibling, 0 replies; 3+ messages in thread
From: Andrew Cagney @ 2003-03-27 15:53 UTC (permalink / raw)
To: Adam Fedor; +Cc: gdb
>
> On Thursday, March 20, 2003, at 02:08 PM, Andrew Cagney wrote:
>
> I've looked at what the underlying code is trying to do and, unfortunatly, the original objc-lang.c botched its portability(1), sigh! The file is currently native only so infrun.c can't directly refer to objc-lang.c, and hence, will need to go via a dispatch table. Going via a dispatch table wouldn't hurt anyway.
>
> (1) I noticed that the parameter extract methods assume host=target.
>
>
> I'm wondering what's not portable with objc-lang.c? With the remaining patches I have that require this, I was thinking it might be easier to just fix it now. The alternative appears to be adding a whole bunch of things to the language_defn structure. I admit I don't really understand the problem though.
Both getting objc-lang.c portable and extending the language vector are
things that will, one day, need to be done :-/ My guess is that it will
be quicker, and lower risk, to attack the language vector side of the
problem then to more slowly audit / fix the portability problems. This
will at least make it possible to enable objc for one or two key native
systems (e.g., i386 GNU/Linux).
Language vector additions are largly a case of changing this:
switch (current_language)
case C: do something C like;
case C++: do something C++ like;
...
into something like:
switch (current_language)
...
default:
current_language->do something language like;
which is very mechanical. There is plenty of prior art so approval is
pretty mechanical. Contrast it to the problem DanielJ pointed out (and
I hinted at):
> At the very least FETCH_ARGUMENT and CONVERT_FUNCPTR need to go into
> the architecture vector.
As they stand, these new methods won't go into the architecture vector.
Adding a new architecture method requires care and consideration, and
for the above, they will definitly need change.
Andrew
^ permalink raw reply [flat|nested] 3+ messages in thread