* [COMMIT] frv-linux-tdep.c: Adjust an RT signal related constant
@ 2005-03-18 20:28 Kevin Buettner
2005-03-19 10:09 ` Eli Zaretskii
0 siblings, 1 reply; 3+ messages in thread
From: Kevin Buettner @ 2005-03-18 20:28 UTC (permalink / raw)
To: gdb-patches
I've just committed that patch below. Thanks to Richard Sandiford for
finding the problem and suggesting the fix. (This patch looks bigger
than it really is; it only touches one line of executable code. The
rest of the changes are updates to comments.)
* frv-linux-tdep.c (frv_linux_sigcontext_reg_addr): Update comments.
Adjust incorrectly computed constant for realtime signal frame.
Index: frv-linux-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/frv-linux-tdep.c,v
retrieving revision 1.5
diff -u -p -r1.5 frv-linux-tdep.c
--- frv-linux-tdep.c 11 Feb 2005 18:13:49 -0000 1.5
+++ frv-linux-tdep.c 18 Mar 2005 20:20:38 -0000
@@ -67,14 +67,14 @@ frv_linux_pc_in_sigtramp (CORE_ADDR pc,
return retval;
}
-/* Given NEXT_FRAME, "callee" frame of the sigtramp frame that we
+/* Given NEXT_FRAME, the "callee" frame of the sigtramp frame that we
wish to decode, and REGNO, one of the frv register numbers defined
in frv-tdep.h, return the address of the saved register (corresponding
to REGNO) in the sigtramp frame. Return -1 if the register is not
found in the sigtramp frame. The magic numbers in the code below
were computed by examining the following kernel structs:
- From arch/frvnommu/signal.c:
+ From arch/frv/kernel/signal.c:
struct sigframe
{
@@ -96,7 +96,7 @@ frv_linux_pc_in_sigtramp (CORE_ADDR pc,
uint32_t retcode[2];
};
- From include/asm-frvnommu/ucontext.h:
+ From include/asm-frv/ucontext.h:
struct ucontext {
unsigned long uc_flags;
@@ -106,14 +106,22 @@ frv_linux_pc_in_sigtramp (CORE_ADDR pc,
sigset_t uc_sigmask;
};
- From include/asm-frvnommu/sigcontext.h:
+ From include/asm-frv/signal.h:
+
+ typedef struct sigaltstack {
+ void *ss_sp;
+ int ss_flags;
+ size_t ss_size;
+ } stack_t;
+
+ From include/asm-frv/sigcontext.h:
struct sigcontext {
struct user_context sc_context;
unsigned long sc_oldmask;
} __attribute__((aligned(8)));
- From include/asm-frvnommu/registers.h:
+ From include/asm-frv/registers.h:
struct user_int_regs
{
unsigned long psr;
@@ -184,15 +192,19 @@ frv_linux_sigcontext_reg_addr (struct fr
else if (tramp_type == RT_SIGTRAMP)
{
/* For a realtime sigtramp frame, SP + 12 contains a pointer
- to the a ucontext struct. The ucontext struct contains
- a sigcontext struct starting 12 bytes in. */
+ to the a ucontext struct. The ucontext struct contains a
+ sigcontext struct starting 24 bytes in. (The offset of
+ uc_mcontext within struct ucontext is derived as follows:
+ stack_t is a 12-byte struct and struct sigcontext is
+ 8-byte aligned. This gives an offset of 8 + 12 + 4 (for
+ padding) = 24.) */
if (target_read_memory (sp + 12, buf, sizeof buf) != 0)
{
warning (_("Can't read realtime sigtramp frame."));
return 0;
}
sc_addr = extract_unsigned_integer (buf, sizeof buf);
- sc_addr += 12;
+ sc_addr += 24;
}
else
internal_error (__FILE__, __LINE__, _("not a signal trampoline"));
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [COMMIT] frv-linux-tdep.c: Adjust an RT signal related constant
2005-03-18 20:28 [COMMIT] frv-linux-tdep.c: Adjust an RT signal related constant Kevin Buettner
@ 2005-03-19 10:09 ` Eli Zaretskii
2005-03-21 18:13 ` Kevin Buettner
0 siblings, 1 reply; 3+ messages in thread
From: Eli Zaretskii @ 2005-03-19 10:09 UTC (permalink / raw)
To: Kevin Buettner; +Cc: gdb-patches
> Date: Fri, 18 Mar 2005 13:28:26 -0700
> From: Kevin Buettner <kevinb@redhat.com>
>
> + to the a ucontext struct. The ucontext struct contains a
^^^^^
A typo.
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [COMMIT] frv-linux-tdep.c: Adjust an RT signal related constant
2005-03-19 10:09 ` Eli Zaretskii
@ 2005-03-21 18:13 ` Kevin Buettner
0 siblings, 0 replies; 3+ messages in thread
From: Kevin Buettner @ 2005-03-21 18:13 UTC (permalink / raw)
To: gdb-patches
On Sat, 19 Mar 2005 12:05:48 +0200
"Eli Zaretskii" <eliz@gnu.org> wrote:
> > + to the a ucontext struct. The ucontext struct contains a
> ^^^^^
> A typo.
Thanks for catching this. I've just committed the following change:
* frv-linux-tdep.c (frv_linux_sigcontext_reg_addr): Fix typo in
comment.
Index: frv-linux-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/frv-linux-tdep.c,v
retrieving revision 1.6
diff -u -p -r1.6 frv-linux-tdep.c
--- frv-linux-tdep.c 18 Mar 2005 20:23:28 -0000 1.6
+++ frv-linux-tdep.c 21 Mar 2005 18:07:50 -0000
@@ -192,7 +192,7 @@ frv_linux_sigcontext_reg_addr (struct fr
else if (tramp_type == RT_SIGTRAMP)
{
/* For a realtime sigtramp frame, SP + 12 contains a pointer
- to the a ucontext struct. The ucontext struct contains a
+ to a ucontext struct. The ucontext struct contains a
sigcontext struct starting 24 bytes in. (The offset of
uc_mcontext within struct ucontext is derived as follows:
stack_t is a 12-byte struct and struct sigcontext is
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-03-21 18:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-18 20:28 [COMMIT] frv-linux-tdep.c: Adjust an RT signal related constant Kevin Buettner
2005-03-19 10:09 ` Eli Zaretskii
2005-03-21 18:13 ` Kevin Buettner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox