aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEvgeny Karpov <evgeny.karpov@microsoft.com>2024-06-07 16:55:23 +0200
committerEvgeny Karpov <eukarpov@gmail.com>2024-11-19 14:27:32 +0100
commit9da72a62eca3e4226480110e660357ec687ee2dd (patch)
tree78637b782dfafe37afcb1afe9c34d9634d676212 /gcc
parent5181d982c34a38a552f6d4d19adb039171893ad7 (diff)
downloadgcc-9da72a62eca3e4226480110e660357ec687ee2dd.zip
gcc-9da72a62eca3e4226480110e660357ec687ee2dd.tar.gz
gcc-9da72a62eca3e4226480110e660357ec687ee2dd.tar.bz2
aarch64: Add debugging information
This patch enables DWARF and allows compilation with debugging information by using "gcc -g". The unwind info is disabled for the moment and will be revisited after SEH implementation for the target. gcc/ChangeLog: * config/aarch64/aarch64.cc (TARGET_ASM_UNALIGNED_HI_OP): Enable DWARF. (TARGET_ASM_UNALIGNED_SI_OP): Likewise. (TARGET_ASM_UNALIGNED_DI_OP): Likewise. * config/aarch64/cygming.h (DWARF2_DEBUGGING_INFO): Likewise. (PREFERRED_DEBUGGING_TYPE): Likewise. (DWARF2_UNWIND_INFO): Likewise. (ASM_OUTPUT_DWARF_OFFSET): Likewise.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/aarch64/aarch64.cc9
-rw-r--r--gcc/config/aarch64/cygming.h39
2 files changed, 47 insertions, 1 deletions
diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc
index f067242..d901340 100644
--- a/gcc/config/aarch64/aarch64.cc
+++ b/gcc/config/aarch64/aarch64.cc
@@ -31131,6 +31131,15 @@ aarch64_run_selftests (void)
#undef TARGET_ASM_ALIGNED_SI_OP
#define TARGET_ASM_ALIGNED_SI_OP "\t.word\t"
+#if TARGET_PECOFF
+#undef TARGET_ASM_UNALIGNED_HI_OP
+#define TARGET_ASM_UNALIGNED_HI_OP TARGET_ASM_ALIGNED_HI_OP
+#undef TARGET_ASM_UNALIGNED_SI_OP
+#define TARGET_ASM_UNALIGNED_SI_OP TARGET_ASM_ALIGNED_SI_OP
+#undef TARGET_ASM_UNALIGNED_DI_OP
+#define TARGET_ASM_UNALIGNED_DI_OP TARGET_ASM_ALIGNED_DI_OP
+#endif
+
#undef TARGET_ASM_CAN_OUTPUT_MI_THUNK
#define TARGET_ASM_CAN_OUTPUT_MI_THUNK \
hook_bool_const_tree_hwi_hwi_const_tree_true
diff --git a/gcc/config/aarch64/cygming.h b/gcc/config/aarch64/cygming.h
index bd60780..e4ceab8 100644
--- a/gcc/config/aarch64/cygming.h
+++ b/gcc/config/aarch64/cygming.h
@@ -21,8 +21,13 @@ along with GCC; see the file COPYING3. If not see
#ifndef GCC_AARCH64_CYGMING_H
#define GCC_AARCH64_CYGMING_H
+#define DWARF2_DEBUGGING_INFO 1
+
#undef PREFERRED_DEBUGGING_TYPE
-#define PREFERRED_DEBUGGING_TYPE DINFO_TYPE_NONE
+#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
+
+#undef DWARF2_UNWIND_INFO
+#define DWARF2_UNWIND_INFO 0
#define FASTCALL_PREFIX '@'
@@ -75,6 +80,38 @@ still needed for compilation. */
#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
mingw_pe_declare_function_type (FILE, XSTR (FUN, 0), 1)
+/* Use section relative relocations for debugging offsets. Unlike
+ other targets that fake this by putting the section VMA at 0, PE
+ won't allow it. */
+#define ASM_OUTPUT_DWARF_OFFSET(FILE, SIZE, LABEL, OFFSET, SECTION) \
+ do { \
+ switch (SIZE) \
+ { \
+ case 4: \
+ fputs ("\t.secrel32\t", FILE); \
+ assemble_name (FILE, LABEL); \
+ if ((OFFSET) != 0) \
+ fprintf (FILE, "+" HOST_WIDE_INT_PRINT_DEC, \
+ (HOST_WIDE_INT) (OFFSET)); \
+ break; \
+ case 8: \
+ /* This is a hack. There is no 64-bit section relative \
+ relocation. However, the COFF format also does not \
+ support 64-bit file offsets; 64-bit applications are \
+ limited to 32-bits of code+data in any one module. \
+ Fake the 64-bit offset by zero-extending it. */ \
+ fputs ("\t.secrel32\t", FILE); \
+ assemble_name (FILE, LABEL); \
+ if ((OFFSET) != 0) \
+ fprintf (FILE, "+" HOST_WIDE_INT_PRINT_DEC, \
+ (HOST_WIDE_INT) (OFFSET)); \
+ fputs ("\n\t.long\t0", FILE); \
+ break; \
+ default: \
+ gcc_unreachable (); \
+ } \
+ } while (0)
+
#define TARGET_OS_CPP_BUILTINS() \
do \
{ \