aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2013-07-15 17:30:33 +0200
committerBjörn-Egil Dahlberg <[email protected]>2013-07-15 17:30:33 +0200
commitc6f452c340ad1749ce91c037a4820ea0feb0a644 (patch)
tree771d4ce8009e17c42c02b0f3504f3d845e51ce8c /erts/emulator/beam
parent625748f78566ba8638f494fc09be4311672e473b (diff)
parentc250cec28d4cd5dbe68abd8835730eaf81aba086 (diff)
downloadotp-c6f452c340ad1749ce91c037a4820ea0feb0a644.tar.gz
otp-c6f452c340ad1749ce91c037a4820ea0feb0a644.tar.bz2
otp-c6f452c340ad1749ce91c037a4820ea0feb0a644.zip
Merge branch 'egil/erts/aggregate-system-traceability/OTP-11196' into maint
* egil/erts/aggregate-system-traceability/OTP-11196: Check for native code without loading module Fix erlang:system_info(compile_info) Fix system_information get_beam_name/0 Add beam dynamic libraries to system_information Add system_information testsuite Add system information aggregate Refactor away ?line macro in code_SUITE Fix tests for erts app-file Add erts app-file erts: Add cflags, ldflags and config.h into executable
Diffstat (limited to 'erts/emulator/beam')
-rw-r--r--erts/emulator/beam/atom.names3
-rwxr-xr-xerts/emulator/beam/erl_bif_info.c26
-rwxr-xr-xerts/emulator/beam/global.h2
-rw-r--r--erts/emulator/beam/utils.c2
4 files changed, 31 insertions, 2 deletions
diff --git a/erts/emulator/beam/atom.names b/erts/emulator/beam/atom.names
index eba1d0fa23..c2f32ba089 100644
--- a/erts/emulator/beam/atom.names
+++ b/erts/emulator/beam/atom.names
@@ -139,6 +139,7 @@ atom caseless
atom catchlevel
atom cd
atom cdr
+atom cflags
atom characters_to_binary_int
atom characters_to_list_int
atom clear
@@ -150,6 +151,7 @@ atom compact
atom compat_rel
atom compile
atom compressed
+atom config_h
atom connect
atom connected
atom connection_closed
@@ -301,6 +303,7 @@ atom label
atom large_heap
atom last_calls
atom latin1
+atom ldflags
atom Le='=<'
atom lf
atom line
diff --git a/erts/emulator/beam/erl_bif_info.c b/erts/emulator/beam/erl_bif_info.c
index e4fbd21c0e..673dfc658c 100755
--- a/erts/emulator/beam/erl_bif_info.c
+++ b/erts/emulator/beam/erl_bif_info.c
@@ -30,6 +30,7 @@
#include "bif.h"
#include "big.h"
#include "erl_version.h"
+#include "erl_compile_flags.h"
#include "erl_db_util.h"
#include "erl_message.h"
#include "erl_binary.h"
@@ -2610,6 +2611,31 @@ BIF_RETTYPE system_info_1(BIF_ALIST_1)
BIF_RET(am_true);
}
#endif
+ else if (ERTS_IS_ATOM_STR("compile_info",BIF_ARG_1)) {
+ Uint sz;
+ Eterm res = NIL, tup, text;
+ Eterm *hp = HAlloc(BIF_P, 3*(2 + 3) + /* three 2-tuples and three cons */
+ 2*(strlen(erts_build_flags_CONFIG_H) +
+ strlen(erts_build_flags_CFLAGS) +
+ strlen(erts_build_flags_LDFLAGS)));
+
+ sz = strlen(erts_build_flags_CONFIG_H);
+ text = buf_to_intlist(&hp, erts_build_flags_CONFIG_H, sz, NIL);
+ tup = TUPLE2(hp, am_config_h, text); hp += 3;
+ res = CONS(hp, tup, res); hp += 2;
+
+ sz = strlen(erts_build_flags_CFLAGS);
+ text = buf_to_intlist(&hp, erts_build_flags_CFLAGS, sz, NIL);
+ tup = TUPLE2(hp, am_cflags, text); hp += 3;
+ res = CONS(hp, tup, res); hp += 2;
+
+ sz = strlen(erts_build_flags_LDFLAGS);
+ text = buf_to_intlist(&hp, erts_build_flags_LDFLAGS, sz, NIL);
+ tup = TUPLE2(hp, am_ldflags, text); hp += 3;
+ res = CONS(hp, tup, res); hp += 2;
+
+ BIF_RET(res);
+ }
BIF_ERROR(BIF_P, BADARG);
}
diff --git a/erts/emulator/beam/global.h b/erts/emulator/beam/global.h
index 2eec15867d..cecfa8a0fd 100755
--- a/erts/emulator/beam/global.h
+++ b/erts/emulator/beam/global.h
@@ -937,7 +937,7 @@ char* Sint_to_buf(Sint, struct Sint_buf*);
#define ERTS_IOLIST_OVERFLOW 1
#define ERTS_IOLIST_TYPE 2
-Eterm buf_to_intlist(Eterm**, char*, size_t, Eterm); /* most callers pass plain char*'s */
+Eterm buf_to_intlist(Eterm**, const char*, size_t, Eterm); /* most callers pass plain char*'s */
#define ERTS_IOLIST_TO_BUF_OVERFLOW (~((ErlDrvSizeT) 0))
#define ERTS_IOLIST_TO_BUF_TYPE_ERROR (~((ErlDrvSizeT) 1))
diff --git a/erts/emulator/beam/utils.c b/erts/emulator/beam/utils.c
index 84deaecb87..bd2be7afca 100644
--- a/erts/emulator/beam/utils.c
+++ b/erts/emulator/beam/utils.c
@@ -2983,7 +2983,7 @@ char* Sint_to_buf(Sint n, struct Sint_buf *buf)
*/
Eterm
-buf_to_intlist(Eterm** hpp, char *buf, size_t len, Eterm tail)
+buf_to_intlist(Eterm** hpp, const char *buf, size_t len, Eterm tail)
{
Eterm* hp = *hpp;
size_t i = len;