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]
Other format: [Raw text]

Re: patch to add QNX NTO i386 support


> The i386-target was "multi-arched" a while ago, which unfortunately
> means that your patch will need extensive modification before we can
> add it.  Don't worry, I'll help you where needed.

Funny you should write.  This is just what I've been working on for the past
few hours.

> Basically, most of what's in your tm-i386nto.h file will have to go.
> Instead you should create a i386nto-tdep.c file where you put and
> register an OS/ABI handler for you OS.  Based on the contents of yoyr

Already made the tdep file.  I was just about to email the list to ask about
how to register the handler (I had been looking at the i386-interix-tdep.c
file) when I got your email.

> tm.h file, you should probably base your OS/ABI handler on
> i386-tdep.c:i386_svr4_init_abi().  AFAICT, you'll need
> set_gdbarch_decr_pc_after_break() and
> set_solib_svr4_fetch_link_map_offsets() there.  Move
> i386_qnx_xvr4_link_map_offsets to that file.

Yeah.  I had started with an _init function in i386-nto-tdep that just set
some gdbarch stuff but I quickly realized that it wasn't the right way to do
it.

> You'll also need to find a way to distinguish QNX binaries from other
> OS'es.  The hardware breakpoint stuff will have to be moved to the
> nm.h.  Most of the other stuff shouldn't be necessary or should be
> moved there too.

Okay.  Not sure how but I'll look into it.  Once I've done that, do I
register an osabi_sniffer to determine the binary?

> You should probably use xm-i386.h as your xm.h file.  The other stuff
> should either be discarded or moved to your nm.h file too.

Okay.

> I don't think you should try to match x86-*-nto* in configure.host;
> the configure.tgt doesn't either.

Probably right.  We have a chief architect here that insists that i386 is
not correct as a generic specifier and, since our uname doesn't tell you 5
or 686, it returns x86.  We take care of that mapping in config.guess though
so I believe that the x86 part is redundant now.  We still build
with --target=ntox86 though.

> As Andrew already said, it is probably a good idea to add the QNX i386
> target stuff first, such that we can build cross-debuggers for it.
> Then we can look more closely at the native stuff.

Sure.  The separation went quite well actually.  I've got all the remote and
native stuff separated and cpu specific tdep files and headers made.  The
only major work left is cleaning up our stupid config/i386 stuff and getting
the gdbarch setup properly.

Thanks

Kris


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