This is the mail archive of the gdb-patches@sourceware.org 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: [rfc] Autoselect x86_64 or i386 based on the remote g packet size


On Thu, Nov 09, 2006 at 10:36:29PM +0100, Mark Kettenis wrote:
> Hi Daniel,
> 
> I can't say I'm very enthousiastic about this patch.  It feels like a
> kludge to avoid adding proper support to the remote protocol that allows
> gdb to interrogate the target about this.  A very clever kludge, but still
> a kludge.

True.  I'm not avoiding it, though; that interrogation happens to be
mentioned here:
  http://sourceware.org/ml/gdb-patches/2006-11/msg00055.html

  Something I haven't implemented yet, but probably will before posting
  the XML bits: this is enough to implement a remote target which can
  tell you its architecture!  Pretty neat, though a little tricky to get
  right.  What we ought to do at that point is validate that the remote
  target and the selected executable have sufficiently compatible
  architectures.  Then GDB will be able to warn me when I connect a MIPS
  cross GDB to an i386 gdbserver by accident (which I do probably once a
  week).

Honestly, this clever auto-detection is much more useful for MIPS than
it is for i386/AMD64; for MIPS, an executable file doesn't necessarily
contain the answer to the question, but for i386 it always does.  I
implemented the AMD64 bits after I had it working for MIPS, as a demo
when Jan K. posted an even kludgier patch to warn about this case a
couple of weeks ago.  If you don't like this bit, I'd be happy to drop
it, and make gdbserver report the architecture manually when I advance
to the XML stage of these target descriptions.  I won't mourn the i386
parts of this patch.  Would you rather I did that?

(I'd like to hold on to the MIPS bits, because they're solving a
slightly different problem, and because I know they're useful with
existing non-gdbserver stubs that would be harder to fix.)

-- 
Daniel Jacobowitz
CodeSourcery


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