This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: RFA: [Ada] extract known tasks array parameters from symbol table
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Tristan Gingold <gingold at adacore dot com>
- Cc: "gdb-patches at sourceware dot org ml" <gdb-patches at sourceware dot org>
- Date: Mon, 13 Feb 2012 08:15:29 -0800
- Subject: Re: RFA: [Ada] extract known tasks array parameters from symbol table
- References: <7A06C670-A574-4AE4-A89C-2532671E5F64@adacore.com>
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 <gingold@adacore.com>
>
> * 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