From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18327 invoked by alias); 24 Dec 2002 06:28:30 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 18314 invoked from network); 24 Dec 2002 06:28:29 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by 209.249.29.67 with SMTP; 24 Dec 2002 06:28:29 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id gBO61dB19885 for ; Tue, 24 Dec 2002 01:01:39 -0500 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id gBO6SHa18902; Tue, 24 Dec 2002 01:28:17 -0500 Received: from localhost.localdomain (vpn50-19.rdu.redhat.com [172.16.50.19]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id gBO6SGL17279; Tue, 24 Dec 2002 01:28:16 -0500 Received: (from kev@localhost) by localhost.localdomain (8.11.6/8.11.6) id gBO6SBH26996; Mon, 23 Dec 2002 23:28:11 -0700 Date: Mon, 23 Dec 2002 22:37:00 -0000 From: Kevin Buettner Message-Id: <1021224062810.ZM26995@localhost.localdomain> In-Reply-To: Daniel Jacobowitz "Re: [RFA] Add support for 64-bit MIPS GNU/Linux targets" (Dec 23, 6:56pm) References: <1021223225021.ZM25698@localhost.localdomain> <20021223235639.GA6927@nevyn.them.org> To: Daniel Jacobowitz Subject: Re: [RFA] Add support for 64-bit MIPS GNU/Linux targets Cc: gdb-patches@sources.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-12/txt/msg00659.txt.bz2 On Dec 23, 6:56pm, Daniel Jacobowitz wrote: > > @@ -95,15 +109,15 @@ supply_gregset (elf_gregset_t *gregsetp) > > memset (zerobuf, 0, MAX_REGISTER_RAW_SIZE); > > > > for (regi = EF_REG0; regi <= EF_REG31; regi++) > > - supply_register ((regi - EF_REG0), (char *)(regp + regi)); > > + supply_32bit_reg ((regi - EF_REG0), (char *)(regp + regi)); > > > > - supply_register (LO_REGNUM, (char *)(regp + EF_LO)); > > - supply_register (HI_REGNUM, (char *)(regp + EF_HI)); > > + supply_32bit_reg (LO_REGNUM, (char *)(regp + EF_LO)); > > + supply_32bit_reg (HI_REGNUM, (char *)(regp + EF_HI)); > > > > - supply_register (PC_REGNUM, (char *)(regp + EF_CP0_EPC)); > > - supply_register (BADVADDR_REGNUM, (char *)(regp + EF_CP0_BADVADDR)); > > - supply_register (PS_REGNUM, (char *)(regp + EF_CP0_STATUS)); > > - supply_register (CAUSE_REGNUM, (char *)(regp + EF_CP0_CAUSE)); > > + supply_32bit_reg (PC_REGNUM, (char *)(regp + EF_CP0_EPC)); > > + supply_32bit_reg (BADVADDR_REGNUM, (char *)(regp + EF_CP0_BADVADDR)); > > + supply_32bit_reg (PS_REGNUM, (char *)(regp + EF_CP0_STATUS)); > > + supply_32bit_reg (CAUSE_REGNUM, (char *)(regp + EF_CP0_CAUSE)); > > > > /* Fill inaccessible registers with zero. */ > > supply_register (UNUSED_REGNUM, zerobuf); > > Correct me if I'm wrong, but native thread debugging isn't going to > work if you do this. proc-service.c calls supply_gregset directly and > everything blows up. True, but see below. > Is it time to multiarch supply_gregset? Maybe. I've given this some thought and it seems to me that if we're going to multiarch supply_gregset, we'll have to change its prototype; basically, we'll have to pass gregsetp around as a void *. I'm not against this, but I think it needs to be discussed first. (Also, either the regset size or perhaps an allocation function will need to be provided using a multiarch method.) There are several other problems with native thread support on Linux/MIPS: 1) For o32, the core gregset layout is incompatible with that used for threads. (The sizes of the arrays and the layouts are different.) Hopefully this won't be a problem for n32 and n64. 2) There are actually three libthread_db.so libraries, one each for o32, n32, and n64. Yet the gdb binary will (obviously) use only one of these ABIs. It's not possible to dlopen() a library of a differing ABI, which (unfortunately) means that a given gdb binary can only provide thread support for only one ABI. There are, of course, several technical options open to us to work around this difficulty. One approach is to arrange for each of these libraries to be built to use the ABI that gdb uses, yet still know the details about the target ABI. Another is to somehow combine the knowledge concerning the three ABIs into a single libthread_db.so library. There may be other approaches too, but at the moment, I don't think any of these solutions will be trivial to implement (though some are clearly easier than others). Anyway, given all of the above it seems to me that native thread support for Linux/MIPS which supports all three ABIs is quite a ways off. [...] > So: > supply_gregset? > GDBSERVER_DEPFILES nit > tm-linux64 nit > > Otherwise, this is OK. Thanks for the quick (but thorough) patch review! I'll fix the GDBSERVER_DEPFILES and tm-linux64 nits, but the supply_gregset issue will require further discussion. In the interim, how would you like to proceed? Kevin