From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24093 invoked by alias); 16 Jun 2003 20:42:37 -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 24055 invoked from network); 16 Jun 2003 20:42:37 -0000 Received: from unknown (HELO hub.ott.qnx.com) (209.226.137.76) by sources.redhat.com with SMTP; 16 Jun 2003 20:42:37 -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 QAA32343; Mon, 16 Jun 2003 16:36:00 -0400 Received: from catdog ([10.4.2.2]) by smtp.ott.qnx.com (8.8.8/8.6.12) with SMTP id QAA08579; Mon, 16 Jun 2003 16:42:34 -0400 Message-ID: <074f01c33447$d404c2b0$0202040a@catdog> From: "Kris Warkentin" To: "Gdb@Sources.Redhat.Com" Cc: "Mark Kettenis" Subject: found gdbarch solib issue Date: Mon, 16 Jun 2003 20:42: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/msg00323.txt.bz2 So I was tracing around trying to figure out why my sysv_fetch_link_map_offsets function was getting lost when architectures were changing. I noticed that _init_abi was being called which then calls my nto_init_abi through gdbarch_init_osabi(). Problem was, at some point we're changing arches for some reason, whether setting it from a file or whatever, and the generic init_abi is called again. This time, however, my handler for nto_init_abi isn't called. The change that makes this problem go away is below but I'm not entirely confident that it's the right thing to do. If you look at the 'compatible' function, ie. mips_compatible, all it's doing is comparing arches. The original test below is comparing pointers which I think might not be right. Either way, if I do this change, all my worries fly away. Any reason anyone can think of why this might be bad? cheers, Kris RCS file: /cvs/src/src/gdb/osabi.c,v retrieving revision 1.15 diff -u -5 -r1.15 osabi.c --- osabi.c 8 Jun 2003 18:27:14 -0000 1.15 +++ osabi.c 16 Jun 2003 20:33:38 -0000 @@ -309,12 +309,11 @@ NOTE: kettenis/20021027: There may be more than one machine type that is compatible with the desired machine type. Right now we simply return the first match, which is fine for now. However, we might want to do something smarter in the future. */ - compatible = arch_info->compatible (arch_info, handler->arch_info); - if (compatible == handler->arch_info) + if(arch_info->compatible (arch_info, handler->arch_info)) { (*handler->init_osabi) (info, gdbarch); return; }