Re: [PATCH] improve python finish breakpoint for exceptions/longjmp case.

Andrew Burgess
2012-10-24T20:48:31Z

Jan,

On 17/10/2012 5:27 PM, Jan Kratochvil wrote:

>
> [...]

>> +#include <pthread.h>
>> +#include <assert.h>
>> +#include <unistd.h>
>> +
>> +static volatile int blocks[2];
>> +
>> +void
>> +breakpt (int is_first_thread)
>> +{
>> + if (is_first_thread)
>> + {
>> + /* Main thread. */
>> +
>> + blocks[0] = 1; /* Set thread 2 going. */
>> + while (!blocks[1]); /* Wait for thread 2. */

>
> Also testcases should not remain hanging indefinitely if something breaks, in
> this case 'alarm (60);' at the start of 'main' should ensure that I think.

I'm confused why this test would need to take care of shutting itself down,
if the test failed would dejagnu not timeout the test, and eventually gdb
would exit taking down the inferior as it does?

I had a look for other tests that used alarm() but there are only a few and I
didn't think any of these were trying to perform a defensive shutdown as you're
suggesting, so can you point at any other test that needs to do this sort of
thing, or is there something special about this test?

Thanks,
Andrew