This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RE: [patch v4 10/13] gdbserver, linux, btrace: add btrace support for linux-low
- From: "Metzger, Markus T" <markus dot t dot metzger at intel dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>, "markus dot t dot metzger at gmail dot com" <markus dot t dot metzger at gmail dot com>, "jan dot kratochvil at redhat dot com" <jan dot kratochvil at redhat dot com>, "tromey at redhat dot com" <tromey at redhat dot com>, "kettenis at gnu dot org" <kettenis at gnu dot org>
- Date: Wed, 5 Dec 2012 09:27:37 +0000
- Subject: RE: [patch v4 10/13] gdbserver, linux, btrace: add btrace support for linux-low
- References: <1354013351-14791-1-git-send-email-markus.t.metzger@intel.com> <1354013351-14791-11-git-send-email-markus.t.metzger@intel.com> <50B6779B.7010509@redhat.com>
> -----Original Message-----
> From: Pedro Alves [mailto:palves@redhat.com]
> Sent: Wednesday, November 28, 2012 9:44 PM
> To: Metzger, Markus T
> Cc: gdb-patches@sourceware.org; markus.t.metzger@gmail.com; jan.kratochvil@redhat.com; tromey@redhat.com;
> kettenis@gnu.org
> Subject: Re: [patch v4 10/13] gdbserver, linux, btrace: add btrace support for linux-low
>
> On 11/27/2012 10:49 AM, markus.t.metzger@intel.com wrote:
> > From: Markus Metzger <markus.t.metzger@intel.com>
> >
> > Implement btrace target ops in target linux-low using the common linux-btrace
> > functions.
> >
> > Add linux-btrace.o to all targets that link linux-low.o. I'd rather not link it
> > to targets that do not support branch tracing, but this would require changing
> > the way target ops are defined for gdbserver.
>
> A simple way to do this would be to have configure.src set srv_linux_btrace=yes
> and then configure.ac would do:
>
> if test "${srv_linux_btrace}" = "yes"; then
> AC_DEFINE(HAVE_BTRACE, 1,
> [Define if the target supports branch tracing])
> fi
>
> You'd then do e.g.,:
>
> @@ -5858,6 +5884,11 @@ static struct target_ops linux_target_ops = {
> linux_get_min_fast_tracepoint_insn_len,
> linux_qxfer_libraries_svr4,
> linux_supports_agent,
> + #if HAVE_BTRACE
> + linux_supports_btrace,
> + linux_enable_btrace,
> + linux_disable_btrace,
> + linux_btrace_has_changed,
> + linux_low_read_btrace,
> + #endif
> };
Thanks. I'll do just that.
This removes the bulk of the feature for targets that do not support it. It leaves the function pointer fields in struct target_ops and the communication in server.c. If we are very conscious about gdbserver code size, I can guard those, as well.
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