Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: pedro@codesourcery.com (Pedro Alves)
Cc: gdb-patches@sourceware.org
Subject: Re: [RFC,v3] Yank out target_ops->to_sections
Date: Tue, 02 Jun 2009 11:10:00 -0000	[thread overview]
Message-ID: <200906021110.n52BAO3F008617@d12av02.megacenter.de.ibm.com> (raw)
In-Reply-To: <200905301740.02801.pedro@codesourcery.com> from "Pedro Alves" at May 30, 2009 05:40:02 PM

Pedro Alves wrote:

> > I've been thinking for a while that the exec_ops target
> > should be pushed whenever we have any kind of file loaded (main
> > executable or dynamic shared module) that we can read memory
> > from.  It implements the file_stratum after all, and target.h says:
> > 
> > file_stratum,               /* Executable files, etc */
> >                                                  ^^^
> 
> I think I'm convinced this it is the best to do, design-wise.
> This way, we'll still be able to read memory from shared library
> sections if no main executable is loaded into GDB (e.g., gdb -c foo,
> without specifying an executable needs this).
> 
> I've given it a try, and, it does look like a cleaner solution
> long term to me.  Even PIE executables blur the distintion of
> what is specified as main executable vs what is reported by the
> dynamic loader a bit more.  Another interesting fact, is that
> the "vmap" bits spread about in exec.c for xcoffsolib are quite
> similar in spirit to this "set of target sections we can read file
> read memory from".  Find below an incremental patch that applies
> on top of the v2 one I posted (the changes aren't that
> many: push/unpush of exec_ops moved, plus that default of
> target_get_section_table you pointed out goes away, replaced by
> the exec_ops target returning the current set of target sections).
> At the bottom there's the new v3 combined patch.
> 
> Please let me know what you think about this.  Re-tested on x86_64-linux.

I think this makes sense.  Your new combined patch looks good to me.

> Index: src/gdb/exec.c
> ===================================================================
> --- src.orig/gdb/exec.c	2009-05-30 17:24:30.000000000 +0100
> +++ src/gdb/exec.c	2009-05-30 17:24:47.000000000 +0100
> @@ -71,6 +71,15 @@ struct target_ops exec_ops;
>  bfd *exec_bfd = NULL;
>  long exec_bfd_mtime = 0;
>  
> +/* GDB currently only supports a single symbol/address space for the
> +   whole debug session.  When that limitation is lifted, this global
> +   goes away.  */
> +static struct target_section_table current_target_sections_1;
> +
> +/* The set of target sections matching the sections mapped into the
> +   current inferior's address space.  */
> +struct target_section_table *current_target_sections = &current_target_sections_1;

This can be "static" now, right?


Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


  reply	other threads:[~2009-06-02 11:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-24  1:35 [RFC,v2] " Pedro Alves
2009-05-26 23:30 ` Pedro Alves
2009-05-27  1:30   ` Doug Evans
2009-05-27 18:24   ` Ulrich Weigand
2009-05-29 14:13     ` Pedro Alves
2009-05-30 16:39       ` [RFC,v3] " Pedro Alves
2009-06-02 11:10         ` Ulrich Weigand [this message]
2009-06-03 18:57           ` Pedro Alves
2009-06-02 11:06       ` [RFC,v2] " Ulrich Weigand
2009-06-03 16:26         ` Pedro Alves
2009-06-03 19:36           ` Ulrich Weigand

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=200906021110.n52BAO3F008617@d12av02.megacenter.de.ibm.com \
    --to=uweigand@de.ibm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@codesourcery.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