diff options
author | Glen McCready <gkm@pobox.com> | 2000-04-25 17:55:36 +0000 |
---|---|---|
committer | Glen McCready <gkm@pobox.com> | 2000-04-25 17:55:36 +0000 |
commit | 380b774b2d908957081d89adce4dd5213e840bcc (patch) | |
tree | dd795fd2b7b3fc8df968187a712658c6e90eba44 /gdb/rs6000-nat.c | |
parent | 730a39a0a323fa371788285ed30c482bd93079a9 (diff) | |
download | gdb-380b774b2d908957081d89adce4dd5213e840bcc.zip gdb-380b774b2d908957081d89adce4dd5213e840bcc.tar.gz gdb-380b774b2d908957081d89adce4dd5213e840bcc.tar.bz2 |
Tue Apr 25 13:51:58 2000 glen mccready <gkm@pobox.com>
* rs6000-nat.c (xcoff_relocate_symtam): Recover from the wrong
patch being applied `Fri Apr 7 13:44:38 2000'.
Diffstat (limited to 'gdb/rs6000-nat.c')
-rw-r--r-- | gdb/rs6000-nat.c | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/gdb/rs6000-nat.c b/gdb/rs6000-nat.c index f4b2831..49b481d 100644 --- a/gdb/rs6000-nat.c +++ b/gdb/rs6000-nat.c @@ -640,39 +640,38 @@ xcoff_relocate_symtab (pid) unsigned int pid; { int load_segs = 64; /* number of load segments */ + int rc; + struct ld_info *ldi = NULL; do { - struct ld_info *ldi; - int rc; + ldi = (void *) xrealloc (ldi, load_segs * sizeof (*ldi)); - ldi = (void *) alloca (load_segs * sizeof (*ldi)); - if (ldi == 0) - perror_with_name ("xcoff_relocate_symtab"); + /* 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. */ - /* 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); - usleep (36000); - - errno = 0; + errno = 0; rc = ptrace (PT_LDINFO, pid, (PTRACE_ARG3_TYPE) ldi, - load_segs * sizeof (*ldi), (int *) ldi); + load_segs * sizeof (*ldi), (int *) ldi); if (rc == -1) { - if (errno == ENOMEM) - load_segs *= 2; - else - perror_with_name ("ptrace ldinfo"); + if (errno == ENOMEM) + load_segs *= 2; + else + perror_with_name ("ptrace ldinfo"); } else { - vmap_ldinfo (ldi); - vmap_exec (); /* relocate the exec and core sections as well. */ + vmap_ldinfo (ldi); + vmap_exec (); /* relocate the exec and core sections as well. */ } } while (rc == -1); + if (ldi) + free (ldi); } /* Core file stuff. */ |