SCCS-vsn: contrib/gas-1.38/input-scrub.c 6.3
SCCS-vsn: contrib/gas-1.38/read.c 6.3
-/* @(#)input-scrub.c 6.2 (Berkeley) %G%
+/* @(#)input-scrub.c 6.3 (Berkeley) %G%
Modified for Berkeley Unix by Donn Seeley, donn@okeeffe.berkeley.edu */
Modified for Berkeley Unix by Donn Seeley, donn@okeeffe.berkeley.edu */
- * linestab() -- generate a line number stab for the current source line.
- * If the filename has changed, generate a file stab first.
+ * Support for source file debugging. These functions handle
+ * logical lines and logical files.
+static char *saved_file;
+static int saved_len;
+static line_numberT saved_line;
+
- static char *saved_file;
- static int saved_len;
- static line_numberT saved_line;
- if (!flagseen['g'] ||
- !physical_input_file ||
- !input_file_is_open() ||
- now_seg != SEG_TEXT)
+ if (!physical_input_file ||
+ !input_file_is_open())
return;
file = logical_input_file ? logical_input_file : physical_input_file;
return;
file = logical_input_file ? logical_input_file : physical_input_file;
- line = logical_input_line ? logical_input_line : physical_input_line;
if (saved_file == 0 || strcmp(file, saved_file) != 0)
{
if (saved_file == 0 || strcmp(file, saved_file) != 0)
{
strcpy(saved_file, file);
saved_line = 0;
}
strcpy(saved_file, file);
saved_line = 0;
}
+}
+
+void
+funcstab(func)
+ char *func;
+{
+ if (now_seg != SEG_TEXT)
+ return;
+
+ filestab();
+ stabf(func);
+}
+
+void
+linestab()
+{
+ line_numberT line;
+
+ if (now_seg != SEG_TEXT)
+ return;
+
+ filestab();
+
+ line = logical_input_line ? logical_input_line : physical_input_line;
if (saved_line == 0 || line != saved_line)
{
if (saved_line == 0 || line != saved_line)
{
-/* @(#)read.c 6.2 (Berkeley) %G%
+/* @(#)read.c 6.3 (Berkeley) %G%
Modified for Berkeley Unix by Donn Seeley, donn@okeeffe.berkeley.edu */
Modified for Berkeley Unix by Donn Seeley, donn@okeeffe.berkeley.edu */
- colon(s); /* user-defined label */
- stabf(s); /* set line number for function definition */
+ /* set line number for function definition */
+ funcstab(s);
+ colon(s); /* user-defined label */
* input_line_pointer ++ = ':'; /* Put ':' back for error messages' sake. */
/* Input_line_pointer -> after ':'. */
SKIP_WHITESPACE();
* input_line_pointer ++ = ':'; /* Put ':' back for error messages' sake. */
/* Input_line_pointer -> after ':'. */
SKIP_WHITESPACE();
* stabs(file), stabf(func) and stabd(line) -- for the purpose of
* source file debugging of assembly files, generate file,
* function and line number stabs, respectively.
* stabs(file), stabf(func) and stabd(line) -- for the purpose of
* source file debugging of assembly files, generate file,
* function and line number stabs, respectively.
- * stabs() and stabd() are normally called through a function linestab()
- * in input-scrub.c which understands about logical line numbers.
+ * These functions have corresponding functions named
+ * filestab(), funcstab() and linestab() in input-scrub.c,
+ * where logical files and logical line numbers are handled.
-static int stabs_done;
-
stabs(file)
char *file;
{
stabs(file)
char *file;
{
0,
obstack_next_free(& frags) - frag_now->fr_literal,
frag_now);
0,
obstack_next_free(& frags) - frag_now->fr_literal,
frag_now);
static int void_undefined = 1;
/* crudely filter uninteresting labels: require an initial '_' */
static int void_undefined = 1;
/* crudely filter uninteresting labels: require an initial '_' */
- if (now_seg != SEG_TEXT || *func++ != '_')
- /* don't emit a function stab until a file stab has been seen */
- if (!stabs_done)
- linestab();
-
/* assembly functions are assumed to have void type */
if (void_undefined)
{
/* assembly functions are assumed to have void type */
if (void_undefined)
{