-#define MAX_LOAD_SEGS 64 /* maximum number of load segments */
-
- struct ld_info *ldi;
- int temp;
-
- ldi = (void *) alloca(MAX_LOAD_SEGS * sizeof (*ldi));
-
- /* According to my humble theory, AIX has some timing problems and
- when the user stack grows, kernel doesn't update stack info in time
- and ptrace calls step on user stack. That is why we sleep here a little,
- and give kernel to update its internals. */
-
- usleep (36000);
-
- errno = 0;
- ptrace(PT_LDINFO, pid, (PTRACE_ARG3_TYPE) ldi,
- MAX_LOAD_SEGS * sizeof(*ldi), ldi);
- if (errno) {
- perror_with_name ("ptrace ldinfo");
- return 0;
+ FRAME_ADDR fp;
+ if (inside_entry_file ((thisframe)->pc))
+ return 0;
+ if (thisframe->signal_handler_caller)
+ {
+ /* This was determined by experimentation on AIX 3.2. Perhaps
+ it corresponds to some offset in /usr/include/sys/user.h or
+ something like that. Using some system include file would
+ have the advantage of probably being more robust in the face
+ of OS upgrades, but the disadvantage of being wrong for
+ cross-debugging. */
+
+#define SIG_FRAME_FP_OFFSET 284
+ fp = read_memory_integer (thisframe->frame + SIG_FRAME_FP_OFFSET, 4);