diff options
author | Siri Hansen <[email protected]> | 2018-01-09 11:47:39 +0100 |
---|---|---|
committer | Siri Hansen <[email protected]> | 2018-01-09 11:47:39 +0100 |
commit | 6aed6670e08c75e363838091c8ad60e20c72758d (patch) | |
tree | da31420e7e7dbaca188253b1aa1c3822b07b5eda /lib/observer/src | |
parent | 18c08d11a954f1e8cd1d01d6a85bc7497a866fbf (diff) | |
parent | b591bc32b73241032d4ba7c54f214f68d8b3b983 (diff) | |
download | otp-6aed6670e08c75e363838091c8ad60e20c72758d.tar.gz otp-6aed6670e08c75e363838091c8ad60e20c72758d.tar.bz2 otp-6aed6670e08c75e363838091c8ad60e20c72758d.zip |
Merge branch 'siri/cdv/crash-when-truncated-in-mod-attr/ERL-537/OTP-14846' into maint
* siri/cdv/crash-when-truncated-in-mod-attr/ERL-537/OTP-14846:
[cdv] Don't crash when dump is truncated in module attributes
Diffstat (limited to 'lib/observer/src')
-rw-r--r-- | lib/observer/src/crashdump_viewer.erl | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/observer/src/crashdump_viewer.erl b/lib/observer/src/crashdump_viewer.erl index feaec5c678..c100e8d057 100644 --- a/lib/observer/src/crashdump_viewer.erl +++ b/lib/observer/src/crashdump_viewer.erl @@ -2027,12 +2027,16 @@ all_modinfo(Fd,LM,LineHead,DecodeOpts) -> end. get_attribute(Fd, DecodeOpts) -> + Term = do_get_attribute(Fd, DecodeOpts), + io_lib:format("~tp~n",[Term]). + +do_get_attribute(Fd, DecodeOpts) -> Bytes = bytes(Fd, ""), try get_binary(Bytes, DecodeOpts) of {Bin,_} -> try binary_to_term(Bin) of Term -> - io_lib:format("~tp~n",[Term]) + Term catch _:_ -> {"WARNING: The term is probably truncated!", |