This is the mail archive of the
mailing list for the GDB project.
Re: [RFC,v2] Yank out target_ops->to_sections
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: pedro at codesourcery dot com (Pedro Alves)
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 3 Jun 2009 21:36:29 +0200 (CEST)
- Subject: Re: [RFC,v2] Yank out target_ops->to_sections
Pedro Alves wrote:
> I don't think anyone disagrees with that. With my proposal, there will
> be ways to get from a frame/thread/inferior/whatever to the corresponding
> address/symbol space, and where possible we'll use those. However,
> consider the case where you have more than one program
> loaded (say, /bin/cat and /bin/echo), and haven't started execution in
> either of those yet. There is no "inferior" or "thread" object yet
> for any of them, and you can't distinguish with inferior_ptid=20
> either (it's null_ptid in both cases). Currently, all this state
> is spread around in globals all over (e.g., even exec_bfd can be
> accessed in the most twisted code paths). But, it's the "prepare to
> start a new inferior" part that ends up requiring the global.
Ah, I see.
> I'm proposing to aggregate them somewhere, but we still need to have a
> global storing a pointer to the "current context" somewhere. I agree
> that ideally then this global should only be accessed at high
> layers, close to the UI, and that we should only need to pass to each
> major component what it really needs and handles, as arguments.
> But, that really *has* to be a long term goal. Just getting rid
> of a single one of those globals (by passing them in arguments) is
> a *lot* of hair for practically 0 gain at this point. Since we do
> have to aggregate and store these globals somewhere, I think that
> I'm taking a good first step. IMO, it's much better to just switch
> a pointer than to come up with the old "infrun.c|thread.c:context_switch"
> mess. We can then *incrementally* clean up interfaces, as we'll
> then have a clearly visible goal to achieve. Anyway, things
> will surely get clearer a bit further down the line when I post
> the main juicy bits for discussion.
OK, thanks for the explanation ... Looking forward to your patches :-)
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE