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]

Re: Patches for FreeBSD 4.2


Mark Kettenis writes:
 > Stu Grossman <grossman@juniper.net> writes:
 > 
 > > Here is a set of patches that fixes a bunch of problems (and some testsuite
 > > failures) for FreeBSD 4.2.
 > 
 > Thanks.  A few comments about the things that fall on my turf:
 > 
 > > + 	* i386-tdep.c (i386_store_return_value):  Make sure that floats get
 > > + 	stored at the top of the FP stack.
 > 
 > Already fixed :-).

Ahh, cool!

 > 
 > > + 	* i386-freebsd-nat.c:  New file to support FreeBSD specific stuff.
 > 
 > * I'd prefer the name i386fbsd-nat.c, since we already have
 >   alphafbsd-tdep.c.

Actually, I was following the linux convention (xxx-linux-yyy.c).  But, I can
fix it.

As an aside, it would be nice to use a consistent file naming convention
throughout GDB.  So far, we have <mach><os>-nat/tdep, or <mach>-<os>-nat/tdep.
Mostly, files seem to use the latter convention unless it's one of the BSDs, in
which case they use the former.  Picking one convention and sticking to it
would make things cleaner.

 > * This file won't compile on FreeBSD 3.x, since <machine/sigframe.h>
 >   doesn't exist.

I'll try to clean that up for 3.x.  It looks like in 3.x and earlier, struct
sigframe was in <machine/frame.h>.

 > Besides, the implementation of a *_frame_saved_pc
 >   function belongs in a target-dependent file, and shouldn't depend on
 >   the target headers.  What's wrong with the old implementation?

I disagree.  *_frame_saved_pc is inherently native dependent for most OS's as
it involves looking at some kind of OS specific signal context structure.

 >   Hmm, `struct sigcontext' has been changed.  The CVS logs in the
 >   FreeBSD tree seems to imply that it is possible to distinguish
 >   between a new and an old signal handler frame.  So perhaps we can
 >   distinguish between the two.  Otherwise we have to provide different
 >   implementations for old and new FreeBSD versions.

I think you are stuck with different versions of GDB anyway.  3.4 seems to have
two versions of sigcontext (the old one is called `osigcontext').  Sigcontext
is pretty much the same as the 4.2 version.  In any case, I don't see a good
way to distinguish between the two versions of sigcontext.  In addition, I
doubt that core files are compatible between 3.4 and 4.2.  So, it really looks
like you want different builds of GDB for each OS version.

 > * I think the SOFTWARE_SINGLE_STEP_P stuff can be removed from your
 >   version of child_resume.

That is only used for an internal consistency check, which I think is valuable
here.

 > > + 	* config/i386/tm-fbsd.h:  Define FRAME_SAVED_PC to use FreeBSD specific
 > > + 	code to extract return PC from signal frames.
 > > + 	* Define FRAME_CHAIN_VALID to use func_frame_chain_valid, since ELF
 > > + 	doesn't generate N_TEXT object file markers.
 > > + 	* Remove SIGTRAMP_START and SIGTRAMP_END.  Move all of that logic into
 > > + 	a FreeBSD specific function invoke via IN_SIGTRAMP.
 > 
 > Why did you comment out USE_STRUCT_CONVENTION here?  AFAIK FreeBSD
 > uses the old GCC 1 conventions for passing short structs.

Brain fart.  You are right, that needs to be left in for FreeBSD.

			Stu


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