[RFC][PATCH 04/15] Fix crash in tstatus after detach

Wallin, Henrik Henrik.Wallin@windriver.com
Thu Oct 29 18:45:00 GMT 2015



2015-10-14 13:48 GMT+02:00 Gary Benson <gbenson@redhat.com>:
> Hi Henrik,
>
> henrik.wallin@windriver.com wrote:
>> diff --git a/gdb/common/agent.c b/gdb/common/agent.c
>> index 5c307290589d..c9b6c41bc4ff 100644
>> --- a/gdb/common/agent.c
>> +++ b/gdb/common/agent.c
>> @@ -73,9 +73,16 @@ static struct ipa_sym_addresses ipa_sym_addrs;
>>
>>  static int all_agent_symbols_looked_up = 0;
>>
>> +#ifdef GDBSERVER
>> +#include <inferiors.h>
>> +#endif
>>  int
>>  agent_loaded_p (void)
>>  {
>> +#ifdef GDBSERVER
>> +  if (current_thread == NULL)
>> +    return 0;
>> +#endif
>>    return all_agent_symbols_looked_up;
>>  }
>>
>
> Please don't introduce "#ifdef GDBSERVER" conditionals into common
> code, I spent some time removing them last year.  I know I didn't
> get them all, but the remaining two are on my hit list :)

Ok :)
I will check that.

thanks,
/ Henrik



More information about the Gdb-patches mailing list