- i386bsd_sigcontext_pc_offset = offsetof (struct sigcontext, sc_pc);
-
- /* FreeBSD provides a kern.ps_strings sysctl that we can use to
- locate the sigtramp. That way we can still recognize a sigtramp
- if it's location is changed in a new kernel. Of course this is
- still based on the assumption that the sigtramp is placed
- directly under the location where the program arguments and
- environment can be found. */
-#ifdef KERN_PS_STRINGS
- {
- int mib[2];
- int ps_strings;
- size_t len;
-
- mib[0] = CTL_KERN;
- mib[1] = KERN_PS_STRINGS;
- len = sizeof (ps_strings);
- if (sysctl (mib, 2, &ps_strings, &len, NULL, 0) == 0)
- {
- i386bsd_sigtramp_start = ps_strings - 128;
- i386bsd_sigtramp_end = ps_strings;
- }
- }
-#endif
+ offset = offsetof (struct sigcontext, sc_pc);
+
+ if (SC_PC_OFFSET != offset)
+ {
+ warning (_("\
+offsetof (struct sigcontext, sc_pc) yields %d instead of %d.\n\
+Please report this to <bug-gdb@gnu.org>."),
+ offset, SC_PC_OFFSET);
+ }
+
+ SC_PC_OFFSET = offset;
+
+ /* Likewise for the stack pointer. */
+ offset = offsetof (struct sigcontext, sc_sp);
+
+ if (SC_SP_OFFSET != offset)
+ {
+ warning (_("\
+offsetof (struct sigcontext, sc_sp) yields %d instead of %d.\n\
+Please report this to <bug-gdb@gnu.org>."),
+ offset, SC_SP_OFFSET);
+ }
+
+ SC_SP_OFFSET = offset;
+
+ /* And the frame pointer. */
+ offset = offsetof (struct sigcontext, sc_fp);
+
+ if (SC_FP_OFFSET != offset)
+ {
+ warning (_("\
+offsetof (struct sigcontext, sc_fp) yields %d instead of %d.\n\
+Please report this to <bug-gdb@gnu.org>."),
+ offset, SC_FP_OFFSET);
+ }
+
+ SC_FP_OFFSET = offset;
+
+#endif /* SC_REG_OFFSET */