+Fri Apr 3 12:17:14 1992 Per Bothner (bothner@cygnus.com)
+
+ * munch: Must pre-pend "_" to "initialize" for SYSV style nm.
+ * tm-rs6000.h, xcoffexec.c, xcoffread.c, xm-rs6000.h:
+ Merge in more patches for rs6000 from Metin Ozisik.
+ * utils.c: Fix typo in comment.
+
Fri Apr 3 11:23:03 1992 Fred Fish (fnf@cygnus.com)
* procfs.c (procinfo struct): Add nopass_next_sigstop member.
elif test "`$MUNCH_NM main.o | egrep '[TD] _?main$'`" = "" ; then
# System V style nm
shift;
- $MUNCH_NM $* | egrep '^(.*[^a-zA-Z_]_|_)_?initialize_.*' | egrep '\.text'|\
- sed -e 's/^.*\(_initialize_[a-zA-Z0-9_]*\)/ {extern void \1 (); \1 ();}/'
+ $MUNCH_NM $* | egrep '_initialize_.*' | egrep '\.text'|\
+ sed -e 's/^.*\(_initialize_[a-zA-Z0-9_]*\).*/ {extern void \1 (); \1 ();}/'
else
# BSD style nm
# We now accept either text or data symbols, since the RT/PC uses data.
} while (0)
-#if 0
- The following comment is not correct anymore. AIX has a trap signal
- that might be sent with a "stopped after a load" status. This might
- show up when the inferior is just started, or anytime inferior
- loads something else. It is incorrect to try to skip over it *only* in
- startup-time. It always has to be ignored and should not be mixed up
- with breakpoint traps. See the macro SIGTRAP_STOP_AFTER_LOAD and its
- usage in infrun.c.
-
-/* In aix, number of the trap signals we need to skip over once the
- inferior process starts running is different in version 3.1 and 3.2.
- This will be 2 for version 3.1x, 3 for version 3.2x. */
-
-#define START_INFERIOR_TRAPS_EXPECTED aix_starting_inferior_traps ()
-#endif /* 0 */
+/* Number of trap signals we need to skip over, once the inferior process
+ starts running. */
#define START_INFERIOR_TRAPS_EXPECTED 2
/* AIX might return a sigtrap, with a "stop after load" status. It should
be ignored by gdb, shouldn't be mixed up with breakpoint traps. */
+/* Another little glitch in AIX is signal 0. I have no idea why wait(2)
+ returns with this status word. It looks harmless. */
+
#define SIGTRAP_STOP_AFTER_LOAD(W) \
- if ( (W) == 0x57c ) { \
- if (breakpoints_inserted) { \
+ if ( (W) == 0x57c || (W) == 0x7f) { \
+ if ((W)==0x57c && breakpoints_inserted) { \
mark_breakpoints_out (); \
insert_breakpoints (); \
insert_step_breakpoint (); \
for (; s; s = s->next)
if (!s->nonreloc || LINETABLE(s))
vmap_symtab_1(s, vp, old_start);
+
+#if 0
+ Himm.., recently we nullified trampoline entry names in order not
+ to confuse them with real symbols. Appearently this turned into a
+ problem, and msymbol vector did not get relocated properly. If
+ msymbols have to have non-null names, then we should name
+ trampoline entries with empty strings.
+
+ ALL_MSYMBOLS (objfile, msymbol)
+#else
+ for (msymbol = objfile->msymbols;
+ msymbol->name || msymbol->address; (msymbol)++)
+#endif
+ if (msymbol->address < TEXT_SEGMENT_BASE)
+ msymbol -> address += vp->tstart - old_start;
+
break;
}
}
}
if (vp->tstart != old_start) {
+
+#if 0
+ We don't have a valid `objfile' at this point. This is moved into the
+ previous statement; ALL_OBJFILES() for-loop.
+
ALL_MSYMBOLS (objfile, msymbol)
if (msymbol->address < TEXT_SEGMENT_BASE)
msymbol -> address += vp->tstart - old_start;
+#endif /* 0 */
/* breakpoints need to be relocated as well. */
fixup_breakpoints (0, TEXT_SEGMENT_BASE, vp->tstart - old_start);
}
-static void
-dumpIncludeChain ()
-{
- int ii;
- if (inclTable && inclLength)
- for (ii=0; ii < inclIndx; ++ii)
- printf ("name: %s, begin: 0x%x, end: 0x%x\n",
- inclTable[ii].name, inclTable[ii].begin, inclTable[ii].end);
-}
-
-
/* given the start and end addresses of a compilation unit (or a csect, at times)
process its lines and create appropriate line vectors. */
first_fun_line_offset = 0;
if (inclIndx == 0)
+ /* All source lines were in the main source file. None in include files. */
+
enter_line_range (&main_subfile, offset, 0, start, end,
&main_source_baseline);
current_subfile->line_vector_length =
current_subfile->line_vector->nitems;
-
+ }
/* Now, process included files' line numbers. */
start_subfile (pop_subfile (), (char*)0);
}
}
- }
- else
- /* I am not sure this logic is correct. There might be no lines in the
- main file, whereas there are some in included ones. FIXMEibm */
- current_subfile->line_vector = NULL;
return_after_cleanup:
/* keep reading blocks of data from the text section, until finding a zero
word and a traceback table. */
- while (bfd_get_section_contents (abfd, textsec, buffer,
- (file_ptr)(functionstart + bytesread),
+ while (
bufferbytes = (
(TBTABLE_BUFSIZ < (textsec->_raw_size - functionstart - bytesread)) ?
- TBTABLE_BUFSIZ : (textsec->_raw_size - functionstart - bytesread))))
+ TBTABLE_BUFSIZ : (textsec->_raw_size - functionstart - bytesread))
+
+ && bfd_get_section_contents (abfd, textsec, buffer,
+ (file_ptr)(functionstart + bytesread), bufferbytes))
{
bytesread += bufferbytes;
pinsn = (int*) buffer;
int next_file_symnum = -1;
int just_started = 1;
int depth = 0;
+ int toc_offset = 0; /* toc offset value in data section. */
int val;
int fcn_last_line;
int fcn_start_addr;
uninitialized data will show up as XTY_CM/XMC_RW pair. */
case XMC_TC0:
-#ifdef XCOFF_ADD_TOC_TO_LOADINFO
- XCOFF_ADD_TOC_TO_LOADINFO (cs->c_value);
-#endif
- /* fall down to default case. */
+ if (toc_offset)
+ warning ("More than one xmc_tc0 symbol found.");
+ toc_offset = cs->c_value;
+ continue;
case XMC_TC : /* ignore toc entries */
default : /* any other XMC_XXX */
free (symtbl);
current_objfile = NULL;
+
+ /* Record the toc offset value of this symbol table into ldinfo structure.
+ If no XMC_TC0 is found, toc_offset should be zero. Another place to obtain
+ this information would be file auxiliary header. */
+
+ xcoff_add_toc_to_loadinfo (toc_offset);
}
#define SYMBOL_DUP(SYMBOL1, SYMBOL2) \
init_minimal_symbol_collection ();
make_cleanup (discard_minimal_symbols, 0);
-#ifdef XCOFF_INIT_LOADINFO
+ /* Initialize load info structure. */
if (mainline)
- XCOFF_INIT_LOADINFO ();
-#endif
+ xcoff_init_loadinfo ();
/* Now that the executable file is positioned at symbol table,
process it and define symbols accordingly. */
#define NO_SINGLE_STEP
-/* Interface between xcoff symbol reading code and AIX shared library
- handling code. FIXME, this probably needs generalizing. */
-
-#define XCOFF_INIT_LOADINFO() xcoff_init_loadinfo()
-#define XCOFF_ADD_TOC_TO_LOADINFO(x) xcoff_add_toc_to_loadinfo (x)
-
/* AIX's assembler doesn't grok dollar signs in identifiers.
So we use dots instead. This item must be coordinated with G++. */
#undef CPLUS_MARKER