dbxout.c (dbxout_begin_prologue): New function.

* dbxout.c (dbxout_begin_prologue): New function.
        (dbx_debug_hooks): Use new begin prologue hook.
        (dbxout_function_end): Emit N_ENSYM.
        * stab.def (N_BNSYM, N_ENSYM): Define and document these two new stabs.

        testsuite:
        gcc.dg/darwin-20040809-2.c: New test.

From-SVN: r85908
This commit is contained in:
Devang Patel 2004-08-12 14:32:56 -07:00 committed by Devang Patel
parent 950a175b04
commit 8fa5469d38
5 changed files with 50 additions and 4 deletions

View File

@ -1,3 +1,10 @@
2004-08-12 Devang patel <dpatel@apple.com>
* dbxout.c (dbxout_begin_prologue): New function.
(dbx_debug_hooks): Use new begin prologue hook.
(dbxout_function_end): Emit N_ENSYM.
* stab.def (N_BNSYM, N_ENSYM): Define and document these two new stabs.
2004-08-12 Janis Johnson <janis187@us.ibm.com>
* config/rs6000/altivec.h (vec_dst): Fix C++ functions whose first

View File

@ -372,6 +372,7 @@ static void dbxout_handle_pch (unsigned);
#if defined (DBX_DEBUGGING_INFO)
static void dbxout_source_line (unsigned int, const char *);
static void dbxout_begin_prologue (unsigned int, const char *);
static void dbxout_source_file (FILE *, const char *);
static void dbxout_function_end (void);
static void dbxout_begin_function (tree);
@ -391,8 +392,7 @@ const struct gcc_debug_hooks dbx_debug_hooks =
dbxout_end_block,
debug_true_tree, /* ignore_block */
dbxout_source_line, /* source_line */
dbxout_source_line, /* begin_prologue: just output
line info */
dbxout_begin_prologue, /* begin_prologue */
debug_nothing_int_charstar, /* end_prologue */
debug_nothing_int_charstar, /* end_epilogue */
#ifdef DBX_FUNCTION_FIRST
@ -481,6 +481,9 @@ dbxout_function_end (void)
assemble_name (asmfile, XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0));
fprintf (asmfile, "\n");
#endif
if (!flag_debug_only_used_symbols)
fprintf (asmfile, "%s%d,0,0\n", ASM_STABD_OP, N_ENSYM);
}
#endif /* DBX_DEBUGGING_INFO */
@ -753,6 +756,17 @@ dbxout_source_file (FILE *file, const char *filename)
}
}
/* Output N_BNSYM and line number symbol entry. */
static void
dbxout_begin_prologue (unsigned int lineno, const char *filename)
{
if (!flag_debug_only_used_symbols)
fprintf (asmfile, "%s%d,0,0\n", ASM_STABD_OP, N_BNSYM);
dbxout_source_line (lineno, filename);
}
/* Output a line number symbol entry for source file FILENAME and line
number LINENO. */

View File

@ -39,6 +39,12 @@ __define_stab (N_STSYM, 0x26, "STSYM")
/* BSS-segment variable with internal linkage. Value is its address. */
__define_stab (N_LCSYM, 0x28, "LCSYM")
/* Begin function marker. */
__define_stab (N_BNSYM, 0x2e, "BNSYM")
/* End function marker. */
__define_stab (N_ENSYM, 0x4e, "ENSYM")
/* Name of main routine. Only the name is significant.
This is not used in C. */
__define_stab (N_MAIN, 0x2a, "MAIN")
@ -201,11 +207,11 @@ __define_stab (N_LENG, 0xfe, "LENG")
|_______________________________________________|
| Debug entries with bit 01 set are unused. |
| 20 GSYM | 22 FNAME | 24 FUN | 26 STSYM |
| 28 LCSYM | 2A MAIN | 2C | 2E |
| 28 LCSYM | 2A MAIN | 2C | 2E BNSYM |
| 30 PC | 32 NSYMS | 34 NOMAP | 36 |
| 38 OBJ | 3A | 3C OPT | 3E |
| 40 RSYM | 42 M2C | 44 SLINE | 46 DSLINE |
| 48 BSLINE*| 4A DEFD | 4C | 4E |
| 48 BSLINE*| 4A DEFD | 4C | 4E ENSYM |
| 50 EHDECL*| 52 | 54 CATCH | 56 |
| 58 | 5A | 5C | 5E |
| 60 SSYM | 62 | 64 SO | 66 |

View File

@ -1,3 +1,7 @@
2004-08-12 Devang patel <dpatel@apple.com>
* gcc.dg/darwin-20040809-2.c: New test.
2004-08-12 Janis Johnson <janis1872us.ibm.com>
* g++.dg/ext/altivec-12.C: New test.

View File

@ -0,0 +1,15 @@
/* Test dead code strip support. */
/* Contributed by Devang Patel <dpatel@apple.com> */
/* { dg-do compile { target *-*-darwin* } } */
/* { dg-options "-g -fno-eliminate-unused-debug-symbols" } */
int
main ()
{
return 0;
}
/* { dg-final { scan-assembler ".stabd.46,0,0" } } */
/* { dg-final { scan-assembler ".stabd.78,0,0" } } */