Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Cc: Joel Brobecker <brobecker@adacore.com>
Subject: Re: [PATCH 2/2] Add support for GNAT Ravenscar run-time library.
Date: Thu, 23 Sep 2010 22:09:00 -0000	[thread overview]
Message-ID: <201009232049.37585.pedro@codesourcery.com> (raw)
In-Reply-To: <1285267380-8329-3-git-send-email-brobecker@adacore.com>

On a cursory look, here's what I noted, minus issues already
mentioned:

> +static const char *running_thread_name = "running_thread";

static const char running_thread_name[] = "running_thread";

> +  int buf_size = register_size (gdbarch, regnum);
> +  char buf [buf_size];

This is not valid C90.  Use alloca or MAX_REGISTER_SIZE.

> +      && strcmp (target_shortname, ravenscar_ops.to_shortname) != 0)

Please no target name comparisions.  You want "is the ravenscar open, even
if something else is on top", not "is the ravenscar target open
and the topmost".

> +/* Observer on inferior_created: push ravenscar thread stratum if needed.  */
> +
> +static void
> +ravenscar_inferior_created (struct target_ops *target, int from_tty)
> +{
> +  if (ravenscar_task_support
> +      && has_ravenscar_runtime ()
> +      && strcmp (target_shortname, ravenscar_ops.to_shortname) != 0)
> +    ravenscar_initialize (NULL, 0);
> +}

Note that this assumes that the user connects with symbols already
loaded.  If you connect, and then do "file foo", ravenscar will not
end pushed.

> +  ravenscar_ops.to_shortname         = "ravenscar";
> +  ravenscar_ops.to_longname          = "Ravenscar tasks.";
> +  ravenscar_ops.to_doc               = "Ravenscar tasks support.";
> +  ravenscar_ops.to_wait              = ravenscar_wait;

Please no vertical alignment.

> +
> +  add_setshow_boolean_cmd ("task-switching", class_obscure,
> +                           &ravenscar_task_support, _("\
> +Enable or disable support for GNAT Ravenscar tasks"), _("\
> +Show whether supported for GNAT Ravenscar tasks is enabled"),
> +                           _("\
> +Enable or disable support for task/thread switching\n\
> +with the GNAT Ravenscar run-time lib for bareboard configuration."),
> +                            NULL, NULL, &set_ravenscar_list,
> +                          &show_ravenscar_list);

Please implement show_func callbacks for all new set/show commands.

-- 
Pedro Alves


  parent reply	other threads:[~2010-09-23 19:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-23 19:01 Joel Brobecker
2010-09-23 19:44 ` [PATCH 1/2] [Ada] Add ada-tasks.c:iterate_over_live_ada_tasks Joel Brobecker
2010-09-29  3:25   ` Joel Brobecker
2010-09-23 19:49 ` [PATCH 2/2] Add support for GNAT Ravenscar run-time library Joel Brobecker
2010-09-23 21:56   ` Joel Brobecker
2010-09-23 21:58   ` Jan Kratochvil
2010-09-23 22:09   ` Pedro Alves [this message]
2010-09-23 23:39     ` Joel Brobecker
2010-09-24  1:39       ` Pedro Alves
2010-09-27 18:59         ` Joel Brobecker
2010-09-27 19:01           ` Pedro Alves
2010-09-28 14:55             ` Joel Brobecker
2010-09-29  9:52               ` Joel Brobecker

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=201009232049.37585.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /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