This is the mail archive of the gdb-patches@sourceware.cygnus.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]

Re: [PATCH] Fixups in procfs.c


Andrew Cagney wrote:
> 
> msnyder@cygnus.com wrote:
> >
> > I will check in the following minor fix-ups in procfs:
> >
> > 2000-04-26  Michael Snyder  <msnyder@seadog.cygnus.com>
> >
> >         * procfs.c (comments): Eliminate "???" in comments, which GCC
> >         wants to interpret as a trigraph.  (fill_gregset, supply_gregset,
> >         fill_fpregset, supply_fpregset): declare.
> >         (procfs_wait): Sysargs is a long, change printf format to match.
> >         (test-mapping, mapping_test, test_mapping_cmd) Remove (test only).
> >
> 
> > + /* These could go in a header file, but the many and various
> > +    definitions of gregset_t would make it tricky...  MVS */
> > + extern void fill_gregset (gdb_gregset_t *, int);
> > + extern void fill_fpregset (gdb_fpregset_t *, int);
> > + extern void supply_gregset (gdb_gregset_t *);
> > + extern void supply_fpregset (gdb_fpregset_t *);
> > +
> 
> Michael,
> 
> This change has to be wrong.  The extern declaration should be comming
> from a header file somewhere.

I appreciate the sentiment (as reflected by my comment).
There are currently 15 (fifteen) implementations of these
four functions.  Thirteen of them have an argument of type
"gregset_t", one has a "prgregset_t", and one has an
"elf_gregset_t".  None of these functions is declared in any 
header file.  The type itself comes from various different
system header files, depending on the native OS.

To cope with this divergence, procfs has its own typedef
"gdb_gregset_t" which is declared in various different ways
inside an ugly ifdef.  It calls the function with that, and
if all goes well, the actual argument will match the appropriate 
version of the formal argument.

I did not think this ugliness ought to be exported up 
into a local header file, since there are very few users
of this API.  And anyway, I was only trying to suppress 
a compiler warning.

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