From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16087 invoked by alias); 13 Feb 2012 16:16:01 -0000 Received: (qmail 16033 invoked by uid 22791); 13 Feb 2012 16:15:57 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 13 Feb 2012 16:15:38 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 0A22B1C63A4; Mon, 13 Feb 2012 11:15:33 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Q-icmU95hIHU; Mon, 13 Feb 2012 11:15:32 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id C65F61C6301; Mon, 13 Feb 2012 11:15:32 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 8FCC0145615; Mon, 13 Feb 2012 20:15:29 +0400 (RET) Date: Mon, 13 Feb 2012 16:16:00 -0000 From: Joel Brobecker To: Tristan Gingold Cc: "gdb-patches@sourceware.org ml" Subject: Re: RFA: [Ada] extract known tasks array parameters from symbol table Message-ID: <20120213161529.GE3474@adacore.com> References: <7A06C670-A574-4AE4-A89C-2532671E5F64@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7A06C670-A574-4AE4-A89C-2532671E5F64@adacore.com> User-Agent: Mutt/1.5.20 (2009-06-14) 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: 2012-02/txt/msg00238.txt.bz2 Hi Tristan, > Maybe we should get rid of the fallback, as without debug symbol for > Ada.Tasking, the whole ada-tasks.c code is pretty useless. The problem is that certain GNU/Linux distributions decided to simply strip all runtime libraries of debug info, and then provide additional packages for the debug version of these shared libs. And apparently, it's a significant disruption to address this issue at the package creation level. So we need to try to support those users the best we can. > Manually tested on ia64-hp-openvms. I'd really like it to be tested on at least a GNU/Linux variant as well as a bareboard variant using the ravenscar runtime (try the list). Or, alternatively, put the patch in our tree, and then wait a day or two to get the results of the nightly testing. > gdb/ > 2012-02-13 Tristan Gingold > > * ada-tasks.c (struct ada_tasks_inferior_data): Add > known_tasks_element and known_tasks_length fields. > (read_known_tasks_array): Change argument type. Use pointer type > and number of elements from DATA. Adjust. > (read_known_tasks_list): Likewise. > (get_known_tasks_addr): Change profile. Try symtab first, and > extract type and size from it. > (ada_set_current_inferior_known_tasks_addr): Adjust for above > change. Mostly OK. Just a few thoughts on your patch. > -/* Return the address of the variable NAME that contains all the known > - tasks maintained in the Ada Runtime. Return NULL if the variable > - could not be found, meaning that the inferior program probably does > - not use tasking. */ > +/* Try method KIND to extract known tasks info for DATA. > + Return non-zero in case of success, and set the known tasks field of DATA. > +*/ Nit-picking: Can you fold the last line at around 70 chars? > -static CORE_ADDR > -get_known_tasks_addr (const char *name) > +static int > +get_known_tasks_addr (struct ada_tasks_inferior_data *data, > + enum ada_known_tasks_kind kind) For this function, I would like it to be renamed to "get_ada_tasks_info", "get_inferior_tasks_info", or maybe even "ada_task_info_sniffer". Something like that. Also, I am thinking that there is no reason that the caller should be testing each kind one after the other. I think something like: static struct ada_tasks_inferior_data * ada_task_info_sniffer (void) { [lookup array symbol] if (symbol) { [validate] return array_info; } [lookup list symbol] if (symbol) { [validate] return list_info; } [...] WDYT? -- Joel