diff options
author | Sverker Eriksson <[email protected]> | 2014-09-17 20:49:22 +0200 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2014-09-17 20:49:22 +0200 |
commit | 86b7cf42011302a78cb73ec4f339a2b31af8ae9a (patch) | |
tree | ed946bbce166d1c012788522f5508ec01fa006a2 /erts/etc | |
parent | 723fea8f585c3006aa5cbda7d33de44d054eeafa (diff) | |
parent | 933a5f071e0dc7f2051e1ccc58ca4e361db52ef4 (diff) | |
download | otp-86b7cf42011302a78cb73ec4f339a2b31af8ae9a.tar.gz otp-86b7cf42011302a78cb73ec4f339a2b31af8ae9a.tar.bz2 otp-86b7cf42011302a78cb73ec4f339a2b31af8ae9a.zip |
Merge branch 'sverk/bin-alloc-refactor'
* sverk/bin-alloc-refactor:
erts: Fix gdb command etp-carrier-blocks for 32-bit
erts: Refactor binary allocation interface to also initialize Binary
Diffstat (limited to 'erts/etc')
-rw-r--r-- | erts/etc/unix/etp-commands.in | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/erts/etc/unix/etp-commands.in b/erts/etc/unix/etp-commands.in index 1b27ac97a5..ee27770e51 100644 --- a/erts/etc/unix/etp-commands.in +++ b/erts/etc/unix/etp-commands.in @@ -3481,11 +3481,13 @@ end define etp-carrier-blocks set $etp_crr = (Carrier_t*) $arg0 set $etp_alc = (Allctr_t*)($etp_crr->allctr.counter & ~7) + set $etp_crr_end = ((char*)$etp_crr + ($etp_crr->chdr & ~7) - (sizeof(void*) & ~8)) set $etp_blk = (Block_t*) ((char*)$etp_crr + $etp_alc->mbc_header_size) set $etp_prev_blk = 0 set $etp_error_cnt = 0 set $etp_ablk_cnt = 0 set $etp_fblk_cnt = 0 + set $etp_aborted = 0 if $argc == 2 set $etp_be_silent = $arg1 @@ -3532,14 +3534,21 @@ define etp-carrier-blocks end set $etp_prev_blk = $etp_blk set $etp_blk = (Block_t*) ((char*)$etp_blk + $etp_blk_sz) + if $etp_blk < (Block_t*) ((char*)$etp_prev_blk + $etp_alc->min_block_size) || $etp_blk >= $etp_crr_end + printf "ERROR: Invalid size of block at %#lx. ABORTING\n", $etp_prev_blk + set $etp_aborted = 1 + loop_break + end end - if ((char*)$etp_blk + $etp_blk_sz) != ((char*)$etp_crr + ($etp_crr->chdr & ~7)) - printf "ERROR: Last block not at end of carrier\n" - set $etp_error_cnt = $etp_error_cnt + 1 + if !$etp_aborted + if ((char*)$etp_blk + $etp_blk_sz) != $etp_crr_end + printf "ERROR: Last block not at end of carrier\n" + set $etp_error_cnt = $etp_error_cnt + 1 + end + printf "Allocated blocks: %u\n", $etp_ablk_cnt + printf "Free blocks: %u\n", $etp_fblk_cnt end - printf "Allocated blocks: %u\n", $etp_ablk_cnt - printf "Free blocks: %u\n", $etp_fblk_cnt if $etp_error_cnt printf "%u ERRORs reported above\n", $etp-error-cnt end |