From: Andrew Morton <akpm@linux-foundation.org>
To: Mike Frysinger <vapier.adi@gmail.com>
Cc: tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com,
jason.wessel@windriver.com, kgdb-bugreport@lists.sourceforge.net,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kgdbts: unify/generalize gdb breakpoint adjustment
Date: Thu, 4 Jun 2009 21:13:50 -0700 [thread overview]
Message-ID: <20090604211350.9aafa731.akpm@linux-foundation.org> (raw)
In-Reply-To: <8bd0f97a0906042100j9a44f95g7d05a515725c9d5@mail.gmail.com>
On Fri, 5 Jun 2009 00:00:22 -0400 Mike Frysinger <vapier.adi@gmail.com> 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.
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.
Do we know how to implement instruction_pointer_set() on ia64, btw?
next prev parent reply other threads:[~2009-06-05 4:14 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-02 7:17 [PATCH] kgdbts: unify/generalize gdb breakpoint adjustment Mike Frysinger
2009-06-05 0:50 ` Andrew Morton
2009-06-05 0:55 ` Mike Frysinger
2009-06-05 1:04 ` Andrew Morton
2009-06-05 1:50 ` Mike Frysinger
2009-06-05 2:27 ` Andrew Morton
2009-06-05 4:00 ` Mike Frysinger
2009-06-05 4:13 ` Andrew Morton [this message]
2009-06-05 4:19 ` Mike Frysinger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090604211350.9aafa731.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=hpa@zytor.com \
--cc=jason.wessel@windriver.com \
--cc=kgdb-bugreport@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=vapier.adi@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox