From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22367 invoked by alias); 6 Aug 2014 18:08:16 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 21907 invoked by uid 89); 6 Aug 2014 18:08:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ob0-f202.google.com Received: from mail-ob0-f202.google.com (HELO mail-ob0-f202.google.com) (209.85.214.202) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 06 Aug 2014 18:08:08 +0000 Received: by mail-ob0-f202.google.com with SMTP id wp18so542722obc.3 for ; Wed, 06 Aug 2014 11:08:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:mime-version:content-type :content-transfer-encoding:message-id:date:to:cc:subject:in-reply-to :references; bh=fYfx571F7SksEsTmDP9jKgkK5UiNFn0VWQ3e9ODPfsI=; b=AmLwBDVamOrus4GErTILZ1w7kUhJvV4XksCI6xFycRpn3Y0QYjSYhPZ8muB6v4e+cX 856IyaiSayWyExURgponmA3JIYkFKtq60XIXgg7N9Exn1ZmPpIugycCsM7BtY3s2eAOe lwQyqan7PXsLFwrshZcmcjORtBld9zcQVfhp3iC7VqKT8x9MnE7ToVqAuZHi2NtDFgki hwQm0P+viH4/Vt0tR8zaqLQ2pqdsv69IuAr7BRHHo6ZnWARhRohJbhkDdbLil5d1JrHx 0oyqbwtuorlSjgLRB8wavTQALE4IWCbInu/SlBtPhrXp0bW9IPtIQ888UkcG5COkf4oL 2Pbw== X-Gm-Message-State: ALoCoQlW/FShAV5lTLauXUHQg6QWT69R4kqtjjkjNPNj6D9ftslIwELuFvlUTfUzd05L6s8eW3RN X-Received: by 10.42.38.15 with SMTP id a15mr7251157ice.30.1407348486520; Wed, 06 Aug 2014 11:08:06 -0700 (PDT) Received: from corp2gmr1-2.hot.corp.google.com (corp2gmr1-2.hot.corp.google.com [172.24.189.93]) by gmr-mx.google.com with ESMTPS id v44si115321yhv.0.2014.08.06.11.08.06 for (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 06 Aug 2014 11:08:06 -0700 (PDT) Received: from ruffy.mtv.corp.google.com (ruffy.mtv.corp.google.com [172.17.128.44]) by corp2gmr1-2.hot.corp.google.com (Postfix) with ESMTP id 992F15A4335; Wed, 6 Aug 2014 11:08:05 -0700 (PDT) From: Doug Evans MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <21474.28421.76398.827681@ruffy.mtv.corp.google.com> Date: Wed, 06 Aug 2014 18:08:00 -0000 To: Gary Benson Cc: gdb-patches@sourceware.org, Pedro Alves , Tom Tromey Subject: Re: [PATCH 06/11 v5] Add target/symbol.h In-Reply-To: <1406888377-25795-7-git-send-email-gbenson@redhat.com> References: <1406888377-25795-1-git-send-email-gbenson@redhat.com> <1406888377-25795-7-git-send-email-gbenson@redhat.com> X-IsSubscribed: yes X-SW-Source: 2014-08/txt/msg00112.txt.bz2 Gary Benson writes: > This adds target/symbol.h. This file declares a function that the > shared code can use and that the clients must implement. It also > changes some shared code to use these functions. > > gdb/ > 2014-08-01 Tom Tromey > Gary Benson > > * target/symbol.h: New file. > * Makefile.in (HFILES_NO_SRCDIR): Add target/symbol.h. > * target.h: Include target/symbol.h. > * target.c (target_look_up_symbol): New function. > * common/agent.c: Include target/symbol.h. > [!GDBSERVER]: Don't include objfiles.h. > (agent_look_up_symbols): Use target_look_up_symbol. > > gdb/gdbserver/ > 2014-08-01 Tom Tromey > Gary Benson > > * target.c: Include target/symbol.h. > (target_look_up_symbol): New function. > [...] > diff --git a/gdb/target/symbol.h b/gdb/target/symbol.h > new file mode 100644 > index 0000000..bb37b72 > --- /dev/null > +++ b/gdb/target/symbol.h > @@ -0,0 +1,36 @@ > +/* Declarations of target symbol functions. > + > + Copyright (C) 1986-2014 Free Software Foundation, Inc. > + > + This file is part of GDB. > + > + This program is free software; you can redistribute it and/or modify > + it under the terms of the GNU General Public License as published by > + the Free Software Foundation; either version 3 of the License, or > + (at your option) any later version. > + > + This program is distributed in the hope that it will be useful, > + but WITHOUT ANY WARRANTY; without even the implied warranty of > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + GNU General Public License for more details. > + > + You should have received a copy of the GNU General Public License > + along with this program. If not, see . */ > + > +#ifndef TARGET_SYMBOL_H > +#define TARGET_SYMBOL_H > + > +struct objfile; > + > +/* Find a symbol that matches NAME. Limit the search to OBJFILE if > + OBJFILE is non-NULL and the implementation supports limiting the > + search to specific object files. If a match is found, store the > + matching symbol's address in ADDR and return nonzero. Return zero > + if no symbol matching NAME is found. Raise an exception if OBJFILE > + is non-NULL and the implementation does not support limiting > + searches to specific object files. */ > + > +extern int target_look_up_symbol (const char *name, CORE_ADDR *addr, > + struct objfile *objfile); > + > +#endif /* TARGET_SYMBOL_H */ > -- > 1.7.1 Can this comment spell out that either a mangled or demangled form of the symbol is allowed for NAME? [assuming that that is indeed the case] Also, the target/target.h memory routines return zero for success and a non-zero error code for failure. E.g., +/* Read LEN bytes of target memory at address MEMADDR, placing the + results in GDB's memory at MYADDR. Return zero for success, + nonzero if any error occurs. Implementations of this function may + define and use their own error codes, but functions in the common, + nat and target directories must treat the return code as opaque. + No guarantee is made about the contents of the data at MYADDR if + any error occurs. */ + +extern int target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, + ssize_t len); Do we want to be consistent here, and have the same results for target_look_up_symbol? [and throughout the target API]