diff options
author | Ian Lance Taylor <ian@airs.com> | 1994-05-11 16:46:04 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1994-05-11 16:46:04 +0000 |
commit | 4fa4476bf86ec660c4a7c279e91d7df7f7ec24f3 (patch) | |
tree | 6664cf4b62449a6b7b17059b25d2a6c8fe79a491 /bfd/ecoff.c | |
parent | 1cfc93e10dc04430a5b9903a5cda258f61e5296b (diff) | |
download | gdb-4fa4476bf86ec660c4a7c279e91d7df7f7ec24f3.zip gdb-4fa4476bf86ec660c4a7c279e91d7df7f7ec24f3.tar.gz gdb-4fa4476bf86ec660c4a7c279e91d7df7f7ec24f3.tar.bz2 |
* ecoff.c (ecoff_find_nearest_line): Handle fdr.adr != pdr.adr
correctly.
Diffstat (limited to 'bfd/ecoff.c')
-rw-r--r-- | bfd/ecoff.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/bfd/ecoff.c b/bfd/ecoff.c index ba5214c..83a3c22 100644 --- a/bfd/ecoff.c +++ b/bfd/ecoff.c @@ -2007,6 +2007,7 @@ ecoff_find_nearest_line (abfd, char *pdr_ptr; char *pdr_end; PDR pdr; + bfd_vma first_off; unsigned char *line_ptr; unsigned char *line_end; int lineno; @@ -2052,10 +2053,12 @@ ecoff_find_nearest_line (abfd, + fdr_ptr->ipdFirst * external_pdr_size); pdr_end = pdr_ptr + fdr_ptr->cpd * external_pdr_size; (*debug_swap->swap_pdr_in) (abfd, (PTR) pdr_ptr, &pdr); + if (offset < pdr.adr) + return false; /* The address of the first PDR is an offset which applies to the addresses of all the PDR's. */ - offset += pdr.adr; + first_off = pdr.adr; for (pdr_ptr += external_pdr_size; pdr_ptr < pdr_end; @@ -2080,7 +2083,7 @@ ecoff_find_nearest_line (abfd, pdr_ptr -= external_pdr_size; (*debug_swap->swap_pdr_in) (abfd, (PTR) pdr_ptr, &pdr); - offset -= pdr.adr; + offset -= pdr.adr - first_off; lineno = pdr.lnLow; line_ptr = (ecoff_data (abfd)->debug_info.line + fdr_ptr->cbLineOffset |