aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2017-02-23 18:59:06 +0100
committerSverker Eriksson <[email protected]>2017-02-23 18:59:06 +0100
commit9c07c8727f440b408dc2542634812ca944e97c78 (patch)
treeb43e9707a507025301054f80ab6abf2f3f5fbdad /erts/emulator/beam
parent1e3875b28e19477dc87f5b8a5378ff6c7577e1f2 (diff)
parent6e687ee0c10d1c680d214baffcef7631eef52bc3 (diff)
downloadotp-9c07c8727f440b408dc2542634812ca944e97c78.tar.gz
otp-9c07c8727f440b408dc2542634812ca944e97c78.tar.bz2
otp-9c07c8727f440b408dc2542634812ca944e97c78.zip
Merge branch 'maint'
Diffstat (limited to 'erts/emulator/beam')
-rw-r--r--erts/emulator/beam/break.c38
1 files changed, 15 insertions, 23 deletions
diff --git a/erts/emulator/beam/break.c b/erts/emulator/beam/break.c
index aaed094af9..b9c272d6d5 100644
--- a/erts/emulator/beam/break.c
+++ b/erts/emulator/beam/break.c
@@ -381,10 +381,12 @@ info(fmtfn_t to, void *to_arg)
static int code_size(struct erl_module_instance* modi)
{
- ErtsLiteralArea* lit = modi->code_hdr->literal_area;
int size = modi->code_length;
- if (lit) {
- size += (lit->end - lit->start) * sizeof(Eterm);
+
+ if (modi->code_hdr) {
+ ErtsLiteralArea* lit = modi->code_hdr->literal_area;
+ if (lit)
+ size += (lit->end - lit->start) * sizeof(Eterm);
}
return size;
}
@@ -406,13 +408,9 @@ loaded(fmtfn_t to, void *to_arg)
* Calculate and print totals.
*/
for (i = 0; i < module_code_size(code_ix); i++) {
- if ((modp = module_code(i, code_ix)) != NULL &&
- ((modp->curr.code_length != 0) ||
- (modp->old.code_length != 0))) {
+ if ((modp = module_code(i, code_ix)) != NULL) {
cur += code_size(&modp->curr);
- if (modp->old.code_length != 0) {
- old += code_size(&modp->old);
- }
+ old += code_size(&modp->old);
}
}
erts_print(to, to_arg, "Current code: %d\n", cur);
@@ -428,26 +426,20 @@ loaded(fmtfn_t to, void *to_arg)
/*
* Interactive dump; keep it brief.
*/
- if (modp != NULL &&
- ((modp->curr.code_length != 0) ||
- (modp->old.code_length != 0))) {
- erts_print(to, to_arg, "%T", make_atom(modp->module));
- cur += code_size(&modp->curr);
- erts_print(to, to_arg, " %d", code_size(&modp->curr));
- if (modp->old.code_length != 0) {
- erts_print(to, to_arg, " (%d old)",
- code_size(&modp->old));
- old += code_size(&modp->old);
- }
+ if (modp != NULL && ((modp->curr.code_length != 0) ||
+ (modp->old.code_length != 0))) {
+ erts_print(to, to_arg, "%T %d", make_atom(modp->module),
+ code_size(&modp->curr));
+ if (modp->old.code_length != 0)
+ erts_print(to, to_arg, " (%d old)", code_size(&modp->old));
erts_print(to, to_arg, "\n");
}
} else {
/*
* To crash dump; make it parseable.
*/
- if (modp != NULL &&
- ((modp->curr.code_length != 0) ||
- (modp->old.code_length != 0))) {
+ if (modp != NULL && ((modp->curr.code_length != 0) ||
+ (modp->old.code_length != 0))) {
erts_print(to, to_arg, "=mod:");
erts_print(to, to_arg, "%T", make_atom(modp->module));
erts_print(to, to_arg, "\n");