(parse_args) : Accept new --gstabs+ option, and set `use_gnu_debug_info_extensions'.
(show_usage) : Document --gstabs+ option.
* as.h (use_gnu_debug_info_extensions) : New extern declaration.
* stabs.c (stabs_generate_asm_file) : If `use_gnu_debug_info_extensions' is set
add the compilation directory to the stabs debug info.
* doc/as.texinfo : Document --gstabs+ option.
* NEWS: Mention new feature.
+2003-10-08 Philippe De Muyter <phdm@macqel.be>
+
+ * as.c (use_gnu_debug_info_extensions) : New variable.
+ (parse_args) : Accept new --gstabs+ option, and set
+ `use_gnu_debug_info_extensions'.
+ (show_usage) : Document --gstabs+ option.
+ * as.h (use_gnu_debug_info_extensions) : New extern declaration.
+ * stabs.c (stabs_generate_asm_file) : If
+ `use_gnu_debug_info_extensions' is set, add the compilation
+ directory to the stabs debug info.
+ * doc/as.texinfo : Document --gstabs+ option.
+ * NEWS: Mention new feature.
+
2003-10-06 Matt Thomas <matt@3am-software.com>
Switch NetBSD/hppa to use Linux PA-RISC ELF ABI and
-*- text -*-
+* Added --gstabs+ switch to enable the generation of STABS debug format
+ information with GNU extensions.
+
* Added support for MIPS64 Release 2.
* Added support for v850e1.
/* Type of debugging to generate. */
enum debug_info_type debug_type = DEBUG_UNSPECIFIED;
+int use_gnu_debug_info_extensions = 0;
/* Maximum level of macro nesting. */
int max_macro_nest = 100;
fprintf (stream, _("\
--gstabs generate stabs debugging information\n"));
fprintf (stream, _("\
+ --gstabs+ generate stabs debug info with GNU extensions\n"));
+ fprintf (stream, _("\
--gdwarf2 generate DWARF2 debugging information\n"));
fprintf (stream, _("\
--help show this message and exit\n"));
OPTION_LISTING_CONT_LINES,
OPTION_DEPFILE,
OPTION_GSTABS,
+ OPTION_GSTABS_PLUS,
OPTION_STRIP_LOCAL_ABSOLUTE,
OPTION_TRADITIONAL_FORMAT,
OPTION_GDWARF2,
{"listing-cont-lines", required_argument, NULL, OPTION_LISTING_CONT_LINES},
{"MD", required_argument, NULL, OPTION_DEPFILE},
{"gstabs", no_argument, NULL, OPTION_GSTABS},
+ {"gstabs+", no_argument, NULL, OPTION_GSTABS_PLUS},
{"strip-local-absolute", no_argument, NULL, OPTION_STRIP_LOCAL_ABSOLUTE},
{"traditional-format", no_argument, NULL, OPTION_TRADITIONAL_FORMAT},
{"gdwarf2", no_argument, NULL, OPTION_GDWARF2},
start_dependencies (optarg);
break;
+ case OPTION_GSTABS_PLUS:
+ use_gnu_debug_info_extensions = 1;
+ /* Fall through. */
case OPTION_GSTABS:
debug_type = DEBUG_STABS;
break;
};
extern enum debug_info_type debug_type;
+extern int use_gnu_debug_info_extensions;
\f
/* Maximum level of macro nesting. */
extern int max_macro_nest;
@smallexample
@c man begin SYNOPSIS
@value{AS} [@b{-a}[@b{cdhlns}][=@var{file}]] [@b{-D}] [@b{--defsym} @var{sym}=@var{val}]
- [@b{-f}] [@b{--gstabs}] [@b{--gdwarf2}] [@b{--help}] [@b{-I} @var{dir}]
- [@b{-J}] [@b{-K}] [@b{-L}]
+ [@b{-f}] [@b{--gstabs}] [@b{--gstabs+}] [@b{--gdwarf2}] [@b{--help}]
+ [@b{-I} @var{dir}] [@b{-J}] [@b{-K}] [@b{-L}]
[@b{--listing-lhs-width}=@var{NUM}] [@b{--listing-lhs-width2}=@var{NUM}]
[@b{--listing-rhs-width}=@var{NUM}] [@b{--listing-cont-lines}=@var{NUM}]
[@b{--keep-locals}] [@b{-o} @var{objfile}] [@b{-R}] [@b{--statistics}] [@b{-v}]
Generate stabs debugging information for each assembler line. This
may help debugging assembler code, if the debugger can handle it.
+@item --gstabs+
+Generate stabs debugging information for each assembler line, with GNU
+extensions that probably only gdb can handle, and that could make other
+debuggers crash or refuse to read your program. This
+may help debugging assembler code. Currently the only GNU extension is
+the location of the current working directory at assembling time.
+
@item --gdwarf2
Generate DWARF2 debugging information for each assembler line. This
may help debugging assembler code, if the debugger can handle it. Note---this
@cindex @code{func} directive
@code{.func} emits debugging information to denote function @var{name}, and
is ignored unless the file is assembled with debugging enabled.
-Only @samp{--gstabs} is currently supported.
+Only @samp{--gstabs[+]} is currently supported.
@var{label} is the entry point of the function and if omitted @var{name}
prepended with the @samp{leading char} is used.
@samp{leading char} is usually @code{_} or nothing, depending on the target.
unsigned int lineno;
as_where (&file, &lineno);
+ if (use_gnu_debug_info_extensions)
+ {
+ char *dir, *dir2;
+
+ dir = getpwd ();
+ dir2 = alloca (strlen (dir) + 2);
+ sprintf (dir2, "%s%s", dir, "/");
+ generate_asm_file (N_SO, dir2);
+ }
generate_asm_file (N_SO, file);
}