From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24123 invoked by alias); 28 Feb 2002 15:22:49 -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 24028 invoked from network); 28 Feb 2002 15:22:43 -0000 Received: from unknown (HELO localhost.redhat.com) (24.112.135.44) by sources.redhat.com with SMTP; 28 Feb 2002 15:22:43 -0000 Received: from cygnus.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 114BE3D79; Thu, 28 Feb 2002 10:22:42 -0500 (EST) Message-ID: <3C7E4B41.5000506@cygnus.com> Date: Thu, 28 Feb 2002 07:22:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:0.9.8) Gecko/20020210 X-Accept-Language: en-us MIME-Version: 1.0 To: Klee Dienes Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA] Cached function lookup References: <8A9ABA76-1A1B-11D6-BA6D-0030653FA4C6@apple.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-02/txt/msg00741.txt.bz2 Klee, I'll follow this up next week. There's a pretty cool idea in this one. Andrew > (This is basically the same patch I sent last week, just updated > to the latest source base.) > > This patch allows functions in the target used by GDB ("malloc", > "scm_lookup_cstr", and later a ton of Objective-C functions) to have > their values cached and re-used unless the symbol table has changed > in-between calls. This is a performance win overall, and a particular > win when dispatching Objective-C method calls and looking up > Objective-C type information from the runtime. > > 2002-02-04 Klee Dienes > > * breakpoint.c (breakpoint_re_set, breakpoint_re_set_all, > breakpoint_update): Instead of re-parsing all deferred breakpoints > every time breakpoint_re_set is called, increment a generation > number. When breakpoints need to be up-to-date, call > breakpoint_update. This prevents unnecessary re-parsing of > breakpoint information (and massive future-break spam) when > multiple shared libraries are loaded at the same time. > > * breakpoint.h: export symbol_generation, breakpoint_update. > > * gcore.c (default_derive_heap_segment): update to use > create_cached_function. > > * scm-lang.c (scm_lookup_name): update to use create_cached_function. > > * valops.c (create_cached_function, lookup_cached_function): add. > These functions create a new data type (a `cached_value'), whose > purpose is to store the lookup of commonly used symbols GDB needs > from the inferior. For example, evaluating the expression 'print > "hello"' causes GDB to call `malloc' in the target. Looking up > the symbol for `malloc' takes a non-trivial amount of time, and > has no need to be done if the symbols have not changed. > create/lookup_cached_function allow GDB to cache the results of > these lookups; re-looking them up only when the symbols have > changed. > (find_function_in_inferior): add a default type as second > argument. This type will be used for the returned value if no > type information is available for the function (previously, the > type was assumed to be (char *) (*). > (value_allocate_space_in_inferior): use new cached_function > interface. > > * value.h (cached_value) add. > (create_cached_function) add. > (lookup_cached_function) add. > (find_function_in_inferior) update to new signature.