summaryrefslogtreecommitdiff
path: root/gdb/ctf.c
diff options
context:
space:
mode:
authorqiyao <qiyao>2013-03-20 02:54:22 +0000
committerqiyao <qiyao>2013-03-20 02:54:22 +0000
commitedfadd954104a9d009b704da80def8a4742915b4 (patch)
tree22546cbe757063c41454d0c98296011413b13066 /gdb/ctf.c
parentfb5f336f82d2f4c9eed6145bd375321c218b900e (diff)
downloadgdb-edfadd954104a9d009b704da80def8a4742915b4.tar.gz
gdb/
* ctf.c (ctf_save_metadata_header): Define macro HOST_ENDIANNESS and write it to CTF metadata.
Diffstat (limited to 'gdb/ctf.c')
-rw-r--r--gdb/ctf.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gdb/ctf.c b/gdb/ctf.c
index d2ff862dd37..117f72a7701 100644
--- a/gdb/ctf.c
+++ b/gdb/ctf.c
@@ -218,9 +218,17 @@ ctf_save_metadata_header (struct trace_write_handler *handler)
" := uint64_t;\n");
ctf_save_write_metadata (handler, "\n");
+ /* Get the byte order of the host and write CTF data in this byte
+ order. */
+#if WORDS_BIGENDIAN
+#define HOST_ENDIANNESS "be"
+#else
+#define HOST_ENDIANNESS "le"
+#endif
+
ctf_save_write_metadata (handler, metadata_fmt,
CTF_SAVE_MAJOR, CTF_SAVE_MINOR,
- BYTE_ORDER == LITTLE_ENDIAN ? "le" : "be");
+ HOST_ENDIANNESS);
ctf_save_write_metadata (handler, "\n");
}