This is the mail archive of the libc-ports@sources.redhat.com mailing list for the libc-ports project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Adding CFI statements to ARM's assembly code


Hello!

I'm working on adding CFI statements to ARM's assembly code, for a better
debugging experience, especially when stepping through the syscall stubs,
where GDB currently doesn't have proper frame unwinding information
available, and thus can't do correct backtraces, etc.


I will be sending follow-up emails to this message; these will contain
further patches.

In spirit with previous ARM code enhancements,
(cf. <http://sourceware.org/ml/libc-ports/2009-12/msg00012.html>), only
the EABI and NPTL code will be changed.


The first patch.  We need to use .cfi_sections to advise the assembler to
not emit .eh_frame sections (which would be incorrect to do on ARM), but
instead only .debug_frame.  This CFI statement is a 2009-10-01 binutils
addition by Jakub Jelinek,
<http://sourceware.org/ml/binutils/2009-10/msg00028.html>, which we
require to be supported, and thus we fail to configure if it's not
supported.  This hard requirement has been suggested and discussed in the
following thread:
<http://sourceware.org/ml/libc-alpha/2009-12/msg00032.html>.


2009-12-21  Thomas Schwinge  <thomas@codesourcery.com>

	* sysdeps/arm/configure.in: New file.

diff --git a/glibc-ports-mainline/sysdeps/arm/configure.in b/glibc-ports-mainline/sysdeps/arm/configure.in
new file mode 100644
index 0000000..9f4ff3b
--- /dev/null
+++ b/glibc-ports-mainline/sysdeps/arm/configure.in
@@ -0,0 +1,20 @@
+GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
+# Local configure fragment for sysdeps/arm.
+
+AC_CACHE_CHECK([whether the CFI directive .cfi_sections is supported],
+  [libc_cv_asm_cfi_directive_sections],
+  [cat > conftest.s <<EOF
+	.text
+	.cfi_sections .debug_frame, .eh_frame
+	.cfi_startproc
+	.cfi_endproc
+EOF
+  if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
+    libc_cv_asm_cfi_directive_sections=yes
+  else
+    libc_cv_asm_cfi_directive_sections=no
+  fi
+  rm -f conftest*])
+if test $libc_cv_asm_cfi_directive_sections != yes; then
+  AC_MSG_ERROR([need .cfi_sections in this configuration])
+fi


Regards,
 Thomas

Attachment: pgp00000.pgp
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]