From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7022 invoked by alias); 26 Jun 2003 14:43:04 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 7014 invoked from network); 26 Jun 2003 14:43:04 -0000 Received: from unknown (HELO hub.ott.qnx.com) (209.226.137.76) by sources.redhat.com with SMTP; 26 Jun 2003 14:43:04 -0000 Received: from smtp.ott.qnx.com (smtp.ott.qnx.com [10.0.2.158]) by hub.ott.qnx.com (8.9.3p2/8.9.3) with ESMTP id KAA26243 for ; Thu, 26 Jun 2003 10:35:33 -0400 Received: from catdog ([10.4.2.2]) by smtp.ott.qnx.com (8.8.8/8.6.12) with SMTP id KAA20583 for ; Thu, 26 Jun 2003 10:43:03 -0400 Message-ID: <040001c33bf1$4ed98060$0202040a@catdog> From: "Kris Warkentin" To: "Gdb@Sources.Redhat.Com" Subject: [RFC] target defined OSABI sniffer Date: Thu, 26 Jun 2003 14:43:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-SW-Source: 2003-06/txt/msg00486.txt.bz2 It seems that a lot of effort has been put into the multi-arch stuff but most of it centers around recognizing a binary and setting things up based on that. I'm pondering whether that is the right approach in all cases. Shouldn't the target be telling gdb what it should be doing rather than the other way around? I've been looking at different ways of getting gdb to recognize a QNX binary so that it can set the OSABI properly but shouldn't the fact that I'm connected to a remote neutrino machine be sufficient? One possible solution that I'm considering is to put something like a TARGET_SNIFF_OSABI() type function in the generic sniffer. That way, when I'm connected to a remote machine, I can just set the osabi and arch to match that machine. Then, if the binary isn't compatable, we can error out. In the native case, my current_target should KNOW that it's on a Neutrino box and be able to respond with the appropriate osabi. Can anyone comment on some possible downsides of this? Our chief architect is fairly insistent that we shouldn't need a way to recognize a Neutrino binary and I'm not having a lot of luck convincing him otherwise. Just from my experience chasing these osabi problems, it looks like there are LOTS of places where the arch can shift under my feet. I'm thinking that maybe core files or simulators might be a problem. The other problem might be that some targets (ICEs, etc.) may have no way of telling gdb what they are. In cases like that, I suppose setting everything based on the binary should be okay. Mostly I guess I'm asking whether the target should have a way of overriding the automatic stuff and saying, "I am targetting this, period." cheers, Kris