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: [RFA] Add mips_software_single_step


> On Thu, Jul 05, 2001 at 05:50:14PM -0400, Andrew Cagney wrote:
> 
>> > This function's pretty straightforward; the Linux port uses it.  Ok to
>> > commit?
> 
>> 
>> 
>> How does the linux port use it?  As a tweek to the multi-arch vector or 
>> as a macro/function?  If the former then it should be static, if the 
>> latter than a declaration in mips-tdep.h or tm-mips.h (?) is needed.
> 
> 
> As a macro:
> 
> #define SOFTWARE_SINGLE_STEP_P() 1
> extern void mips_software_single_step (unsigned int, int);
> #define SOFTWARE_SINGLE_STEP(sig,bp_p) mips_software_single_step (sig, bp_p)


The macro definition appearing in config/mips/tm-linux.h but the 
function declaration appearing in config/mips/tm-mips.h?  The function 
declaration is in tm-mips.h so that mips-tdep.c always sees it.


> I'm sensing that this belongs in the multi-arch vector, though.  I'll
> change that.


For the moment the above is ok.


> The question this raises is how to do it.  I'd rather do it in
> mips-linux-tdep.c than mips-tdep.c, and mips-tdep shouldn't know we're
> compiling for a Linux target (it already does, via MIPS_DEFAULT_ABI,
> but I'll address that in a bit).  How can I modify the gdbarch vector
> in a second place?


You're on the right track but (as I wrote):

> The wart?  So far multi-arch has concentrated on problems like:
> 
>     MIPS2 embedded
>     MIPS3 embedded
> 
> but has avoided cases such as:
> 
>     Linux/MIPS native and remote
>     MIPS embedded
>     *BSD/MIPS remote
> 
> i.e. OS as well as ISA/ABI as a variant.  For nm.h to be reduced to

> just _native_ interface support, multi-arch will need to be extended

> to include this.


We're getting into the relm of theory :-)  No one has so far tried to do 
this.  (Well, ok I think Eli is setting himself up for the challenge on 
IRIX.)

The multi-arch notes suggest:

	o	call generic code to create
		a multi-arch vector as per
		ABI/ISA:

		mips-linux-tdep.c calls
		mips-tdep.c:create_gdbarch_object()

	o	refine the created object
		to be OS specific.

The gap in all this is the bit of logic that decides what (mip-tdep.c or 
mips-linux-tdep.c) should create the multi-arch vector.


>> The function is almost ok.  It just needs to be updated to meet GDB's 
>> current coding conventions (ISO-C, indentation).
> 
> 
> Right.  I'll do that too.
> 
> 
>> With regard to the linux code, you should probably look over 
>> http://sources.redhat.com/gdb/ari/ and check any new code for potential 
>> regressions or errors.  Just remember to ignore any of the warnings :-)
> 
> 
> I think I'm OK on most of those; I'll go over it again later.


If you think you're ok then that is more than sufficient.

	Andrew




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