aboutsummaryrefslogtreecommitdiffstats
path: root/erts/lib_src/common
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2011-04-27 17:14:35 +0200
committerSverker Eriksson <[email protected]>2011-04-27 17:14:35 +0200
commit574de87663ecee7043df1783e7c3b830193b0399 (patch)
tree8351d2af0973274534168f5442c0900bce0703f8 /erts/lib_src/common
parentef407fad10bccb97aab140f5b99786b8c7b2237a (diff)
parent261a3e9b465a1d9cbd0361c5d3801bf63950e623 (diff)
downloadotp-574de87663ecee7043df1783e7c3b830193b0399.tar.gz
otp-574de87663ecee7043df1783e7c3b830193b0399.tar.bz2
otp-574de87663ecee7043df1783e7c3b830193b0399.zip
Merge branch 'sverker/erts_printf-halfword' into dev
* sverker/erts_printf-halfword: erts_printf %be to print integers of size Eterm Fix use of type BeamInstr in hipe_debug.c Conflicts: erts/emulator/hipe/hipe_debug.c
Diffstat (limited to 'erts/lib_src/common')
-rw-r--r--erts/lib_src/common/erl_printf_format.c27
1 files changed, 25 insertions, 2 deletions
diff --git a/erts/lib_src/common/erl_printf_format.c b/erts/lib_src/common/erl_printf_format.c
index bd3d38e649..968d563325 100644
--- a/erts/lib_src/common/erl_printf_format.c
+++ b/erts/lib_src/common/erl_printf_format.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2005-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2005-2011. All Rights Reserved.
*
* The contents of this file are subject to the Erlang Public License,
* Version 1.1, (the "License"); you may not use this file except in
@@ -27,7 +27,7 @@
* length: hh | h | l | ll | L | j | t | b<sz>
* conversion: d,i | o,u,x,X | e,E | f,F | g,G | a,A | c | s | T |
* p | n | %
- * sz: 8 | 16 | 32 | 64 | p
+ * sz: 8 | 16 | 32 | 64 | p | e
*/
/* Without this, variable argument lists break on VxWorks */
@@ -76,6 +76,18 @@
#endif
#endif
+#ifndef ERTS_SIZEOF_ETERM
+# ifdef HALFWORD_HEAP_EMULATOR
+# if SIZEOF_VOID_P == 8
+# define ERTS_SIZEOF_ETERM 4
+# else
+# error "HALFWORD_HEAP_EMULATOR only allowed on 64-bit architecture"
+# endif
+# else
+# define ERTS_SIZEOF_ETERM SIZEOF_VOID_P
+# endif
+#endif
+
#if defined(__GNUC__)
# undef inline
# define inline __inline__
@@ -520,6 +532,17 @@ int erts_printf_format(fmtfn_t fn, void* arg, char* fmt, va_list ap)
#error No integer datatype with the same size as 'void *' found
#endif
}
+ else if (*ptr == 'e') {
+ ptr++;
+#if SIZEOF_INT == ERTS_SIZEOF_ETERM
+#elif SIZEOF_LONG == ERTS_SIZEOF_ETERM
+ fmt |= FMTL_l;
+#elif SIZEOF_LONG_LONG == ERTS_SIZEOF_ETERM
+ fmt |= FMTL_ll;
+#else
+#error No integer datatype with the same size as Eterm found
+#endif
+ }
else {
int bits = 0;
while(isdigit((int) *ptr))