aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJim Wilson <wilson@cygnus.com>1999-08-27 02:37:40 +0000
committerJim Wilson <wilson@gcc.gnu.org>1999-08-26 19:37:40 -0700
commitb2244e22a0cee5b617bc0619e5f8c2b11e14b2e1 (patch)
tree848c61a91662d479d931045e6aee44b755d53d5a /gcc
parent26612c795a5a069188b4a3019a0a92b7a442f141 (diff)
downloadgcc-b2244e22a0cee5b617bc0619e5f8c2b11e14b2e1.zip
gcc-b2244e22a0cee5b617bc0619e5f8c2b11e14b2e1.tar.gz
gcc-b2244e22a0cee5b617bc0619e5f8c2b11e14b2e1.tar.bz2
Add support for defering line number table construction to assembler.
* dwarf2out.c (DWARF2_ASM_LINE_DEBUG_INFO): Add default definition. (debug_dwarf): Add DWARF2_ASM_LINE_DEBUG_INFO support. (dwarf2out_line, dwarf2out_finish): Likewise. * tm.texi (DWARF2_ASM_LINE_DEBUG_INFO): Add documetation. From-SVN: r28910
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/dwarf2out.c39
-rw-r--r--gcc/tm.texi6
3 files changed, 47 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e1debc0..85b24a5 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+Thu Aug 26 19:33:23 1999 Jim Wilson <wilson@cygnus.com>
+
+ * dwarf2out.c (DWARF2_ASM_LINE_DEBUG_INFO): Add default definition.
+ (debug_dwarf): Add DWARF2_ASM_LINE_DEBUG_INFO support.
+ (dwarf2out_line, dwarf2out_finish): Likewise.
+ * tm.texi (DWARF2_ASM_LINE_DEBUG_INFO): Add documetation.
+
Thu Aug 26 16:10:56 1999 Gavin Romig-Koch <gavin@cygnus.com>
* tree.c (lang_unsave_expr_now) : Correct return type.
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index bcb9476..81792b5 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -2237,6 +2237,11 @@ extern char *language_string;
#define DWARF_ARANGES_HEADER_SIZE \
(DWARF_ROUND (2 * DWARF_OFFSET_SIZE + 4, PTR_SIZE * 2) - DWARF_OFFSET_SIZE)
+/* The default is to have gcc emit the line number tables. */
+#ifndef DWARF2_ASM_LINE_DEBUG_INFO
+#define DWARF2_ASM_LINE_DEBUG_INFO 0
+#endif
+
/* Define the architecture-dependent minimum instruction length (in bytes).
In this implementation of DWARF, this field is used for information
purposes only. Since GCC generates assembly language, we have
@@ -4446,7 +4451,8 @@ debug_dwarf ()
{
print_indent = 0;
print_die (comp_unit_die, stderr);
- print_dwarf_line_table (stderr);
+ if (! DWARF2_ASM_LINE_DEBUG_INFO)
+ print_dwarf_line_table (stderr);
}
/* Traverse the DIE, and add a sibling attribute if it may have the
@@ -9850,7 +9856,27 @@ dwarf2out_line (filename, line)
{
function_section (current_function_decl);
- if (DECL_SECTION_NAME (current_function_decl))
+ if (DWARF2_ASM_LINE_DEBUG_INFO)
+ {
+ static char *lastfile;
+
+ /* Emit the .file and .loc directives understood by GNU as. */
+ if (lastfile == 0 || strcmp (filename, lastfile))
+ {
+ fprintf (asm_out_file, "\t.file 0 \"%s\"\n", filename);
+ lastfile = filename;
+ }
+
+ fprintf (asm_out_file, "\t.loc 0 %d 0\n", line);
+
+ /* Indicate that line number info exists. */
+ ++line_info_table_in_use;
+
+ /* Indicate that multiple line number tables exist. */
+ if (DECL_SECTION_NAME (current_function_decl))
+ ++separate_line_info_table_in_use;
+ }
+ else if (DECL_SECTION_NAME (current_function_decl))
{
register dw_separate_line_info_ref line_info;
ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, SEPARATE_LINE_CODE_LABEL,
@@ -10097,9 +10123,12 @@ dwarf2out_finish ()
/* Output the source line correspondence table. */
if (line_info_table_in_use > 1 || separate_line_info_table_in_use)
{
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_SECTION (asm_out_file, DEBUG_LINE_SECTION);
- output_line_info ();
+ if (! DWARF2_ASM_LINE_DEBUG_INFO)
+ {
+ fputc ('\n', asm_out_file);
+ ASM_OUTPUT_SECTION (asm_out_file, DEBUG_LINE_SECTION);
+ output_line_info ();
+ }
/* We can only use the low/high_pc attributes if all of the code
was in .text. */
diff --git a/gcc/tm.texi b/gcc/tm.texi
index ed286fe..c3e3c27 100644
--- a/gcc/tm.texi
+++ b/gcc/tm.texi
@@ -6943,6 +6943,12 @@ label to mark the beginning of the text section. If it is better simply
to use the name of the text section itself, rather than an explicit label,
to indicate the beginning of the text section, define this macro to zero.
+@findex DWARF2_ASM_LINE_DEBUG_INFO
+@item DWARF2_ASM_LINE_DEBUG_INFO
+Define this macro to be a nonzero value if the assembler can generate Dwarf 2
+line debug info sections. This will result in much more compact line number
+tables, and hence is desirable if it works.
+
@findex PUT_SDB_@dots{}
@item PUT_SDB_@dots{}
Define these macros to override the assembler syntax for the special