From 8249a5a9e2a886aeb3b7142a5dc5a8b4f1b4665b Mon Sep 17 00:00:00 2001 From: Yao Qi Date: Wed, 20 Mar 2013 02:54:22 +0000 Subject: [PATCH] gdb/ * ctf.c (ctf_save_metadata_header): Define macro HOST_ENDIANNESS and write it to CTF metadata. --- gdb/ChangeLog | 5 +++++ gdb/ctf.c | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index eca3b52f063..ae37a863da2 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2013-03-20 Yao Qi + + * ctf.c (ctf_save_metadata_header): Define macro HOST_ENDIANNESS + and write it to CTF metadata. + 2013-03-19 Corinna Vinschen * windows-nat.c (handle_output_debug_string): Change type of n to 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"); }