aboutsummaryrefslogtreecommitdiffstats
path: root/lib/observer/test/crashdump_helper.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2017-11-24 10:06:33 +0100
committerBjörn Gustavsson <[email protected]>2017-11-24 10:06:33 +0100
commitc17978f689ca8f9dd36f76fa8fcf448664921301 (patch)
tree582f375dccc7908c3807f297ebb0f0ab89424319 /lib/observer/test/crashdump_helper.erl
parent1678e021c603d0cbc9d951da4facc6e959e5f277 (diff)
parent3b964e8dbaa0cd73ca7a983b3ce948e0dbd2c35c (diff)
downloadotp-c17978f689ca8f9dd36f76fa8fcf448664921301.tar.gz
otp-c17978f689ca8f9dd36f76fa8fcf448664921301.tar.bz2
otp-c17978f689ca8f9dd36f76fa8fcf448664921301.zip
Merge branch 'bjorn/base64-in-dumps/OTP-14686' into maint
* bjorn/base64-in-dumps/OTP-14686: Use base64 encoding in crash dumps Correct parsing of sub binaries Generalize passing of options for decoding
Diffstat (limited to 'lib/observer/test/crashdump_helper.erl')
-rw-r--r--lib/observer/test/crashdump_helper.erl14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/observer/test/crashdump_helper.erl b/lib/observer/test/crashdump_helper.erl
index 41041682c2..bb1755f530 100644
--- a/lib/observer/test/crashdump_helper.erl
+++ b/lib/observer/test/crashdump_helper.erl
@@ -21,7 +21,7 @@
-module(crashdump_helper).
-export([n1_proc/2,remote_proc/2,
dump_maps/0,create_maps/0,
- create_binaries/0]).
+ create_binaries/0,create_sub_binaries/1]).
-compile(r18).
-include_lib("common_test/include/ct.hrl").
@@ -64,6 +64,7 @@ n1_proc(Creator,_N2,Pid2,Port2,_L) ->
put(bin,Bin),
put(bins,create_binaries()),
put(sub_bin,SubBin),
+ put(sub_bins,create_sub_binaries(get(bins))),
put(bignum,83974938738373873),
put(neg_bignum,-38748762783736367),
put(ext_pid,Pid2),
@@ -104,6 +105,17 @@ create_binaries() ->
<<Data:Size/unit:8>>
end || Size <- Sizes].
+create_sub_binaries(Bins) ->
+ [create_sub_binary(Bin, Start, LenSub) ||
+ Bin <- Bins,
+ Start <- [0,1,2,3,4,5,10,22],
+ LenSub <- [0,1,2,3,4,6,9]].
+
+create_sub_binary(Bin, Start, LenSub) ->
+ Len = byte_size(Bin) - LenSub - Start,
+ <<_:Start/bytes,Sub:Len/bytes,_/bytes>> = Bin,
+ Sub.
+
%%%
%%% Test dumping of maps. Dumping of maps only from OTP 20.2.
%%%