diff options
author | Jim Kingdon <jkingdon@engr.sgi.com> | 1993-03-17 19:17:47 +0000 |
---|---|---|
committer | Jim Kingdon <jkingdon@engr.sgi.com> | 1993-03-17 19:17:47 +0000 |
commit | 3e57da382693ac0f6d31389cd507696f9c93e0b9 (patch) | |
tree | 52493df47505b25334dbd80c431d64b34926ea26 | |
parent | 9d61147ec534c032a4099913a4836e85dfc51938 (diff) | |
download | gdb-3e57da382693ac0f6d31389cd507696f9c93e0b9.zip gdb-3e57da382693ac0f6d31389cd507696f9c93e0b9.tar.gz gdb-3e57da382693ac0f6d31389cd507696f9c93e0b9.tar.bz2 |
* xcoffread.c (MIN_TBTABSIZ): Change to 12.
-rw-r--r-- | gdb/ChangeLog | 2 | ||||
-rw-r--r-- | gdb/xcoffread.c | 11 |
2 files changed, 10 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 4da4f8b..58e75de 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,7 @@ Wed Mar 17 09:46:31 1993 Jim Kingdon (kingdon@cygnus.com) + * xcoffread.c (MIN_TBTABSIZ): Change to 12. + * xcoffread.c (xcoff_symfile_read): Only read stringtab and debugsec if there are a non-zero number of symbols. diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c index 84be25f..cbc2f73 100644 --- a/gdb/xcoffread.c +++ b/gdb/xcoffread.c @@ -750,9 +750,6 @@ retrieve_tracebackinfo (abfd, textsec, cs) { #define TBTABLE_BUFSIZ 2000 - /* Minimum buffer size to hold a traceback table. */ -#define MIN_TBTABSIZ 50 - static TracebackInfo tbInfo; struct tbtable *ptb; @@ -838,11 +835,19 @@ retrieve_tracebackinfo (abfd, textsec, cs) /* if we don't have the whole traceback table in the buffer, re-read the whole thing. */ + /* This is how much to read to get the traceback table. + 8 bytes of the traceback table are always present, plus we + look at parminfo. */ +#define MIN_TBTABSIZ 12 + if ((char*)pinsn > (buffer + bufferbytes - MIN_TBTABSIZ)) { /* In case if we are *very* close to the end of the text section and cannot read properly from that point on, abort by returning NULL. + + This could happen if the traceback table is only 8 bytes, + but we try to read 12 bytes of it. Handle this case more graciously -- FIXME */ if (!bfd_get_section_contents ( |