Commit b2244e22 by Jim Wilson Committed by Jim Wilson

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
parent 26612c79
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> Thu Aug 26 16:10:56 1999 Gavin Romig-Koch <gavin@cygnus.com>
* tree.c (lang_unsave_expr_now) : Correct return type. * tree.c (lang_unsave_expr_now) : Correct return type.
......
...@@ -2237,6 +2237,11 @@ extern char *language_string; ...@@ -2237,6 +2237,11 @@ extern char *language_string;
#define DWARF_ARANGES_HEADER_SIZE \ #define DWARF_ARANGES_HEADER_SIZE \
(DWARF_ROUND (2 * DWARF_OFFSET_SIZE + 4, PTR_SIZE * 2) - DWARF_OFFSET_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). /* Define the architecture-dependent minimum instruction length (in bytes).
In this implementation of DWARF, this field is used for information In this implementation of DWARF, this field is used for information
purposes only. Since GCC generates assembly language, we have purposes only. Since GCC generates assembly language, we have
...@@ -4446,7 +4451,8 @@ debug_dwarf () ...@@ -4446,7 +4451,8 @@ debug_dwarf ()
{ {
print_indent = 0; print_indent = 0;
print_die (comp_unit_die, stderr); 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 /* Traverse the DIE, and add a sibling attribute if it may have the
...@@ -9850,7 +9856,27 @@ dwarf2out_line (filename, line) ...@@ -9850,7 +9856,27 @@ dwarf2out_line (filename, line)
{ {
function_section (current_function_decl); 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; register dw_separate_line_info_ref line_info;
ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, SEPARATE_LINE_CODE_LABEL, ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, SEPARATE_LINE_CODE_LABEL,
...@@ -10097,9 +10123,12 @@ dwarf2out_finish () ...@@ -10097,9 +10123,12 @@ dwarf2out_finish ()
/* Output the source line correspondence table. */ /* Output the source line correspondence table. */
if (line_info_table_in_use > 1 || separate_line_info_table_in_use) if (line_info_table_in_use > 1 || separate_line_info_table_in_use)
{ {
fputc ('\n', asm_out_file); if (! DWARF2_ASM_LINE_DEBUG_INFO)
ASM_OUTPUT_SECTION (asm_out_file, DEBUG_LINE_SECTION); {
output_line_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 /* We can only use the low/high_pc attributes if all of the code
was in .text. */ was in .text. */
......
...@@ -6943,6 +6943,12 @@ label to mark the beginning of the text section. If it is better simply ...@@ -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 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. 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{} @findex PUT_SDB_@dots{}
@item PUT_SDB_@dots{} @item PUT_SDB_@dots{}
Define these macros to override the assembler syntax for the special Define these macros to override the assembler syntax for the special
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment