Re: linux native async mode support

Nick Roberts
2008-03-18T02:47:49Z

I've really gone through your patch to try to understand it, not review it
but you might as well have my thoughts.

> * linux-nat.h (re_check_for_thread_db): Declare.

recheck_for_thread_db (assuming it means "check again").

The word "re" on it's own is an abbreviation for "regarding" and
in GDB it's generally used for "regular expression".

>...
> +static void
> +clear_waitpid_queue (void)
> +{
> + struct waitpid_result *event = waitpid_queue;
> + while (event)
> + {
> + struct waitpid_result *next = event->next;
> + xfree (event);
> + event = next;
> + }
> + waitpid_queue = NULL;
> +}

struct waitpid_result *next, *event = waitpid_queue;
while (event)
{
next = event->next;
xfree (event);
event = next;

I guess the compiler will optimise it anyway but shouldn't
the declaration be outside the loop?

>...
> +/* Disable async mode. */
> +
> +static void
> +linux_nat_disable_async (void)

and

> +/* Enable async mode. */
> +
> +static void
> +linux_nat_enable_async (void)

Previously you've added linux_nat_async_events (int enable). So should
this be:

linux_nat_toggle_async (int enable)

for consistency? (or linux_nat_async_events -> linux_nat_async_disable_events
linux_nat_async_enable_events)

As a rule what does GDB do elsewhere in these situations?

>...
> + add_setshow_zinteger_cmd ("lin-lwp-async", no_class,
> + &debug_linux_nat_async, _("\
> +Set debugging of GNU/Linux async lwp module."), _("\
> +Show debugging of GNU/Linux async lwp module."), _("\
> +Enables printf debugging output."),
> + NULL,
> + show_debug_linux_nat_async,
> + &setdebuglist, &showdebuglist);

add_setshow_boolean_cmd ("lin-lwp-async", class_maintenance,

I guess you copied from "lin-lwp" but I think this should be
boolean too (only a few currently are: timestamp and xml)

The other "set debug" commands are also in class_maintenance, although
I'm not sure what effect that has here.

--
Nick http://www.inet.net.nz/~nickrob