From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30598 invoked by alias); 31 Jan 2003 03:07:53 -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 30591 invoked from network); 31 Jan 2003 03:07:53 -0000 Received: from unknown (HELO mx1.redhat.com) (172.16.49.200) by 172.16.49.205 with SMTP; 31 Jan 2003 03:07:53 -0000 Received: from int-mx2.corp.redhat.com (nat-pool-rdu-dmz.redhat.com [172.16.52.200] (may be forged)) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h0V37rf16520 for ; Thu, 30 Jan 2003 22:07:53 -0500 Received: from potter.sfbay.redhat.com (potter.sfbay.redhat.com [172.16.27.15]) by int-mx2.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h0V37qn26668; Thu, 30 Jan 2003 22:07:52 -0500 Received: from redhat.com (reddwarf.sfbay.redhat.com [172.16.24.50]) by potter.sfbay.redhat.com (8.11.6/8.11.6) with ESMTP id h0V37pw30553; Thu, 30 Jan 2003 19:07:51 -0800 Message-ID: <3E39E887.AB98ECA4@redhat.com> Date: Fri, 31 Jan 2003 03:07:00 -0000 From: Michael Snyder Organization: Red Hat, Inc. X-Accept-Language: en MIME-Version: 1.0 To: Adam Fedor CC: GDB Patches Subject: Re: [PATCH] Handle ObjC OPS in eval.c References: <3E15F21B.6010101@doc.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2003-01/txt/msg00827.txt.bz2 Adam Fedor wrote: > > 2003-01-02 Adam Fedor > > * Makefile.in (eval.o): Add $(objc_lang_h) > * eval.c (evaluate_subexp_standard): Handle ObjC ops. > * valops.c (find_function_addr): Make non-static. > * value.h (find_function_addr): Declare. Adam, this is OK in principal, assuming that the objc code such as value_nsstring is being unconditionally built now. A few remarks: > > + /* Verify target responds to method selector. This logic needs > + * work: not sure of GNU variant's name. Must also account for > + * new (NSObject) and old (Object) worlds > + */ > + > + if (1) Is there a reason for this if(1)? > + > +#ifdef GDB_TARGET_IS_HPPA > + CORE_ADDR tmp; > + /* code and comment lifted from hppa-tdep.c -- unfortunately > + there is no builtin function to do this for me. */ > + /* If bit 30 (counting from the left) is on, then addr is the > + address of the PLT entry for this function, not the address > + of the function itself. Bit 31 has meaning too, but only > + for MPE. */ > + if (addr & 0x2) > + addr = (CORE_ADDR) read_memory_unsigned_integer (addr & ~0x3, 4); > + if (tmp = skip_trampoline_code (addr, 0)) > + addr = tmp; /* in case of trampoline code */ > +#endif Ifdef gdb_target is a big no-no. Can you use gdbarch for this? > + if (method) > + { > + struct block *b; > + CORE_ADDR funaddr; > + struct type *value_type; > + > + funaddr = find_function_addr (method, &value_type); This is surely not the best way to do this. You can get the address and the type from the symbol. If op_funcall doesn't need to call it, why does op_objc_msgcall?