This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [PATCH 2/8] add target method delegation


> -----Original Message-----
> From: gdb-patches-owner@sourceware.org [mailto:gdb-patches-owner@sourceware.org] On Behalf Of Tom Tromey
> Sent: Monday, July 29, 2013 6:45 PM


> To fix the first problem, this patch introduces a handful of
> target_delegate_* functions, which forward calls further down the
> target stack.

I'm doing this explicitly in record-btrace.c.  Seems I should have added
the delegate functions, instead.  I'll change it to use your delegates.


Once we have all the delegates in place, shouldn't we rewrite the original
target_~ functions to call the respective target_delegate_~ with
&current_target as first argument?


> To fix the second problem, this patch adds find_target_at to determine
> whether a target appears at a given stratum.  This may seem like
> overkill somehow, but I have a subsequent patch series (see archer.git
> tromey/multi-target) that uses it more heavily.

I'd rather consistently add struct target_opc *self as first parameter to all
target functions.  I did this for target_prepare_to_store for exactly the
reason of delegating a request I don't handle in record-btrace.c (patch
is currently under review).

Otherwise, we rely on the fact that the target doing the delegation is at
the top of its stratum.  This holds for record targets and I may be ignorant
enough to not realize that this holds in general.  If we could have another
target on top of us in the same stratum, though, we would delegate to
ourselves.

Regards,
Markus.

Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen, Deutschland
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Christian Lamprechter, Hannes Schwaderer, Douglas Lusk
Registergericht: Muenchen HRB 47456
Ust.-IdNr./VAT Registration No.: DE129385895
Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]