gdb changes (#26)

This commit is contained in:
Lightning 2022-10-28 22:57:54 -07:00 committed by GitHub
parent 9ecb77b91a
commit 80c3e66c48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -39,6 +39,8 @@ Boston, MA 02111-1307, USA. */
#undef TARGET_VERSION #undef TARGET_VERSION
#define TARGET_VERSION fprintf (stderr, " (MIPS GNU/ELF)"); #define TARGET_VERSION fprintf (stderr, " (MIPS GNU/ELF)");
extern char *current_function_name;
/* Output at beginning of assembler file. */ /* Output at beginning of assembler file. */
/* The .file command should always begin the output. */ /* The .file command should always begin the output. */
#undef ASM_FILE_START #undef ASM_FILE_START
@ -60,8 +62,8 @@ Boston, MA 02111-1307, USA. */
#define ASM_OUTPUT_SOURCE_LINE(FILE, LINE) \ #define ASM_OUTPUT_SOURCE_LINE(FILE, LINE) \
do { \ do { \
++sym_lineno; \ ++sym_lineno; \
fprintf ((FILE), ".LM%d:\n\t%s %d,0,%d,.LM%d\n", \ fprintf ((FILE), ".LM%d:\n\t%s %d,0,%d,.LM%d-%s\n", \
sym_lineno, ASM_STABN_OP, N_SLINE, (LINE), sym_lineno); \ sym_lineno, ASM_STABN_OP, N_SLINE, (LINE), sym_lineno, current_function_name); \
} while (0) } while (0)
#undef ASM_DECLARE_FUNCTION_NAME #undef ASM_DECLARE_FUNCTION_NAME

View File

@ -81,6 +81,8 @@ Boston, MA 02111-1307, USA. */
#include "defaults.h" #include "defaults.h"
#include "output.h" /* ASM_OUTPUT_SOURCE_LINE may refer to sdb functions. */ #include "output.h" /* ASM_OUTPUT_SOURCE_LINE may refer to sdb functions. */
char *current_function_name;
#ifndef errno #ifndef errno
extern int errno; extern int errno;
#endif #endif
@ -1670,6 +1672,7 @@ dbxout_symbol (decl, local)
IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)), IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)),
IDENTIFIER_POINTER (DECL_NAME (context))); IDENTIFIER_POINTER (DECL_NAME (context)));
current_function_name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
dbxout_finish_symbol (decl); dbxout_finish_symbol (decl);
break; break;