This is the mail archive of the 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: [PATCH] improve python finish breakpoint for exceptions/longjmp case.


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?


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