Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Hui Zhu <teawater@gmail.com>
Cc: Yao Qi <yao@codesourcery.com>, Hui Zhu <hui_zhu@mentor.com>,
	       gdb-patches ml <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Add CTF support to GDB [3/4] ctf target
Date: Thu, 29 Nov 2012 20:42:00 -0000	[thread overview]
Message-ID: <87zk203zw3.fsf@fleche.redhat.com> (raw)
In-Reply-To: <CANFwon3nLhuDMWkc0AuZBC2h6DK5T_Ggdb2OZx7e+GV5t6k-2g@mail.gmail.com>	(Hui Zhu's message of "Tue, 27 Nov 2012 18:54:27 +0800")

>>>>> "Hui" == Hui Zhu <teawater@gmail.com> writes:

Hui> --- a/configure.ac
Hui> +++ b/configure.ac
Hui> @@ -2306,6 +2306,134 @@ if test "$enable_gdbserver" = "yes" -a "
Hui>    AC_MSG_ERROR(Automatic gdbserver build is not supported for this configuration)
Hui>  fi
 
Hui> +AC_ARG_ENABLE(ctf-target,
Hui> +AS_HELP_STRING([--enable-ctf-target],
Hui> +               [enable ctf target (yes/no/auto, default is auto)]),
Hui> +[case "${enableval}" in
Hui> +  yes| no|auto) ;;
Hui> +  *) AC_MSG_ERROR(bad value ${enableval} for --enable-ctf-target option) ;;
Hui> +esac],[enable_ctf_target=auto])
Hui> +
Hui> +if test "$enable_ctf_target" = "yes" || test "$enable_ctf_target" = "auto"; then
Hui> +  pkg_config_args=glib-2.0
Hui> +  for module in . gmodule
[...]

This seems like an awful lot of code just to check for one library.
Does libbabeltrace not come with its own pkg-config file?
Or not link against its dependencies?

Hui> +static struct bt_context *ctx = NULL;
Hui> +static struct bt_ctf_iter *iter = NULL;
Hui> +static int current_tp;
Hui> +static struct bt_ctf_event *ctf_event;

Comments.

Most of this patch was impenetrable to me due to the general lack of
comments.

Hui> +    error (_("Try to use libbabeltrace got error"));

Please phrase differently.

Hui> +      error (_("Try to open \"%s\" got error"), dirname);

Likewise.

Hui> +      if (strcmp (bt_ctf_field_name(list_d[i]), name) == 0)

Missing a space before a paren.  This happens in a few spots.

Hui> +  /* XXX: some types are not support.  */

How about an error in this case?
No new FIXME comments anyway.

Hui> +extern void output_command (char *, int);

Time for this to go into a header file.

Hui> --- a/target.h
Hui> +++ b/target.h
Hui> @@ -811,6 +811,10 @@ struct target_ops
Hui>         successful, 0 otherwise.  */
Hui>      int (*to_set_trace_notes) (char *user, char *notes, char* stopnotes);
 
Hui> +    const char *(*to_get_current_tracepoint_name) (void);
Hui> +
Hui> +    int (*to_trace_dump) (int from_tty);

These sorts of additions particularly need documentation.

Hui> +#define target_get_current_tracepoint_name() \
Hui> +(*current_target.to_get_current_tracepoint_name) ()
Hui> +
Hui> +#define target_trace_dump(from_tty) \
Hui> +(*current_target.to_trace_dump) (from_tty)

Formatting.

Hui> --- a/tracepoint.c
Hui> +++ b/tracepoint.c
Hui> @@ -2243,7 +2243,7 @@ tfind_1 (enum trace_find_type type, int
Hui>       below (correctly) decide to print out the source location of the
Hui>       trace frame.  */
Hui>    if (!(type == tfind_number && num == -1)
Hui> -      && (has_stack_frames () || traceframe_number >= 0))
Hui> +      && has_stack_frames ())

I'm curious about the rationale and impact of this change.

Tom


  reply	other threads:[~2012-11-29 20:42 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-21  1:45 Hui Zhu
2012-11-21  2:36 ` Yao Qi
2012-11-21  3:32   ` Hui Zhu
2012-11-27 10:55     ` Hui Zhu
2012-11-29 20:42       ` Tom Tromey [this message]
2012-12-21  8:23         ` Hui Zhu
2013-01-16 15:12           ` Abid, Hafiz
2013-01-23  5:54             ` Hui Zhu
2013-02-11 12:55               ` Hui Zhu
2012-11-21  4:29 ` Yao Qi
2012-11-29 20:24 ` Tom Tromey
2012-12-05  6:59   ` Hui Zhu
2012-11-29 20:47 ` Tom Tromey
2012-12-06 13:37   ` Hui Zhu

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=87zk203zw3.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=hui_zhu@mentor.com \
    --cc=teawater@gmail.com \
    --cc=yao@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