aboutsummaryrefslogtreecommitdiff
path: root/gdb/partial-stab.h
diff options
context:
space:
mode:
authorStu Grossman <grossman@cygnus>1992-07-16 20:40:36 +0000
committerStu Grossman <grossman@cygnus>1992-07-16 20:40:36 +0000
commitcdaa27e9ae0eb4ef1d53ede0a7b7c0fef6dfa7c3 (patch)
tree5a87b5f6f7fc0a41ae1777af1bfc6fdd233e0c04 /gdb/partial-stab.h
parent345e9ab8dc26cad486eeb628e5a9d420539bd477 (diff)
downloadgdb-cdaa27e9ae0eb4ef1d53ede0a7b7c0fef6dfa7c3.zip
gdb-cdaa27e9ae0eb4ef1d53ede0a7b7c0fef6dfa7c3.tar.gz
gdb-cdaa27e9ae0eb4ef1d53ede0a7b7c0fef6dfa7c3.tar.bz2
* Makefile.in (OTHERS): Add gcc.patch.
* partial-stab.h (N_SO): Fix handling of redundant SOs (again...)
Diffstat (limited to 'gdb/partial-stab.h')
-rw-r--r--gdb/partial-stab.h66
1 files changed, 31 insertions, 35 deletions
diff --git a/gdb/partial-stab.h b/gdb/partial-stab.h
index a0ad20d..9af5b8d 100644
--- a/gdb/partial-stab.h
+++ b/gdb/partial-stab.h
@@ -198,27 +198,35 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
case N_SO: {
unsigned long valu = CUR_SYMBOL_VALUE;
- static int last_so_symnum = -10;
- static int dir_so_symnum = -10;
- int tmp;
+ static int prev_so_symnum = -10;
+ static int first_so_symnum;
char *p;
+ past_first_source_file = 1;
+
+ if (prev_so_symnum != symnum - 1)
+ { /* Here if prev stab wasn't N_SO */
+ first_so_symnum = symnum;
+
+ if (pst)
+ {
+ END_PSYMTAB (pst, psymtab_include_list, includes_used,
+ symnum * symbol_size, valu,
+ dependency_list, dependencies_used);
+ pst = (struct partial_symtab *) 0;
+ includes_used = 0;
+ dependencies_used = 0;
+ }
+ }
+
+ prev_so_symnum = symnum;
+
/* End the current partial symtab and start a new one */
SET_NAMESTRING();
valu += ANOFFSET (section_offsets, SECT_OFF_TEXT);
- if (pst)
- {
- END_PSYMTAB (pst, psymtab_include_list, includes_used,
- symnum * symbol_size, valu,
- dependency_list, dependencies_used);
- pst = (struct partial_symtab *) 0;
- includes_used = 0;
- dependencies_used = 0;
- }
-
/* Some compilers (including gcc) emit a pair of initial N_SOs.
The first one is a directory name; the second the file name.
If pst exists, is empty, and has a filename ending in '/',
@@ -226,30 +234,18 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
p = strrchr (namestring, '/');
if (p && *(p+1) == '\000')
- {
- dir_so_symnum = symnum;
- continue; /* Simply ignore directory name SOs */
- }
+ continue; /* Simply ignore directory name SOs */
/* Some other compilers (C++ ones in particular) emit useless
- SOs for non-existant .c files. */
-
- if (last_so_symnum == symnum - 1)
- continue; /* Ignore repeated SOs */
- last_so_symnum = symnum;
-
- past_first_source_file = 1;
-
- if (dir_so_symnum == symnum - 1) /* Was prev. SO a directory? */
- tmp = dir_so_symnum;
- else
- tmp = symnum;
- pst = START_PSYMTAB (objfile, section_offsets,
- namestring, valu,
- tmp * symbol_size,
- objfile -> global_psymbols.next,
- objfile -> static_psymbols.next);
- dir_so_symnum = -10;
+ SOs for non-existant .c files. We ignore all subsequent SOs that
+ immediately follow the first. */
+
+ if (!pst)
+ pst = START_PSYMTAB (objfile, section_offsets,
+ namestring, valu,
+ first_so_symnum * symbol_size,
+ objfile -> global_psymbols.next,
+ objfile -> static_psymbols.next);
continue;
}