From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 993 invoked by alias); 23 Sep 2010 19:49:51 -0000 Received: (qmail 979 invoked by uid 22791); 23 Sep 2010 19:49:50 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 23 Sep 2010 19:49:43 +0000 Received: (qmail 7488 invoked from network); 23 Sep 2010 19:49:40 -0000 Received: from unknown (HELO orlando.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 23 Sep 2010 19:49:40 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [PATCH 2/2] Add support for GNAT Ravenscar run-time library. Date: Thu, 23 Sep 2010 22:09:00 -0000 User-Agent: KMail/1.13.2 (Linux/2.6.33-29-realtime; KDE/4.4.2; x86_64; ; ) Cc: Joel Brobecker References: <1285267380-8329-1-git-send-email-brobecker@adacore.com> <1285267380-8329-3-git-send-email-brobecker@adacore.com> In-Reply-To: <1285267380-8329-3-git-send-email-brobecker@adacore.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201009232049.37585.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-09/txt/msg00418.txt.bz2 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