Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@cygnus.com>
To: Klee Dienes <kdienes@apple.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFA] Cached function lookup
Date: Thu, 28 Feb 2002 07:22:00 -0000	[thread overview]
Message-ID: <3C7E4B41.5000506@cygnus.com> (raw)
In-Reply-To: <8A9ABA76-1A1B-11D6-BA6D-0030653FA4C6@apple.com>

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 <kdienes@apple.com>
> 
>         * 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.



  parent reply	other threads:[~2002-02-28 15:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-05  1:34 Klee Dienes
2002-02-06 10:58 ` Jim Blandy
2002-02-28  7:22 ` Andrew Cagney [this message]
2002-03-09 21:42 ` Andrew Cagney
2002-03-09 21:54 ` Andrew Cagney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3C7E4B41.5000506@cygnus.com \
    --to=ac131313@cygnus.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=kdienes@apple.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox