This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFA: [Ada] extract known tasks array parameters from symbol table


On Feb 13, 2012, at 5:15 PM, Joel Brobecker wrote:

> 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.

Ok.  But how are debug infos for the ATCB read ?  Are they in the executable due to implicit with of ada.tasking ?

>> 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.

Ok, will do.

>> 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?

Sure.

> 
>> -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?

Will submit a new version.

Tristan.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]