[patch/rfc] Generate observer.[hc]

Andrew Cagney cagney@gnu.org
Fri Apr 16 18:56:00 GMT 2004


>>Date: Thu, 15 Apr 2004 10:45:02 -0400
>>> From: Andrew Cagney <cagney@gnu.org>
>>
>>>> > 
>>>> > let me play the Devil's
>>>> > advocate and ask what significant wins we gain from generating the
>>>> > source files from the Texinfo file, that justify maintaining the
>>>> > scripts which are required to support this machinery?
>>
>>> 
>>> We first establish a one-stop shop for adding observers, and second 
>>> eliminate the drudgery of churning out the C code needed to implement 
>>> each observer.
> 
> 
> That much is understood, but I still have a difficulty to see how
> inventing an elaborate machinery for churning C code out of Texinfo
> (which is hardly a trivial Sed'ery) is justified by the benefits you
> mentioned.  I thought perhaps there were other, subtler, benefits
> which I didn't see.  Are there?

This machinery isn't that elaborate.  For an example of that look at 
gdbarch.sh which desperatly needs to be dumbed down :-/

>>> (At a guess, we're going to end up with something between 10 and 20
>>> observers).
> 
> 
> So what, we will have all of them in the docs?

Given the choice between duplicating/triplicating the event code, had a 
single list and generator, I'll take the latter.

Here's the original proposal as it relates to gdbarch.sh:
http://sources.redhat.com/ml/gdb-patches/2003-02/msg00384.html
when the observer was original posted it discussed doing something 
similar as a good thing.

(yes I've reversed the order so that the observer is the prototype, like 
I said gdbarch.sh needs to be greatly simplified).

Andrew




More information about the Gdb-patches mailing list