On Fri, Jun 5, 2009 at 00:13, Andrew Morton wrote:
> On Fri, 5 Jun 2009 00:00:22 -0400 Mike Frysinger wrote:
>> your version after all requires every arch to copy & paste this crap:
>> static inline unsigned long instruction_pointer(struct pt_regs *regs)
>> {
>> return regs->ip;
>> }
>> static inline void instruction_pointer_set(struct pt_regs *regs,
>> unsigned long val)
>> {
>> regs->ip = val;
>> }
>>
>> and then actual usage turns into:
>> instruction_pointer_set(regs, instruction_pointer(regs) + foo);
>>
>> whereas mine is two lines:
>> #define instruction_pointer(regs) ((regs)->ip)
>> instruction_pointer(regs) += val;
>
> The aim isn't really to reduce the amount of typing one needs to do.
> Let's get things right, and if getting it right involves more typing
> then so be it.
the aim isnt to reduce typing (although that's a nice result), the aim
is to reduce the amount of work to (1) keep things in shape and (2)
force new ports to implement. the less code there is, the harder it
is for it to bitrot.
> If it really worries you then you could do
>
> #define GET_IP(regs) ((regs)->ip)
> #include <asm/generic/instruction_pointer.h>
>
> and
>
> static inline unsigned long instruction_pointer(struct pt_regs *regs)
> {
> return GET_IP(regs);
> }
>
> static inline void instruction_pointer_set(struct pt_regs *regs,
> unsigned long val)
> {
> GET_IP(regs) = val;
> }
>
> Note that GET_IP() is all-caps, which says "this is a macro".
>
> But I don't think it's worth the ickyness, unless we also incorporate
> kernel_stack_pointer(), frame_pointer(), user_stack_pointer() and
> perhaps the _set() versions of those also.
yes, having a layer along those lines would satisfy my previous points.
> Do we know how to implement instruction_pointer_set() on ia64, btw?
i havent a clue, but it doesnt matter in this case as ia64 doesnt
support KGDB. they can figure it out when they want to add KGDB
support :).
-mike
------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Kgdb-bugreport mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kgdb-bugreport