Re: [Kgdb-bugreport] [PATCH] kgdbts: only use new asm-generic/ptrace.hapi when needed

From: Mike Frysinger
Date: Mon May 30 2011 - 12:28:42 EST


On Mon, May 30, 2011 at 05:51, Sergei Shtylyov wrote:
> On 28-05-2011 18:04, Mike Frysinger wrote:
>> The new instruction_pointer_set helper is defined for people who have
>> converted to asm-generic/ptrace.h, so don't use it generally unless
>> the arch needs it (in which case it has been converted). ÂThis should
>> fix building of kgdb tests for arches not yet converted.
>
>> --- a/drivers/misc/kgdbts.c
>> +++ b/drivers/misc/kgdbts.c
>> @@ -304,7 +304,10 @@ static int check_and_rewind_pc(char *put_str, char
>> *arg)
>> Â Â Â Â Â Â Â Âreturn 1;
>> Â Â Â Â}
>> Â Â Â Â/* Readjust the instruction pointer if needed */
>> - Â Â Â instruction_pointer_set(&kgdbts_regs, ip + offset);
>> + Â Â Â ip += offset;
>
> Â Since 'Ãp' is local, incrementing it is pointless here unless you have
> GDB_ADJUSTS_BREAK_OFFSET defined. Why not keep instruction_pointer_set()
> call as is?

i prefer to have as much outside of ifdefs as possible. gcc optimizes
the result away, so it isnt a code size problem.
-mike
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/