diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:50 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:50 +0000 |
commit | 2e00214b3efbdfeefaa0fe9e8b8fd519de7adc35 (patch) | |
tree | d325add32978dbdc1db975a438b3a77d571b1ab8 /vendor/gimli | |
parent | Releasing progress-linux version 1.68.2+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-2e00214b3efbdfeefaa0fe9e8b8fd519de7adc35.tar.xz rustc-2e00214b3efbdfeefaa0fe9e8b8fd519de7adc35.zip |
Merging upstream version 1.69.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/gimli')
28 files changed, 908 insertions, 398 deletions
diff --git a/vendor/gimli/.cargo-checksum.json b/vendor/gimli/.cargo-checksum.json index 759ec93de..944895d6b 100644 --- a/vendor/gimli/.cargo-checksum.json +++ b/vendor/gimli/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"CHANGELOG.md":"789a696803d3f1bed3ff3566cac8e7cf15c4bf9428242d637d0ce7f3a0ad57a3","CONTRIBUTING.md":"5f513ec06013e4f6f097e9c9492da5a47b9f25c94c6ecadfb655a77405fe912c","Cargo.lock":"284bff6b09ef0fd214c34492417778d6d5b9f75dc54557015af01a95696c752a","Cargo.toml":"92dccbeaa61bc8c65da53917fbf32900b3cb2549f90b67b67e1c67672bac205e","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"7b63ecd5f1902af1b63729947373683c32745c16a10e8e6292e2e2dcd7e90ae0","README.md":"57e36d344dabe1c52a9c81eafb28787c309b86c47437abf8589ef17bf383fc5f","benches/bench.rs":"e0045b989683794951563aa91b37069b2f6ae55f95e288d23f5c984b46e3a7eb","examples/dwarf-validate.rs":"4aac1045e3c08bf00878eeff75c0cfc30c06171c5eab2e71d757505786729687","examples/dwarfdump.rs":"d74323c037689b32825efa9bf69614ee26a444513b266e819ecf486956ee3299","examples/simple.rs":"4c3425e8bd1880d9522f5ed2581fb5ccd452d4be678eebc0e147c48722a7be1d","examples/simple_line.rs":"ac795f859a17650dde466b5b23b8c161b2e3b8eb57e32f5b6718a3072f6bfad0","fixtures/self/README.md":"7cfd76031ec5a4b38cc4eb56ccbfe1bb590fb54c333d037550bdeaaeacfc20cb","fixtures/self/debug_abbrev":"7c0faa940d9c68d196d03ad55a20e5c746040fa428ff323277fa381deff82bba","fixtures/self/debug_aranges":"8c2aeb2335f61d04ecb7b747070d24f83a6517cbee79dc5c96d97fb6c53d6b6d","fixtures/self/debug_info":"42028a5983006e0703f9ca9515cd27d891ae4af70279fae5011d547f581e2661","fixtures/self/debug_inlined":"89d9516f06ff835621936037f5884fc56712bf304c1dcde52251ddd510fe8710","fixtures/self/debug_line":"b29aebcca3b38bb2bb8aa708cbe74a0dce5a3b0c18916b63d6d17282c017bec7","fixtures/self/debug_loc":"8906ccb9c204f233eb74c1d069dee97a19d18c2051f9147795d7b5364a9266aa","fixtures/self/debug_pubnames":"cf58e237f89c68afba724597fa7e260448636b45f2e69dc6f1bfe34006e27c48","fixtures/self/debug_pubtypes":"d43c1bed71c9d14d1683294cdc1833f069cf131d6e95ee808547919b4f352d81","fixtures/self/debug_ranges":"6d765ac18d33accd89186d077eeb505cbdf97d990c9201d63d9463cd7787ce7a","fixtures/self/debug_str":"9ed904b68eee77b8558b80b3b7ca03e8527f6c64483e9d6d845f40270eb21183","fixtures/self/eh_frame":"6dc3d84351cac42cf73d03452fbb532470dd94d08715154c48417e3f62095f17","fixtures/self/eh_frame_hdr":"afba7a0aa233c9a8c81c986495bd2505164844adb93272d6bc0c9e592e684716","rustfmt.toml":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","src/arch.rs":"1c4cb3e2a322f3f42fe0b82875c9d0ce060d9af2388990139bdce9a4487c32da","src/common.rs":"392f52a58db6101187ca5525bbeafca9bda2342debd058cabca37350cd9db619","src/constants.rs":"358cf7924c79bc72de59d23d1fa02b2047d6c763c8fbd8be263ab8cd3e3ba7ec","src/endianity.rs":"1f7e62ae34f540c06bedf1e7948739211556eea7dd83731a5ca52c7d687ed0fc","src/leb128.rs":"996d5c79d027f97c010ca487bc4ff5f8265f4b9e63d62b4e4fa291383c259ee9","src/lib.rs":"6863b9a9d1eddf34b4095dfe60318aae56914fbf515ba5601b29024cc963f27c","src/read/abbrev.rs":"a3f550c32f1eb880d82bdb5257d35e10d32cfd039050e8131cbeedac346cc1d9","src/read/addr.rs":"f63f289edf889e87107bb2090fb1c50b48af7015f31b7c39c3d6ea09630a38e9","src/read/aranges.rs":"ba3302f87cffb7ee15f48b0530ebd707f45ad056934223078d25ae2a1b034f1c","src/read/cfi.rs":"b1064ed9b4b87169a148cc86adc7443c5a771dc2d1799129f7883f1ef6adc165","src/read/dwarf.rs":"a39c24429b437ae3a1cd17bae2f01c973c9ce39f7b5f2b3435982d6860944e0e","src/read/endian_reader.rs":"320983a859c2bb0dd44a3e6fae55ff0a84dba3fa80c2edbc64aa8135c44eddf0","src/read/endian_slice.rs":"ae1c52499728f6a85648f1bf87c02dcf43bebecb5ad4e835a1246938ba4338bf","src/read/index.rs":"e79b8d591b8e2007a37f5ea85a6d71b69d56ca3739a85cf7bf361724c5b829fa","src/read/line.rs":"af7a1520777e56632970fc5fe7377fdcd12d078eb88eeb2b0f2cc95b73ff68a7","src/read/lists.rs":"67ca9e1a36a91feb4996d035211de845205212bfda02163685d217818567ff93","src/read/loclists.rs":"1b4ea85c0dd8c6eae492a60cb70810185d56ba579df7986cb8a36385031b10fd","src/read/lookup.rs":"0cf89ba12b9d48b1fe035dd3a497730323acb9427a9457abbc2f7c58c4c71165","src/read/mod.rs":"3bafc747c31a575bcc92d3e7d5ea5a15f5acc01918a4377cec1dced0f85b5d2b","src/read/op.rs":"e5dce6520dfc90ec74c3b070ca374b89fcf55ff23101471591458175a72c79e6","src/read/pubnames.rs":"ed752ee1a7017e6d3be42d81e4ddaaac960ef08081463a19106c9f041526d4a3","src/read/pubtypes.rs":"5e75b32c0923e827aff0bb2db456797a0e8d38ba46be992558a7990b3196bcf5","src/read/reader.rs":"b10ff3e77b54347e96b1f3cff30da104dfdd0c4d7a55b672950788f1f1ae3478","src/read/rnglists.rs":"af637d283d76514382ee0556463cccab4e6f0ea4d061db9a44a594b5d57d1fd7","src/read/str.rs":"4c2f50014451621fea45969cd313f6840fcd3a99d7a2d081bfa1f8e0e434133a","src/read/unit.rs":"6ed00ba004c329008bf295d9c7d724afe961750f0c7b08430fc213fd5d998003","src/read/util.rs":"0b7d0d2225a98618070dc472ccba49a5411aa8beed5ff6696da079d06156d363","src/read/value.rs":"5a91e03ad3d41f679b264753498434b91948c6b89955e4beb4522498386d9b1d","src/test_util.rs":"291eefa6b51c6d934ba2f4a4c9bc7c403046fc1cccf4d43487820f0154bb89e2","src/write/abbrev.rs":"fa02163389e92e804d139cf84f833ab6af932083f0eb2d74464b4a70bd3237ff","src/write/cfi.rs":"3b04b0ebd82363738199cc673f64e0ceb60506a67c4f18b435a109caa62840f3","src/write/dwarf.rs":"8a1a0893e31134ad68993994594f3024ad0c8af7c1188b29e0ffc26b42edef21","src/write/endian_vec.rs":"1d5811986648816a677580b22630f5059757a381487d73e9adbb3008c9ae0c58","src/write/line.rs":"df7d2082c71b5e523cd52745700aae3dcfa5800f0b280e831ef5d8eb8035d6a7","src/write/loc.rs":"bb5b750c04f6603e18225db72652ea00239234ba674a8a8627c99d4ab07b47a9","src/write/mod.rs":"d8aa1da854cdee629d470d00d87e00dc6998e4bec1ca951f8d2f277730ab9d69","src/write/op.rs":"7b1d49b10c8c92b2d5b259e83119ff7dc95bc552535bb7b1a82ca9556a35c589","src/write/range.rs":"5bac01e372c08e3cc19e1e07e40492d8214cdfa8881737920cb792f4aa2ba80b","src/write/section.rs":"3ce781d5e82ba365ff54fdd36e0ef58c58a2215b09a8861eb0b038efac82b77f","src/write/str.rs":"4850cc2fee55980f9cbb6b4169f9861ab9d05c2b28a85c2b790480b83a66f514","src/write/unit.rs":"213c881736f8c87fcb2f921e379791eaba2915e8d077139965a9c6211001fe44","src/write/writer.rs":"304181287f90445bbfb33349c26b34bd87002d6844fc5686bfc0756fd0a1ecd8","tests/convert_self.rs":"180909b562969e1691b64628ded8654e6e0b10b3357f39917bd8ac288c5826dd","tests/parse_self.rs":"f2da1c7daef7139545c9367c2f26199e8b4623b31d4ec6480ddd851e6980f2dc"},"package":"22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d"}
\ No newline at end of file +{"files":{"CHANGELOG.md":"26652aa86933dfc6d8368788a6c8b3f44bc5787cb3a9773778dbd8beb376cab5","CONTRIBUTING.md":"5f513ec06013e4f6f097e9c9492da5a47b9f25c94c6ecadfb655a77405fe912c","Cargo.lock":"526ec45724cfe5dba367ac5a6aaac87223dcc0a76393cf87582be63e349b437b","Cargo.toml":"dccff39f1b698a28646c5af7bbe35fc08606b4dbf848f9e02bbf78b0daf967e6","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"7b63ecd5f1902af1b63729947373683c32745c16a10e8e6292e2e2dcd7e90ae0","README.md":"8b35e78ea98d87b6b818feea83863cbf16fe5b024ba71641c6ce9fe9c68f32c7","benches/bench.rs":"e0045b989683794951563aa91b37069b2f6ae55f95e288d23f5c984b46e3a7eb","clippy.toml":"50fd0cdaae995561b1d688c9410fe99335fc7ac3916a400dafd25ff63f8215f7","examples/dwarf-validate.rs":"4aac1045e3c08bf00878eeff75c0cfc30c06171c5eab2e71d757505786729687","examples/dwarfdump.rs":"5192233994233aabc1f359f9b50746a5703f528c4e22f2573d8e39e0c35cd32a","examples/simple.rs":"4c3425e8bd1880d9522f5ed2581fb5ccd452d4be678eebc0e147c48722a7be1d","examples/simple_line.rs":"ac795f859a17650dde466b5b23b8c161b2e3b8eb57e32f5b6718a3072f6bfad0","fixtures/self/README.md":"7cfd76031ec5a4b38cc4eb56ccbfe1bb590fb54c333d037550bdeaaeacfc20cb","fixtures/self/debug_abbrev":"7c0faa940d9c68d196d03ad55a20e5c746040fa428ff323277fa381deff82bba","fixtures/self/debug_aranges":"8c2aeb2335f61d04ecb7b747070d24f83a6517cbee79dc5c96d97fb6c53d6b6d","fixtures/self/debug_info":"42028a5983006e0703f9ca9515cd27d891ae4af70279fae5011d547f581e2661","fixtures/self/debug_inlined":"89d9516f06ff835621936037f5884fc56712bf304c1dcde52251ddd510fe8710","fixtures/self/debug_line":"b29aebcca3b38bb2bb8aa708cbe74a0dce5a3b0c18916b63d6d17282c017bec7","fixtures/self/debug_loc":"8906ccb9c204f233eb74c1d069dee97a19d18c2051f9147795d7b5364a9266aa","fixtures/self/debug_pubnames":"cf58e237f89c68afba724597fa7e260448636b45f2e69dc6f1bfe34006e27c48","fixtures/self/debug_pubtypes":"d43c1bed71c9d14d1683294cdc1833f069cf131d6e95ee808547919b4f352d81","fixtures/self/debug_ranges":"6d765ac18d33accd89186d077eeb505cbdf97d990c9201d63d9463cd7787ce7a","fixtures/self/debug_str":"9ed904b68eee77b8558b80b3b7ca03e8527f6c64483e9d6d845f40270eb21183","fixtures/self/eh_frame":"6dc3d84351cac42cf73d03452fbb532470dd94d08715154c48417e3f62095f17","fixtures/self/eh_frame_hdr":"afba7a0aa233c9a8c81c986495bd2505164844adb93272d6bc0c9e592e684716","rustfmt.toml":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","src/arch.rs":"3a9b44d51a770b83e19c5420c7a6c090cf895fe668cbecea4e3c20acdfef871c","src/common.rs":"392f52a58db6101187ca5525bbeafca9bda2342debd058cabca37350cd9db619","src/constants.rs":"358cf7924c79bc72de59d23d1fa02b2047d6c763c8fbd8be263ab8cd3e3ba7ec","src/endianity.rs":"1f7e62ae34f540c06bedf1e7948739211556eea7dd83731a5ca52c7d687ed0fc","src/leb128.rs":"996d5c79d027f97c010ca487bc4ff5f8265f4b9e63d62b4e4fa291383c259ee9","src/lib.rs":"9a307a6d1fbebeae581df014b4f2b8bd16399fa883209fbdcc4d85eb9ec1dfd5","src/read/abbrev.rs":"31f7e9544a30e35f49dca355981730c2eb145e55ddbf281161d842a566d0a88d","src/read/addr.rs":"f63f289edf889e87107bb2090fb1c50b48af7015f31b7c39c3d6ea09630a38e9","src/read/aranges.rs":"ba3302f87cffb7ee15f48b0530ebd707f45ad056934223078d25ae2a1b034f1c","src/read/cfi.rs":"85cb294cf6a932d31769a747c58d1767b83e64831d8c633ab0b517014fe1cdec","src/read/dwarf.rs":"50cd674f17e81bca57f6ba69600a7a24bd7d13632c165f2a40f2a23fd328a2c9","src/read/endian_reader.rs":"320983a859c2bb0dd44a3e6fae55ff0a84dba3fa80c2edbc64aa8135c44eddf0","src/read/endian_slice.rs":"476055ef571d53fbb890545fe5893b9083b10b90ec9e538bd82216bbe8bc45fd","src/read/index.rs":"e79b8d591b8e2007a37f5ea85a6d71b69d56ca3739a85cf7bf361724c5b829fa","src/read/lazy.rs":"85642e886ab3a94cea53534d1e133d1c4c17d2deaf291facdc316507e499ce22","src/read/line.rs":"ff3aeb1c719a3440ece2a8b2394d790f0987640d77fc4b30bee73f291f027803","src/read/lists.rs":"67ca9e1a36a91feb4996d035211de845205212bfda02163685d217818567ff93","src/read/loclists.rs":"857701a9e86aee809bfca3fd661e283b4f05038764dfc9c3cb1a349acc00bc47","src/read/lookup.rs":"0cf89ba12b9d48b1fe035dd3a497730323acb9427a9457abbc2f7c58c4c71165","src/read/mod.rs":"e3e831fab7570c97f58fb5e3931e6965f4a361b66292944f79f85bf3fe1b1d00","src/read/op.rs":"57aba989cc3d49772a51de7d487cbd10458f688487d3ae4e5efae4c84adb4e39","src/read/pubnames.rs":"ed752ee1a7017e6d3be42d81e4ddaaac960ef08081463a19106c9f041526d4a3","src/read/pubtypes.rs":"5e75b32c0923e827aff0bb2db456797a0e8d38ba46be992558a7990b3196bcf5","src/read/reader.rs":"b10ff3e77b54347e96b1f3cff30da104dfdd0c4d7a55b672950788f1f1ae3478","src/read/rnglists.rs":"4ec166e73fdfc85efa97b3b005b514bb64d454edb1ba0f201c45df4f2127e745","src/read/str.rs":"4c2f50014451621fea45969cd313f6840fcd3a99d7a2d081bfa1f8e0e434133a","src/read/unit.rs":"4e8af3c654faf8dc42b8bc62edf2f2402c6b42b31889662b0b48753c08b9893a","src/read/util.rs":"40f07a7b6623f29d03e15e41cda625a613ab1973969a4ddbb42365a8550b7e79","src/read/value.rs":"5a91e03ad3d41f679b264753498434b91948c6b89955e4beb4522498386d9b1d","src/test_util.rs":"291eefa6b51c6d934ba2f4a4c9bc7c403046fc1cccf4d43487820f0154bb89e2","src/write/abbrev.rs":"fa02163389e92e804d139cf84f833ab6af932083f0eb2d74464b4a70bd3237ff","src/write/cfi.rs":"3b04b0ebd82363738199cc673f64e0ceb60506a67c4f18b435a109caa62840f3","src/write/dwarf.rs":"8a1a0893e31134ad68993994594f3024ad0c8af7c1188b29e0ffc26b42edef21","src/write/endian_vec.rs":"1d5811986648816a677580b22630f5059757a381487d73e9adbb3008c9ae0c58","src/write/line.rs":"73bf3bab57433fe1dc891c48303cbc4e482306a1b9425f3483ad2985a9676ee9","src/write/loc.rs":"5c1f8d97d8e871a6663ad704f5e15694bddd54b85f2d801b52a520522f1258fd","src/write/mod.rs":"d8aa1da854cdee629d470d00d87e00dc6998e4bec1ca951f8d2f277730ab9d69","src/write/op.rs":"08fec7613aaa9061aae6e31d8b49933c812a6b7609f69e611a2a953af09aa18a","src/write/range.rs":"259e21e32bebbf7cdd8027d401862dee95cb5111e45bc4ff30bf54e3306d0262","src/write/section.rs":"effefef0d5e4557cb099431a20a7304392e6bf4ce04941d72b8bd2df9100e297","src/write/str.rs":"4850cc2fee55980f9cbb6b4169f9861ab9d05c2b28a85c2b790480b83a66f514","src/write/unit.rs":"8876c88dc3529d32e9894acc3194ed99fe437bb7520821c18f9f9f638db08d81","src/write/writer.rs":"7d5dd07b82ec3becebb060c106d4ea697cbd8b9b64a5de78403511a5244e08b1","tests/convert_self.rs":"180909b562969e1691b64628ded8654e6e0b10b3357f39917bd8ac288c5826dd","tests/parse_self.rs":"f2da1c7daef7139545c9367c2f26199e8b4623b31d4ec6480ddd851e6980f2dc"},"package":"dec7af912d60cdbd3677c1af9352ebae6fb8394d165568a2234df0fa00f87793"}
\ No newline at end of file diff --git a/vendor/gimli/CHANGELOG.md b/vendor/gimli/CHANGELOG.md index 9ca6d70a8..9c3817750 100644 --- a/vendor/gimli/CHANGELOG.md +++ b/vendor/gimli/CHANGELOG.md @@ -2,6 +2,27 @@ -------------------------------------------------------------------------------- +## 0.27.0 + +Released 2022/11/23. + +### Breaking changes + +* Added `read::Dwarf::abbreviations_cache` to cache abbreviations at offset 0. + Changed `read::Dwarf::abbreviations` to return `Result<Arc<Abbreviations>>`, + and changed `read::Unit::abbreviations` to `Arc<Abbreviations>`. + [#628](https://github.com/gimli-rs/gimli/pull/628) + +### Added + +* Added LoongArch register definitions. + [#624](https://github.com/gimli-rs/gimli/pull/624) + +* Added support for tombstones in `read::LocListIter` and `read::RngListIter`. + [#631](https://github.com/gimli-rs/gimli/pull/631) + +-------------------------------------------------------------------------------- + ## 0.26.2 Released 2022/07/16. diff --git a/vendor/gimli/Cargo.lock b/vendor/gimli/Cargo.lock index b4a719a0c..1d8bdf9f4 100644 --- a/vendor/gimli/Cargo.lock +++ b/vendor/gimli/Cargo.lock @@ -10,18 +10,18 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aho-corasick" -version = "0.7.18" +version = "0.7.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" +checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" dependencies = [ "memchr", ] [[package]] name = "autocfg" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "byteorder" @@ -37,24 +37,24 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "compiler_builtins" -version = "0.1.51" +version = "0.1.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3587b3669d6f2c1cfd34c475272dabcfef29d52703933f6f72ebb36d6bd81a97" +checksum = "989b2c1ca6e90ad06fdc69d1d1862fa28d27a977be6d92ae2fa762cf61fe0b10" [[package]] name = "crc32fast" -version = "1.2.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" dependencies = [ "cfg-if", ] [[package]] name = "crossbeam" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ae5588f6b3c3cb05239e90bd110f257254aecd01e4635400391aeae07497845" +checksum = "2801af0d36612ae591caa9568261fddce32ce6e08a7275ea334a06a4ad021a2c" dependencies = [ "cfg-if", "crossbeam-channel", @@ -66,9 +66,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.1" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ed27e177f16d65f0f0c22a213e17c696ace5dd64b14258b52f9417ccb52db4" +checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" dependencies = [ "cfg-if", "crossbeam-utils", @@ -76,9 +76,9 @@ dependencies = [ [[package]] name = "crossbeam-deque" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e" +checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" dependencies = [ "cfg-if", "crossbeam-epoch", @@ -87,22 +87,22 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.5" +version = "0.9.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec02e091aa634e2c3ada4a392989e7c3116673ef0ac5b72232439094d73b7fd" +checksum = "01a9af1f4c2ef74bb8aa1f7e19706bc72d03598c8a570bb5de72243c7a9d9d5a" dependencies = [ + "autocfg", "cfg-if", "crossbeam-utils", - "lazy_static", "memoffset", "scopeguard", ] [[package]] name = "crossbeam-queue" -version = "0.3.2" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b10ddc024425c88c2ad148c1b0fd53f4c6d38db9697c9f1588381212fa657c9" +checksum = "d1cfb3ea8a53f37c40dea2c7bedcbd88bdfae54f5e2175d6ecaff1c988353add" dependencies = [ "cfg-if", "crossbeam-utils", @@ -110,19 +110,18 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.5" +version = "0.8.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d82cfc11ce7f2c3faef78d8a684447b40d503d9681acebed6cb728d45940c4db" +checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f" dependencies = [ "cfg-if", - "lazy_static", ] [[package]] name = "either" -version = "1.6.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" +checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" [[package]] name = "fallible-iterator" @@ -132,13 +131,11 @@ checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" [[package]] name = "flate2" -version = "1.0.22" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e6988e897c1c9c485f43b47a529cef42fde0547f9d8d41a7062518f1d8fc53f" +checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6" dependencies = [ - "cfg-if", "crc32fast", - "libc", "miniz_oxide", ] @@ -153,7 +150,7 @@ dependencies = [ [[package]] name = "gimli" -version = "0.26.2" +version = "0.27.0" dependencies = [ "compiler_builtins", "crossbeam", @@ -174,9 +171,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.11.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hermit-abi" @@ -189,65 +186,58 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.7.0" +version = "1.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5" +checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" dependencies = [ "autocfg", "hashbrown", ] [[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] name = "libc" -version = "0.2.105" +version = "0.2.137" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "869d572136620d55835903746bcb5cdc54cb2851fd0aeec53220b4bb65ef3013" +checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89" [[package]] name = "memchr" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "memmap2" -version = "0.5.5" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a79b39c93a7a5a27eeaf9a23b5ff43f1b9e0ad6b1cdd441140ae53c35613fc7" +checksum = "4b182332558b18d807c4ce1ca8ca983b34c3ee32765e47b3f0f69b90355cc1dc" dependencies = [ "libc", ] [[package]] name = "memoffset" -version = "0.6.4" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59accc507f1338036a0477ef61afdae33cde60840f4dfe481319ce3ad116ddf9" +checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" dependencies = [ "autocfg", ] [[package]] name = "miniz_oxide" -version = "0.4.4" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" +checksum = "96590ba8f175222643a85693f33d26e9c8a015f599c216509b1a6894af675d34" dependencies = [ "adler", - "autocfg", ] [[package]] name = "num_cpus" -version = "1.13.0" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" +checksum = "f6058e64324c71e02bc2b150e4f3bc8286db6c83092132ffa3f6b1eab0f9def5" dependencies = [ "hermit-abi", "libc", @@ -255,9 +245,9 @@ dependencies = [ [[package]] name = "object" -version = "0.29.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" +checksum = "239da7f290cfa979f43f85a8efeee9a8a76d0827c356d37f9d3d7254d6b537fb" dependencies = [ "flate2", "memchr", @@ -266,11 +256,10 @@ dependencies = [ [[package]] name = "rayon" -version = "1.5.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06aca804d41dbc8ba42dfd964f0d01334eceb64314b9ecf7c5fad5188a06d90" +checksum = "1e060280438193c554f654141c9ea9417886713b7acd75974c85b18a69a88e0b" dependencies = [ - "autocfg", "crossbeam-deque", "either", "rayon-core", @@ -278,22 +267,21 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.9.1" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d78120e2c850279833f1dd3582f730c4ab53ed95aeaaaa862a2a5c71b1656d8e" +checksum = "cac410af5d00ab6884528b4ab69d1e8e146e8d471201800fa1b4524126de6ad3" dependencies = [ "crossbeam-channel", "crossbeam-deque", "crossbeam-utils", - "lazy_static", "num_cpus", ] [[package]] name = "regex" -version = "1.5.4" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" +checksum = "e076559ef8e241f2ae3479e36f97bd5741c0330689e217ad51ce2c76808b868a" dependencies = [ "aho-corasick", "memchr", @@ -302,9 +290,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.25" +version = "0.6.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" +checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" [[package]] name = "rustc-std-workspace-alloc" @@ -347,9 +335,9 @@ checksum = "0685c84d5d54d1c26f7d3eb96cd41550adb97baed141a761cf335d3d33bcd0ae" [[package]] name = "unicode-width" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" [[package]] name = "wasmparser" diff --git a/vendor/gimli/Cargo.toml b/vendor/gimli/Cargo.toml index f36ccd936..2c6004eb9 100644 --- a/vendor/gimli/Cargo.toml +++ b/vendor/gimli/Cargo.toml @@ -12,7 +12,7 @@ [package] edition = "2018" name = "gimli" -version = "0.26.2" +version = "0.27.0" exclude = [ "/releases/*", "/.github", @@ -105,7 +105,7 @@ version = "0.5.5" version = "1" [dev-dependencies.object] -version = "0.29.0" +version = "0.30.0" features = ["wasm"] [dev-dependencies.rayon] diff --git a/vendor/gimli/README.md b/vendor/gimli/README.md index 19e7bbd0e..f0d31fbe1 100644 --- a/vendor/gimli/README.md +++ b/vendor/gimli/README.md @@ -5,7 +5,7 @@ [![Build Status](https://github.com/gimli-rs/gimli/workflows/Rust/badge.svg)](https://github.com/gimli-rs/gimli/actions) [![Coverage Status](https://coveralls.io/repos/github/gimli-rs/gimli/badge.svg?branch=master)](https://coveralls.io/github/gimli-rs/gimli?branch=master) -`gimli` is a blazing fast library for consuming the +`gimli` is a library for reading and writing the [DWARF debugging format](https://dwarfstd.org/). * **Zero copy:** everything is just a reference to the original input buffer. No @@ -30,7 +30,7 @@ Add this to your `Cargo.toml`: ```toml [dependencies] -gimli = "0.26.2" +gimli = "0.27.0" ``` The minimum supported Rust version is 1.42.0. diff --git a/vendor/gimli/clippy.toml b/vendor/gimli/clippy.toml new file mode 100644 index 000000000..f97e544b6 --- /dev/null +++ b/vendor/gimli/clippy.toml @@ -0,0 +1 @@ +msrv = "1.42.0" diff --git a/vendor/gimli/examples/dwarfdump.rs b/vendor/gimli/examples/dwarfdump.rs index 4b61fd572..22458fa8f 100644 --- a/vendor/gimli/examples/dwarfdump.rs +++ b/vendor/gimli/examples/dwarfdump.rs @@ -1859,35 +1859,46 @@ fn dump_op<R: Reader, W: Write>( Ok(()) } +fn dump_range<W: Write>(w: &mut W, range: Option<gimli::Range>) -> Result<()> { + if let Some(range) = range { + write!(w, " [0x{:08x}, 0x{:08x}]", range.begin, range.end)?; + } else { + write!(w, " [ignored]")?; + } + Ok(()) +} + fn dump_loc_list<R: Reader, W: Write>( w: &mut W, offset: gimli::LocationListsOffset<R::Offset>, unit: &gimli::Unit<R>, dwarf: &gimli::Dwarf<R>, ) -> Result<()> { - let raw_locations = dwarf.raw_locations(unit, offset)?; - let raw_locations: Vec<_> = raw_locations.collect()?; let mut locations = dwarf.locations(unit, offset)?; writeln!( w, - "<loclist at {}+0x{:08x} with {} entries>", + "<loclist at {}+0x{:08x}>", if unit.encoding().version < 5 { ".debug_loc" } else { ".debug_loclists" }, offset.0, - raw_locations.len() )?; - for (i, raw) in raw_locations.iter().enumerate() { + let mut i = 0; + while let Some(raw) = locations.next_raw()? { write!(w, "\t\t\t[{:2}]", i)?; - match *raw { + i += 1; + let range = locations + .convert_raw(raw.clone())? + .map(|location| location.range); + match raw { gimli::RawLocListEntry::BaseAddress { addr } => { - writeln!(w, "<new base address 0x{:08x}>", addr)?; + writeln!(w, "<base-address 0x{:08x}>", addr)?; } gimli::RawLocListEntry::BaseAddressx { addr } => { let addr_val = dwarf.address(unit, addr)?; - writeln!(w, "<new base addressx [{}]0x{:08x}>", addr.0, addr_val)?; + writeln!(w, "<base-addressx [{}]0x{:08x}>", addr.0, addr_val)?; } gimli::RawLocListEntry::StartxEndx { begin, @@ -1896,14 +1907,12 @@ fn dump_loc_list<R: Reader, W: Write>( } => { let begin_val = dwarf.address(unit, begin)?; let end_val = dwarf.address(unit, end)?; - let location = locations.next()?.unwrap(); write!( w, - "<startx-endx \ - low-off: [{}]0x{:08x} addr 0x{:08x} \ - high-off: [{}]0x{:08x} addr 0x{:08x}>", - begin.0, begin_val, location.range.begin, end.0, end_val, location.range.end + "<startx-endx [{}]0x{:08x}, [{}]0x{:08x}>", + begin.0, begin_val, end.0, end_val, )?; + dump_range(w, range)?; dump_exprloc(w, unit.encoding(), data)?; writeln!(w)?; } @@ -1913,14 +1922,12 @@ fn dump_loc_list<R: Reader, W: Write>( ref data, } => { let begin_val = dwarf.address(unit, begin)?; - let location = locations.next()?.unwrap(); write!( w, - "<start-length \ - low-off: [{}]0x{:08x} addr 0x{:08x} \ - high-off: 0x{:08x} addr 0x{:08x}>", - begin.0, begin_val, location.range.begin, length, location.range.end + "<startx-length [{}]0x{:08x}, 0x{:08x}>", + begin.0, begin_val, length, )?; + dump_range(w, range)?; dump_exprloc(w, unit.encoding(), data)?; writeln!(w)?; } @@ -1934,14 +1941,8 @@ fn dump_loc_list<R: Reader, W: Write>( end, ref data, } => { - let location = locations.next()?.unwrap(); - write!( - w, - "<offset pair \ - low-off: 0x{:08x} addr 0x{:08x} \ - high-off: 0x{:08x} addr 0x{:08x}>", - begin, location.range.begin, end, location.range.end - )?; + write!(w, "<offset-pair 0x{:08x}, 0x{:08x}>", begin, end)?; + dump_range(w, range)?; dump_exprloc(w, unit.encoding(), data)?; writeln!(w)?; } @@ -1955,14 +1956,8 @@ fn dump_loc_list<R: Reader, W: Write>( end, ref data, } => { - let location = locations.next()?.unwrap(); - write!( - w, - "<start-end \ - low-off: 0x{:08x} addr 0x{:08x} \ - high-off: 0x{:08x} addr 0x{:08x}>", - begin, location.range.begin, end, location.range.end - )?; + write!(w, "<start-end 0x{:08x}, 0x{:08x}>", begin, end)?; + dump_range(w, range)?; dump_exprloc(w, unit.encoding(), data)?; writeln!(w)?; } @@ -1971,14 +1966,8 @@ fn dump_loc_list<R: Reader, W: Write>( length, ref data, } => { - let location = locations.next()?.unwrap(); - write!( - w, - "<start-length \ - low-off: 0x{:08x} addr 0x{:08x} \ - high-off: 0x{:08x} addr 0x{:08x}>", - begin, location.range.begin, length, location.range.end - )?; + write!(w, "<start-length 0x{:08x}, 0x{:08x}>", begin, length)?; + dump_range(w, range)?; dump_exprloc(w, unit.encoding(), data)?; writeln!(w)?; } @@ -1993,33 +1982,23 @@ fn dump_range_list<R: Reader, W: Write>( unit: &gimli::Unit<R>, dwarf: &gimli::Dwarf<R>, ) -> Result<()> { - let raw_ranges = dwarf.raw_ranges(unit, offset)?; - let raw_ranges: Vec<_> = raw_ranges.collect()?; let mut ranges = dwarf.ranges(unit, offset)?; writeln!( w, - "<rnglist at {}+0x{:08x} with {} entries>", + "<rnglist at {}+0x{:08x}>", if unit.encoding().version < 5 { ".debug_ranges" } else { ".debug_rnglists" }, offset.0, - raw_ranges.len() )?; - for (i, raw) in raw_ranges.iter().enumerate() { + let mut i = 0; + while let Some(raw) = ranges.next_raw()? { write!(w, "\t\t\t[{:2}] ", i)?; - match *raw { - gimli::RawRngListEntry::AddressOrOffsetPair { begin, end } => { - let range = ranges.next()?.unwrap(); - writeln!( - w, - "<address pair \ - low-off: 0x{:08x} addr 0x{:08x} \ - high-off: 0x{:08x} addr 0x{:08x}>", - begin, range.begin, end, range.end - )?; - } + i += 1; + let range = ranges.convert_raw(raw.clone())?; + match raw { gimli::RawRngListEntry::BaseAddress { addr } => { writeln!(w, "<new base address 0x{:08x}>", addr)?; } @@ -2030,66 +2009,39 @@ fn dump_range_list<R: Reader, W: Write>( gimli::RawRngListEntry::StartxEndx { begin, end } => { let begin_val = dwarf.address(unit, begin)?; let end_val = dwarf.address(unit, end)?; - let range = if begin_val == end_val { - gimli::Range { - begin: begin_val, - end: end_val, - } - } else { - ranges.next()?.unwrap() - }; - writeln!( + write!( w, - "<startx-endx \ - low-off: [{}]0x{:08x} addr 0x{:08x} \ - high-off: [{}]0x{:08x} addr 0x{:08x}>", - begin.0, begin_val, range.begin, end.0, end_val, range.end + "<startx-endx [{}]0x{:08x}, [{}]0x{:08x}>", + begin.0, begin_val, end.0, end_val, )?; + dump_range(w, range)?; + writeln!(w)?; } gimli::RawRngListEntry::StartxLength { begin, length } => { let begin_val = dwarf.address(unit, begin)?; - let range = ranges.next()?.unwrap(); - writeln!( + write!( w, - "<startx-length \ - low-off: [{}]0x{:08x} addr 0x{:08x} \ - high-off: 0x{:08x} addr 0x{:08x}>", - begin.0, begin_val, range.begin, length, range.end + "<startx-length [{}]0x{:08x}, 0x{:08x}>", + begin.0, begin_val, length, )?; + dump_range(w, range)?; + writeln!(w)?; } - gimli::RawRngListEntry::OffsetPair { begin, end } => { - let range = ranges.next()?.unwrap(); - writeln!( - w, - "<offset pair \ - low-off: 0x{:08x} addr 0x{:08x} \ - high-off: 0x{:08x} addr 0x{:08x}>", - begin, range.begin, end, range.end - )?; + gimli::RawRngListEntry::AddressOrOffsetPair { begin, end } + | gimli::RawRngListEntry::OffsetPair { begin, end } => { + write!(w, "<offset-pair 0x{:08x}, 0x{:08x}>", begin, end)?; + dump_range(w, range)?; + writeln!(w)?; } gimli::RawRngListEntry::StartEnd { begin, end } => { - let range = if begin == end { - gimli::Range { begin, end } - } else { - ranges.next()?.unwrap() - }; - writeln!( - w, - "<start-end \ - low-off: 0x{:08x} addr 0x{:08x} \ - high-off: 0x{:08x} addr 0x{:08x}>", - begin, range.begin, end, range.end - )?; + write!(w, "<start-end 0x{:08x}, 0x{:08x}>", begin, end)?; + dump_range(w, range)?; + writeln!(w)?; } gimli::RawRngListEntry::StartLength { begin, length } => { - let range = ranges.next()?.unwrap(); - writeln!( - w, - "<start-length \ - low-off: 0x{:08x} addr 0x{:08x} \ - high-off: 0x{:08x} addr 0x{:08x}>", - begin, range.begin, length, range.end - )?; + write!(w, "<start-length 0x{:08x}, 0x{:08x}>", begin, length)?; + dump_range(w, range)?; + writeln!(w)?; } }; } diff --git a/vendor/gimli/src/arch.rs b/vendor/gimli/src/arch.rs index f5b2e5ed8..abc872d83 100644 --- a/vendor/gimli/src/arch.rs +++ b/vendor/gimli/src/arch.rs @@ -291,6 +291,154 @@ registers!(AArch64, { V31 = (95, "V31"), }); +/// LoongArch architecture specific definitions. +/// +/// See [LoongArch ELF psABI specification](https://loongson.github.io/LoongArch-Documentation/LoongArch-ELF-ABI-EN.html). +#[derive(Debug, Clone, Copy)] +pub struct LoongArch; + +registers!(LoongArch, { + R0 = (0, "$r0"), + R1 = (1, "$r1"), + R2 = (2, "$r2"), + R3 = (3, "$r3"), + R4 = (4, "$r4"), + R5 = (5, "$r5"), + R6 = (6, "$r6"), + R7 = (7, "$r7"), + R8 = (8, "$r8"), + R9 = (9, "$r9"), + R10 = (10, "$r10"), + R11 = (11, "$r11"), + R12 = (12, "$r12"), + R13 = (13, "$r13"), + R14 = (14, "$r14"), + R15 = (15, "$r15"), + R16 = (16, "$r16"), + R17 = (17, "$r17"), + R18 = (18, "$r18"), + R19 = (19, "$r19"), + R20 = (20, "$r20"), + R21 = (21, "$r21"), + R22 = (22, "$r22"), + R23 = (23, "$r23"), + R24 = (24, "$r24"), + R25 = (25, "$r25"), + R26 = (26, "$r26"), + R27 = (27, "$r27"), + R28 = (28, "$r28"), + R29 = (29, "$r29"), + R30 = (30, "$r30"), + R31 = (31, "$r31"), + + F0 = (32, "$f0"), + F1 = (33, "$f1"), + F2 = (34, "$f2"), + F3 = (35, "$f3"), + F4 = (36, "$f4"), + F5 = (37, "$f5"), + F6 = (38, "$f6"), + F7 = (39, "$f7"), + F8 = (40, "$f8"), + F9 = (41, "$f9"), + F10 = (42, "$f10"), + F11 = (43, "$f11"), + F12 = (44, "$f12"), + F13 = (45, "$f13"), + F14 = (46, "$f14"), + F15 = (47, "$f15"), + F16 = (48, "$f16"), + F17 = (49, "$f17"), + F18 = (50, "$f18"), + F19 = (51, "$f19"), + F20 = (52, "$f20"), + F21 = (53, "$f21"), + F22 = (54, "$f22"), + F23 = (55, "$f23"), + F24 = (56, "$f24"), + F25 = (57, "$f25"), + F26 = (58, "$f26"), + F27 = (59, "$f27"), + F28 = (60, "$f28"), + F29 = (61, "$f29"), + F30 = (62, "$f30"), + F31 = (63, "$f31"), + FCC0 = (64, "$fcc0"), + FCC1 = (65, "$fcc1"), + FCC2 = (66, "$fcc2"), + FCC3 = (67, "$fcc3"), + FCC4 = (68, "$fcc4"), + FCC5 = (69, "$fcc5"), + FCC6 = (70, "$fcc6"), + FCC7 = (71, "$fcc7"), +}, +aliases { + ZERO = (0, "$zero"), + RA = (1, "$ra"), + TP = (2, "$tp"), + SP = (3, "$sp"), + A0 = (4, "$a0"), + A1 = (5, "$a1"), + A2 = (6, "$a2"), + A3 = (7, "$a3"), + A4 = (8, "$a4"), + A5 = (9, "$a5"), + A6 = (10, "$a6"), + A7 = (11, "$a7"), + T0 = (12, "$t0"), + T1 = (13, "$t1"), + T2 = (14, "$t2"), + T3 = (15, "$t3"), + T4 = (16, "$t4"), + T5 = (17, "$t5"), + T6 = (18, "$t6"), + T7 = (19, "$t7"), + T8 = (20, "$t8"), + FP = (22, "$fp"), + S0 = (23, "$s0"), + S1 = (24, "$s1"), + S2 = (25, "$s2"), + S3 = (26, "$s3"), + S4 = (27, "$s4"), + S5 = (28, "$s5"), + S6 = (29, "$s6"), + S7 = (30, "$s7"), + S8 = (31, "$s8"), + + FA0 = (32, "$fa0"), + FA1 = (33, "$fa1"), + FA2 = (34, "$fa2"), + FA3 = (35, "$fa3"), + FA4 = (36, "$fa4"), + FA5 = (37, "$fa5"), + FA6 = (38, "$fa6"), + FA7 = (39, "$fa7"), + FT0 = (40, "$ft0"), + FT1 = (41, "$ft1"), + FT2 = (42, "$ft2"), + FT3 = (43, "$ft3"), + FT4 = (44, "$ft4"), + FT5 = (45, "$ft5"), + FT6 = (46, "$ft6"), + FT7 = (47, "$ft7"), + FT8 = (48, "$ft8"), + FT9 = (49, "$ft9"), + FT10 = (50, "$ft10"), + FT11 = (51, "$ft11"), + FT12 = (52, "$ft12"), + FT13 = (53, "$ft13"), + FT14 = (54, "$ft14"), + FT15 = (55, "$ft15"), + FS0 = (56, "$fs0"), + FS1 = (57, "$fs1"), + FS2 = (58, "$fs2"), + FS3 = (59, "$fs3"), + FS4 = (60, "$fs4"), + FS5 = (61, "$fs5"), + FS6 = (62, "$fs6"), + FS7 = (63, "$fs7"), +}); + /// RISC-V architecture specific definitions. /// /// See [RISC-V ELF psABI specification](https://github.com/riscv/riscv-elf-psabi-doc). diff --git a/vendor/gimli/src/lib.rs b/vendor/gimli/src/lib.rs index ed1af9cbd..db30375aa 100644 --- a/vendor/gimli/src/lib.rs +++ b/vendor/gimli/src/lib.rs @@ -26,14 +26,17 @@ #![warn(ellipsis_inclusive_range_patterns)] //#![warn(elided_lifetimes_in_paths)] #![warn(explicit_outlives_requirements)] -// Allow clippy warnings when we aren't building with clippy. -#![allow(unknown_lints)] +// Style. +#![allow(clippy::bool_to_int_with_if)] +#![allow(clippy::collapsible_else_if)] +#![allow(clippy::comparison_chain)] +#![allow(clippy::manual_range_contains)] +#![allow(clippy::needless_late_init)] +#![allow(clippy::too_many_arguments)] // False positives with `fallible_iterator`. #![allow(clippy::should_implement_trait)] -// Many false positives involving `continue`. -#![allow(clippy::never_loop)] -// False positives when block expressions are used inside an assertion. -#![allow(clippy::panic_params)] +// False positives. +#![allow(clippy::derive_partial_eq_without_eq)] #![no_std] #[allow(unused_imports)] diff --git a/vendor/gimli/src/read/abbrev.rs b/vendor/gimli/src/read/abbrev.rs index 1a24835a7..54f5cf8e5 100644 --- a/vendor/gimli/src/read/abbrev.rs +++ b/vendor/gimli/src/read/abbrev.rs @@ -1,6 +1,7 @@ //! Functions for parsing DWARF debugging abbreviations. use alloc::collections::btree_map; +use alloc::sync::Arc; use alloc::vec::Vec; use core::convert::TryFrom; use core::fmt::{self, Debug}; @@ -10,7 +11,8 @@ use core::ops::Deref; use crate::common::{DebugAbbrevOffset, Encoding, SectionId}; use crate::constants; use crate::endianity::Endianity; -use crate::read::{EndianSlice, Error, Reader, Result, Section, UnitHeader}; +use crate::read::lazy::LazyArc; +use crate::read::{EndianSlice, Error, Reader, ReaderOffset, Result, Section, UnitHeader}; /// The `DebugAbbrev` struct represents the abbreviations describing /// `DebuggingInformationEntry`s' attribute names and forms found in the @@ -100,6 +102,38 @@ impl<R> From<R> for DebugAbbrev<R> { } } +/// A cache of previously parsed `Abbreviations`. +/// +/// Currently this only caches the abbreviations for offset 0, +/// since this is a common case in which abbreviations are reused. +/// This strategy may change in future if there is sufficient need. +#[derive(Debug, Default)] +pub struct AbbreviationsCache { + abbreviations: LazyArc<Abbreviations>, +} + +impl AbbreviationsCache { + /// Create an empty abbreviations cache. + pub fn new() -> Self { + Self::default() + } + + /// Parse the abbreviations at the given offset. + /// + /// This uses or updates the cache as required. + pub fn get<R: Reader>( + &self, + debug_abbrev: &DebugAbbrev<R>, + offset: DebugAbbrevOffset<R::Offset>, + ) -> Result<Arc<Abbreviations>> { + if offset.0 != R::Offset::from_u8(0) { + return debug_abbrev.abbreviations(offset).map(Arc::new); + } + self.abbreviations + .get(|| debug_abbrev.abbreviations(offset)) + } +} + /// A set of type abbreviations. /// /// Construct an `Abbreviations` instance with the @@ -310,7 +344,7 @@ impl Attributes { /// Pushes a new value onto this list of attributes. fn push(&mut self, attr: AttributeSpecification) { match self { - Attributes::Heap(list) => return list.push(attr), + Attributes::Heap(list) => list.push(attr), Attributes::Inline { buf, len: MAX_ATTRIBUTES_INLINE, @@ -329,13 +363,13 @@ impl Attributes { impl Debug for Attributes { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - (&**self).fmt(f) + (**self).fmt(f) } } impl PartialEq for Attributes { fn eq(&self, other: &Attributes) -> bool { - &**self == &**other + **self == **other } } @@ -360,7 +394,7 @@ impl FromIterator<AttributeSpecification> for Attributes { for item in iter { list.push(item); } - return list; + list } } @@ -470,8 +504,7 @@ pub(crate) fn get_attribute_size(form: constants::DwForm, encoding: Encoding) -> match form { constants::DW_FORM_addr => Some(encoding.address_size), - constants::DW_FORM_implicit_const | - constants::DW_FORM_flag_present => Some(0), + constants::DW_FORM_implicit_const | constants::DW_FORM_flag_present => Some(0), constants::DW_FORM_data1 | constants::DW_FORM_flag @@ -497,7 +530,7 @@ pub(crate) fn get_attribute_size(form: constants::DwForm, encoding: Encoding) -> | constants::DW_FORM_ref_sig8 | constants::DW_FORM_ref_sup8 => Some(8), - constants::DW_FORM_data16 => Some(16), + constants::DW_FORM_data16 => Some(16), constants::DW_FORM_sec_offset | constants::DW_FORM_GNU_ref_alt @@ -518,16 +551,16 @@ pub(crate) fn get_attribute_size(form: constants::DwForm, encoding: Encoding) -> } // Variably sized forms. - constants::DW_FORM_block | - constants::DW_FORM_block1 | - constants::DW_FORM_block2 | - constants::DW_FORM_block4 | - constants::DW_FORM_exprloc | - constants::DW_FORM_ref_udata | - constants::DW_FORM_string | - constants::DW_FORM_sdata | - constants::DW_FORM_udata | - constants::DW_FORM_indirect | + constants::DW_FORM_block + | constants::DW_FORM_block1 + | constants::DW_FORM_block2 + | constants::DW_FORM_block4 + | constants::DW_FORM_exprloc + | constants::DW_FORM_ref_udata + | constants::DW_FORM_string + | constants::DW_FORM_sdata + | constants::DW_FORM_udata + | constants::DW_FORM_indirect => None, // We don't know the size of unknown forms. _ => None, @@ -993,4 +1026,64 @@ pub mod tests { .unwrap(); assert!(abbrevs.get(0).is_none()); } + + #[test] + fn abbreviations_cache() { + #[rustfmt::skip] + let buf = Section::new() + .abbrev(1, constants::DW_TAG_subprogram, constants::DW_CHILDREN_no) + .abbrev_attr(constants::DW_AT_name, constants::DW_FORM_string) + .abbrev_attr_null() + .abbrev_null() + .abbrev(1, constants::DW_TAG_compile_unit, constants::DW_CHILDREN_yes) + .abbrev_attr(constants::DW_AT_producer, constants::DW_FORM_strp) + .abbrev_attr(constants::DW_AT_language, constants::DW_FORM_data2) + .abbrev_attr_null() + .abbrev_null() + .get_contents() + .unwrap(); + + let abbrev1 = Abbreviation::new( + 1, + constants::DW_TAG_subprogram, + constants::DW_CHILDREN_no, + vec![AttributeSpecification::new( + constants::DW_AT_name, + constants::DW_FORM_string, + None, + )] + .into(), + ); + + let abbrev2 = Abbreviation::new( + 1, + constants::DW_TAG_compile_unit, + constants::DW_CHILDREN_yes, + vec![ + AttributeSpecification::new( + constants::DW_AT_producer, + constants::DW_FORM_strp, + None, + ), + AttributeSpecification::new( + constants::DW_AT_language, + constants::DW_FORM_data2, + None, + ), + ] + .into(), + ); + + let debug_abbrev = DebugAbbrev::new(&buf, LittleEndian); + let cache = AbbreviationsCache::new(); + let abbrevs1 = cache.get(&debug_abbrev, DebugAbbrevOffset(0)).unwrap(); + assert_eq!(abbrevs1.get(1), Some(&abbrev1)); + let abbrevs2 = cache.get(&debug_abbrev, DebugAbbrevOffset(8)).unwrap(); + assert_eq!(abbrevs2.get(1), Some(&abbrev2)); + let abbrevs3 = cache.get(&debug_abbrev, DebugAbbrevOffset(0)).unwrap(); + assert_eq!(abbrevs3.get(1), Some(&abbrev1)); + + assert!(!Arc::ptr_eq(&abbrevs1, &abbrevs2)); + assert!(Arc::ptr_eq(&abbrevs1, &abbrevs3)); + } } diff --git a/vendor/gimli/src/read/cfi.rs b/vendor/gimli/src/read/cfi.rs index 2e5167349..5e9befac1 100644 --- a/vendor/gimli/src/read/cfi.rs +++ b/vendor/gimli/src/read/cfi.rs @@ -1058,7 +1058,6 @@ where Fde(PartialFrameDescriptionEntry<'bases, Section, R>), } -#[allow(clippy::type_complexity)] fn parse_cfi_entry<'bases, Section, R>( bases: &'bases BaseAddresses, section: &Section, @@ -1617,7 +1616,6 @@ where } impl<R: Reader> FrameDescriptionEntry<R> { - #[allow(clippy::too_many_arguments)] fn parse_rest<Section, F>( offset: R::Offset, length: R::Offset, @@ -1982,7 +1980,7 @@ impl<R: Reader, A: UnwindContextStorage<R>> UnwindContext<R, A> { } let mut table = UnwindTable::new_for_cie(section, bases, self, cie); - while let Some(_) = table.next_row()? {} + while table.next_row()?.is_some() {} self.save_initial_rules()?; Ok(()) @@ -2005,7 +2003,7 @@ impl<R: Reader, A: UnwindContextStorage<R>> UnwindContext<R, A> { } fn save_initial_rules(&mut self) -> Result<()> { - assert_eq!(self.is_initialized, false); + debug_assert!(!self.is_initialized); self.initial_rule = match *self.stack.last().unwrap().registers.rules { // All rules are default (undefined). In this case just synthesize // an undefined rule. @@ -2821,10 +2819,7 @@ pub enum RegisterRule<R: Reader> { impl<R: Reader> RegisterRule<R> { fn is_defined(&self) -> bool { - match *self { - RegisterRule::Undefined => false, - _ => true, - } + !matches!(*self, RegisterRule::Undefined) } } @@ -3394,10 +3389,10 @@ impl Default for Pointer { } } -impl Into<u64> for Pointer { +impl From<Pointer> for u64 { #[inline] - fn into(self) -> u64 { - match self { + fn from(p: Pointer) -> u64 { + match p { Pointer::Direct(p) | Pointer::Indirect(p) => p, } } @@ -3762,8 +3757,6 @@ mod tests { } } - #[allow(clippy::type_complexity)] - #[allow(clippy::needless_pass_by_value)] fn assert_parse_cie<'input, E>( kind: SectionKind<DebugFrame<EndianSlice<'input, E>>>, section: Section, @@ -5118,7 +5111,6 @@ mod tests { assert_eq!(iter.next(), Ok(None)); } - #[allow(clippy::needless_pass_by_value)] fn assert_eval<'a, I>( mut initial_ctx: UnwindContext<EndianSlice<'a, LittleEndian>>, expected_ctx: UnwindContext<EndianSlice<'a, LittleEndian>>, @@ -5598,7 +5590,6 @@ mod tests { #[test] fn test_unwind_table_cie_no_rule() { - #[allow(clippy::identity_op)] let initial_instructions = Section::with_endian(Endian::Little) // The CFA is -12 from register 4. .D8(constants::DW_CFA_def_cfa_sf.0) @@ -5671,7 +5662,6 @@ mod tests { #[test] fn test_unwind_table_cie_single_rule() { - #[allow(clippy::identity_op)] let initial_instructions = Section::with_endian(Endian::Little) // The CFA is -12 from register 4. .D8(constants::DW_CFA_def_cfa_sf.0) @@ -5747,7 +5737,6 @@ mod tests { #[test] fn test_unwind_table_next_row() { - #[allow(clippy::identity_op)] let initial_instructions = Section::with_endian(Endian::Little) // The CFA is -12 from register 4. .D8(constants::DW_CFA_def_cfa_sf.0) diff --git a/vendor/gimli/src/read/dwarf.rs b/vendor/gimli/src/read/dwarf.rs index b63526941..cce364c2b 100644 --- a/vendor/gimli/src/read/dwarf.rs +++ b/vendor/gimli/src/read/dwarf.rs @@ -9,11 +9,11 @@ use crate::common::{ }; use crate::constants; use crate::read::{ - Abbreviations, AttributeValue, DebugAbbrev, DebugAddr, DebugAranges, DebugCuIndex, DebugInfo, - DebugInfoUnitHeadersIter, DebugLine, DebugLineStr, DebugLoc, DebugLocLists, DebugRngLists, - DebugStr, DebugStrOffsets, DebugTuIndex, DebugTypes, DebugTypesUnitHeadersIter, - DebuggingInformationEntry, EntriesCursor, EntriesRaw, EntriesTree, Error, - IncompleteLineProgram, LocListIter, LocationLists, Range, RangeLists, RawLocListIter, + Abbreviations, AbbreviationsCache, AttributeValue, DebugAbbrev, DebugAddr, DebugAranges, + DebugCuIndex, DebugInfo, DebugInfoUnitHeadersIter, DebugLine, DebugLineStr, DebugLoc, + DebugLocLists, DebugRngLists, DebugStr, DebugStrOffsets, DebugTuIndex, DebugTypes, + DebugTypesUnitHeadersIter, DebuggingInformationEntry, EntriesCursor, EntriesRaw, EntriesTree, + Error, IncompleteLineProgram, LocListIter, LocationLists, Range, RangeLists, RawLocListIter, RawRngListIter, Reader, ReaderOffset, ReaderOffsetId, Result, RngListIter, Section, UnitHeader, UnitIndex, UnitIndexSectionIterator, UnitOffset, UnitType, }; @@ -59,6 +59,9 @@ pub struct Dwarf<R> { /// The DWARF sections for a supplementary object file. pub sup: Option<Arc<Dwarf<R>>>, + + /// A cache of previously parsed abbreviations for units in this file. + pub abbreviations_cache: AbbreviationsCache, } impl<T> Dwarf<T> { @@ -96,6 +99,7 @@ impl<T> Dwarf<T> { ranges: RangeLists::new(debug_ranges, debug_rnglists), file_type: DwarfFileType::Main, sup: None, + abbreviations_cache: AbbreviationsCache::new(), }) } @@ -157,6 +161,7 @@ impl<T> Dwarf<T> { ranges: self.ranges.borrow(&mut borrow), file_type: self.file_type, sup: self.sup().map(|sup| Arc::new(sup.borrow(borrow))), + abbreviations_cache: AbbreviationsCache::new(), } } @@ -192,10 +197,10 @@ impl<R: Reader> Dwarf<R> { } /// Parse the abbreviations for a compilation unit. - // TODO: provide caching of abbreviations #[inline] - pub fn abbreviations(&self, unit: &UnitHeader<R>) -> Result<Abbreviations> { - unit.abbreviations(&self.debug_abbrev) + pub fn abbreviations(&self, unit: &UnitHeader<R>) -> Result<Arc<Abbreviations>> { + self.abbreviations_cache + .get(&self.debug_abbrev, unit.debug_abbrev_offset()) } /// Return the string offset at the given index. @@ -783,6 +788,7 @@ impl<R: Reader> DwarfPackage<R> { ranges: RangeLists::new(debug_ranges, debug_rnglists), file_type: DwarfFileType::Dwo, sup: None, + abbreviations_cache: AbbreviationsCache::new(), }) } } @@ -799,7 +805,7 @@ where pub header: UnitHeader<R, Offset>, /// The parsed abbreviations for the unit. - pub abbreviations: Abbreviations, + pub abbreviations: Arc<Abbreviations>, /// The `DW_AT_name` attribute of the unit. pub name: Option<R>, @@ -833,7 +839,7 @@ impl<R: Reader> Unit<R> { /// Construct a new `Unit` from the given unit header. #[inline] pub fn new(dwarf: &Dwarf<R>, header: UnitHeader<R>) -> Result<Self> { - let abbreviations = header.abbreviations(&dwarf.debug_abbrev)?; + let abbreviations = dwarf.abbreviations(&header)?; let mut unit = Unit { abbreviations, name: None, diff --git a/vendor/gimli/src/read/endian_slice.rs b/vendor/gimli/src/read/endian_slice.rs index 05262cdec..d0fd67c0b 100644 --- a/vendor/gimli/src/read/endian_slice.rs +++ b/vendor/gimli/src/read/endian_slice.rs @@ -197,12 +197,12 @@ where } } -impl<'input, Endian> Into<&'input [u8]> for EndianSlice<'input, Endian> +impl<'input, Endian> From<EndianSlice<'input, Endian>> for &'input [u8] where Endian: Endianity, { - fn into(self) -> &'input [u8] { - self.slice + fn from(endian_slice: EndianSlice<'input, Endian>) -> &'input [u8] { + endian_slice.slice } } diff --git a/vendor/gimli/src/read/lazy.rs b/vendor/gimli/src/read/lazy.rs new file mode 100644 index 000000000..6138735c8 --- /dev/null +++ b/vendor/gimli/src/read/lazy.rs @@ -0,0 +1,116 @@ +pub(crate) use imp::*; + +#[cfg(not(feature = "std"))] +mod imp { + use alloc::sync::Arc; + use core::sync::atomic::{AtomicPtr, Ordering}; + use core::{mem, ptr}; + + #[derive(Debug, Default)] + pub(crate) struct LazyArc<T> { + // Only written once with a value obtained from `Arc<T>::into_raw`. + // This holds a ref count for the `Arc`, so it is always safe to + // clone the `Arc` given a reference to the `LazyArc`. + value: AtomicPtr<T>, + } + + impl<T> Drop for LazyArc<T> { + fn drop(&mut self) { + let value_ptr = self.value.load(Ordering::Acquire); + if !value_ptr.is_null() { + // SAFETY: all writes to `self.value` are pointers obtained from `Arc::into_raw`. + drop(unsafe { Arc::from_raw(value_ptr) }); + } + } + } + + impl<T> LazyArc<T> { + pub(crate) fn get<E, F: FnOnce() -> Result<T, E>>(&self, f: F) -> Result<Arc<T>, E> { + // Clone an `Arc` given a pointer obtained from `Arc::into_raw`. + // SAFETY: `value_ptr` must be a valid pointer obtained from `Arc<T>::into_raw`. + unsafe fn clone_arc_ptr<T>(value_ptr: *const T) -> Arc<T> { + let value = Arc::from_raw(value_ptr); + let clone = Arc::clone(&value); + mem::forget(value); + clone + } + + // Return the existing value if already computed. + // `Ordering::Acquire` is needed so that the content of the loaded `Arc` is + // visible to this thread. + let value_ptr = self.value.load(Ordering::Acquire); + if !value_ptr.is_null() { + // SAFETY: all writes to `self.value` are pointers obtained from `Arc::into_raw`. + return Ok(unsafe { clone_arc_ptr(value_ptr) }); + } + + // Race to compute and set the value. + let value = f().map(Arc::new)?; + let value_ptr = Arc::into_raw(value); + match self.value.compare_exchange( + ptr::null_mut(), + value_ptr as *mut T, + // Success: `Ordering::Release` is needed so that the content of the stored `Arc` + // is visible to other threads. No ordering is required for the null ptr that is + // loaded, but older rust versions (< 1.64) require that its ordering must not + // be weaker than the failure ordering, so we use `Ordering::AcqRel`. + Ordering::AcqRel, + // Failure: `Ordering::Acquire` is needed so that the content of the loaded `Arc` + // is visible to this thread. + Ordering::Acquire, + ) { + Ok(_) => { + // Return the value we computed. + // SAFETY: `value_ptr` was obtained from `Arc::into_raw`. + Ok(unsafe { clone_arc_ptr(value_ptr) }) + } + Err(existing_value_ptr) => { + // We lost the race, drop unneeded `value_ptr`. + // SAFETY: `value_ptr` was obtained from `Arc::into_raw`. + drop(unsafe { Arc::from_raw(value_ptr) }); + // Return the existing value. + // SAFETY: all writes to `self.value` are pointers obtained from `Arc::into_raw`. + Ok(unsafe { clone_arc_ptr(existing_value_ptr) }) + } + } + } + } +} + +#[cfg(feature = "std")] +mod imp { + use std::sync::{Arc, Mutex}; + + #[derive(Debug, Default)] + pub(crate) struct LazyArc<T> { + value: Mutex<Option<Arc<T>>>, + } + + impl<T> LazyArc<T> { + pub(crate) fn get<E, F: FnOnce() -> Result<T, E>>(&self, f: F) -> Result<Arc<T>, E> { + let mut lock = self.value.lock().unwrap(); + if let Some(value) = &*lock { + return Ok(value.clone()); + } + let value = f().map(Arc::new)?; + *lock = Some(value.clone()); + Ok(value) + } + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn lazy_arc() { + let lazy = LazyArc::default(); + let value = lazy.get(|| Err(())); + assert_eq!(value, Err(())); + let value = lazy.get(|| Ok::<i32, ()>(3)).unwrap(); + assert_eq!(*value, 3); + let value = lazy.get(|| Err(())).unwrap(); + assert_eq!(*value, 3); + } +} diff --git a/vendor/gimli/src/read/line.rs b/vendor/gimli/src/read/line.rs index 0e7380bb9..f7f44b2b5 100644 --- a/vendor/gimli/src/read/line.rs +++ b/vendor/gimli/src/read/line.rs @@ -198,7 +198,6 @@ where R: Reader<Offset = Offset>, Offset: ReaderOffset, { - #[allow(clippy::new_ret_no_self)] fn new(program: IncompleteLineProgram<R, Offset>) -> OneShotLineRows<R, Offset> { let row = LineRow::new(program.header()); let instructions = LineInstructions { @@ -606,7 +605,6 @@ impl<R: Reader> LineInstructions<R> { /// /// Unfortunately, the `header` parameter means that this cannot be a /// `FallibleIterator`. - #[allow(clippy::inline_always)] #[inline(always)] pub fn next_instruction( &mut self, diff --git a/vendor/gimli/src/read/loclists.rs b/vendor/gimli/src/read/loclists.rs index 3902c181b..5cba675d2 100644 --- a/vendor/gimli/src/read/loclists.rs +++ b/vendor/gimli/src/read/loclists.rs @@ -233,7 +233,7 @@ impl<R: Reader> LocationLists<R> { let (mut input, format) = if unit_encoding.version <= 4 { (self.debug_loc.section.clone(), LocListsFormat::Bare) } else { - (self.debug_loclists.section.clone(), LocListsFormat::LLE) + (self.debug_loclists.section.clone(), LocListsFormat::Lle) }; input.skip(offset.0)?; Ok(RawLocListIter::new(input, unit_encoding, format)) @@ -259,7 +259,7 @@ impl<R: Reader> LocationLists<R> { Ok(RawLocListIter::new( input, unit_encoding, - LocListsFormat::LLE, + LocListsFormat::Lle, )) } @@ -300,7 +300,7 @@ enum LocListsFormat { Bare, /// The DW_LLE encoded range list format used in DWARF 5 and the non-standard GNU /// split dwarf extension. - LLE, + Lle, } /// A raw iterator over a location list. @@ -402,10 +402,10 @@ fn parse_data<R: Reader>(input: &mut R, encoding: Encoding) -> Result<Expression impl<R: Reader> RawLocListEntry<R> { /// Parse a location list entry from `.debug_loclists` fn parse(input: &mut R, encoding: Encoding, format: LocListsFormat) -> Result<Option<Self>> { - match format { + Ok(match format { LocListsFormat::Bare => { let range = RawRange::parse(input, encoding.address_size)?; - return Ok(if range.is_end() { + if range.is_end() { None } else if range.is_base_address(encoding.address_size) { Some(RawLocListEntry::BaseAddress { addr: range.end }) @@ -417,9 +417,9 @@ impl<R: Reader> RawLocListEntry<R> { end: range.end, data, }) - }); + } } - LocListsFormat::LLE => Ok(match constants::DwLle(input.read_u8()?) { + LocListsFormat::Lle => match constants::DwLle(input.read_u8()?) { constants::DW_LLE_end_of_list => None, constants::DW_LLE_base_addressx => Some(RawLocListEntry::BaseAddressx { addr: DebugAddrIndex(input.read_uleb128().and_then(R::Offset::from_u64)?), @@ -463,8 +463,8 @@ impl<R: Reader> RawLocListEntry<R> { _ => { return Err(Error::InvalidAddressRange); } - }), - } + }, + }) } } @@ -552,63 +552,96 @@ impl<R: Reader> LocListIter<R> { None => return Ok(None), }; - let (range, data) = match raw_loc { - RawLocListEntry::BaseAddress { addr } => { - self.base_address = addr; - continue; - } - RawLocListEntry::BaseAddressx { addr } => { - self.base_address = self.get_address(addr)?; - continue; - } - RawLocListEntry::StartxEndx { begin, end, data } => { - let begin = self.get_address(begin)?; - let end = self.get_address(end)?; - (Range { begin, end }, data) - } - RawLocListEntry::StartxLength { - begin, - length, - data, - } => { - let begin = self.get_address(begin)?; - let end = begin + length; - (Range { begin, end }, data) - } - RawLocListEntry::DefaultLocation { data } => ( - Range { - begin: 0, - end: u64::max_value(), - }, - data, - ), - RawLocListEntry::AddressOrOffsetPair { begin, end, data } - | RawLocListEntry::OffsetPair { begin, end, data } => { - let mut range = Range { begin, end }; - range.add_base_address(self.base_address, self.raw.encoding.address_size); - (range, data) - } - RawLocListEntry::StartEnd { begin, end, data } => (Range { begin, end }, data), - RawLocListEntry::StartLength { - begin, - length, - data, - } => ( - Range { - begin, - end: begin + length, - }, - data, - ), - }; + let loc = self.convert_raw(raw_loc)?; + if loc.is_some() { + return Ok(loc); + } + } + } - if range.begin > range.end { - self.raw.input.empty(); - return Err(Error::InvalidLocationAddressRange); + /// Return the next raw location. + /// + /// The raw location should be passed to `convert_raw`. + #[doc(hidden)] + pub fn next_raw(&mut self) -> Result<Option<RawLocListEntry<R>>> { + self.raw.next() + } + + /// Convert a raw location into a location, and update the state of the iterator. + /// + /// The raw location should have been obtained from `next_raw`. + #[doc(hidden)] + pub fn convert_raw( + &mut self, + raw_loc: RawLocListEntry<R>, + ) -> Result<Option<LocationListEntry<R>>> { + let mask = !0 >> (64 - self.raw.encoding.address_size * 8); + let tombstone = if self.raw.encoding.version <= 4 { + mask - 1 + } else { + mask + }; + + let (range, data) = match raw_loc { + RawLocListEntry::BaseAddress { addr } => { + self.base_address = addr; + return Ok(None); + } + RawLocListEntry::BaseAddressx { addr } => { + self.base_address = self.get_address(addr)?; + return Ok(None); + } + RawLocListEntry::StartxEndx { begin, end, data } => { + let begin = self.get_address(begin)?; + let end = self.get_address(end)?; + (Range { begin, end }, data) + } + RawLocListEntry::StartxLength { + begin, + length, + data, + } => { + let begin = self.get_address(begin)?; + let end = begin.wrapping_add(length) & mask; + (Range { begin, end }, data) + } + RawLocListEntry::DefaultLocation { data } => ( + Range { + begin: 0, + end: u64::max_value(), + }, + data, + ), + RawLocListEntry::AddressOrOffsetPair { begin, end, data } + | RawLocListEntry::OffsetPair { begin, end, data } => { + if self.base_address == tombstone { + return Ok(None); + } + let mut range = Range { begin, end }; + range.add_base_address(self.base_address, self.raw.encoding.address_size); + (range, data) + } + RawLocListEntry::StartEnd { begin, end, data } => (Range { begin, end }, data), + RawLocListEntry::StartLength { + begin, + length, + data, + } => { + let end = begin.wrapping_add(length) & mask; + (Range { begin, end }, data) } + }; - return Ok(Some(LocationListEntry { range, data })); + if range.begin == tombstone { + return Ok(None); } + + if range.begin > range.end { + self.raw.input.empty(); + return Err(Error::InvalidLocationAddressRange); + } + + Ok(Some(LocationListEntry { range, data })) } } @@ -643,6 +676,7 @@ mod tests { #[test] fn test_loclists_32() { + let tombstone = !0u32; let encoding = Encoding { format: Format::Dwarf32, version: 5, @@ -653,7 +687,9 @@ mod tests { .L32(0x0300_0000) .L32(0x0301_0300) .L32(0x0301_0400) - .L32(0x0301_0500); + .L32(0x0301_0500) + .L32(tombstone) + .L32(0x0301_0600); let buf = section.get_contents().unwrap(); let debug_addr = &DebugAddr::from(EndianSlice::new(&buf, LittleEndian)); let debug_addr_base = DebugAddrBase(0); @@ -697,6 +733,25 @@ mod tests { .L8(2).uleb(1).uleb(2).uleb(4).L32(12) // A StartxLength .L8(3).uleb(3).uleb(0x100).uleb(4).L32(13) + + // Tombstone entries, all of which should be ignored. + // A BaseAddressx that is a tombstone. + .L8(1).uleb(4) + .L8(4).uleb(0x11100).uleb(0x11200).uleb(4).L32(20) + // A BaseAddress that is a tombstone. + .L8(6).L32(tombstone) + .L8(4).uleb(0x11300).uleb(0x11400).uleb(4).L32(21) + // A StartxEndx that is a tombstone. + .L8(2).uleb(4).uleb(5).uleb(4).L32(22) + // A StartxLength that is a tombstone. + .L8(3).uleb(4).uleb(0x100).uleb(4).L32(23) + // A StartEnd that is a tombstone. + .L8(7).L32(tombstone).L32(0x201_1500).uleb(4).L32(24) + // A StartLength that is a tombstone. + .L8(8).L32(tombstone).uleb(0x100).uleb(4).L32(25) + // A StartEnd (not ignored) + .L8(7).L32(0x201_1600).L32(0x201_1700).uleb(4).L32(26) + // A range end. .L8(0) // Some extra data. @@ -854,6 +909,18 @@ mod tests { })) ); + // A StartEnd location following the tombstones + assert_eq!( + locations.next(), + Ok(Some(LocationListEntry { + range: Range { + begin: 0x0201_1600, + end: 0x0201_1700, + }, + data: Expression(EndianSlice::new(&[26, 0, 0, 0], LittleEndian)), + })) + ); + // A location list end. assert_eq!(locations.next(), Ok(None)); @@ -872,6 +939,7 @@ mod tests { #[test] fn test_loclists_64() { + let tombstone = !0u64; let encoding = Encoding { format: Format::Dwarf64, version: 5, @@ -882,7 +950,9 @@ mod tests { .L64(0x0300_0000) .L64(0x0301_0300) .L64(0x0301_0400) - .L64(0x0301_0500); + .L64(0x0301_0500) + .L64(tombstone) + .L64(0x0301_0600); let buf = section.get_contents().unwrap(); let debug_addr = &DebugAddr::from(EndianSlice::new(&buf, LittleEndian)); let debug_addr_base = DebugAddrBase(0); @@ -927,6 +997,25 @@ mod tests { .L8(2).uleb(1).uleb(2).uleb(4).L32(12) // A StartxLength .L8(3).uleb(3).uleb(0x100).uleb(4).L32(13) + + // Tombstone entries, all of which should be ignored. + // A BaseAddressx that is a tombstone. + .L8(1).uleb(4) + .L8(4).uleb(0x11100).uleb(0x11200).uleb(4).L32(20) + // A BaseAddress that is a tombstone. + .L8(6).L64(tombstone) + .L8(4).uleb(0x11300).uleb(0x11400).uleb(4).L32(21) + // A StartxEndx that is a tombstone. + .L8(2).uleb(4).uleb(5).uleb(4).L32(22) + // A StartxLength that is a tombstone. + .L8(3).uleb(4).uleb(0x100).uleb(4).L32(23) + // A StartEnd that is a tombstone. + .L8(7).L64(tombstone).L64(0x201_1500).uleb(4).L32(24) + // A StartLength that is a tombstone. + .L8(8).L64(tombstone).uleb(0x100).uleb(4).L32(25) + // A StartEnd (not ignored) + .L8(7).L64(0x201_1600).L64(0x201_1700).uleb(4).L32(26) + // A range end. .L8(0) // Some extra data. @@ -1084,6 +1173,18 @@ mod tests { })) ); + // A StartEnd location following the tombstones + assert_eq!( + locations.next(), + Ok(Some(LocationListEntry { + range: Range { + begin: 0x0201_1600, + end: 0x0201_1700, + }, + data: Expression(EndianSlice::new(&[26, 0, 0, 0], LittleEndian)), + })) + ); + // A location list end. assert_eq!(locations.next(), Ok(None)); @@ -1102,6 +1203,7 @@ mod tests { #[test] fn test_location_list_32() { + let tombstone = !0u32 - 1; let start = Label::new(); let first = Label::new(); #[rustfmt::skip] @@ -1123,6 +1225,11 @@ mod tests { // A location range that ends at -1. .L32(0xffff_ffff).L32(0x0000_0000) .L32(0).L32(0xffff_ffff).L16(4).L32(7) + // A normal location with tombstone. + .L32(tombstone).L32(tombstone).L16(4).L32(8) + // A base address selection with tombstone followed by a normal location. + .L32(0xffff_ffff).L32(tombstone) + .L32(0x10a00).L32(0x10b00).L16(4).L32(9) // A location list end. .L32(0).L32(0) // Some extra data. @@ -1232,6 +1339,7 @@ mod tests { #[test] fn test_location_list_64() { + let tombstone = !0u64 - 1; let start = Label::new(); let first = Label::new(); #[rustfmt::skip] @@ -1253,6 +1361,11 @@ mod tests { // A location range that ends at -1. .L64(0xffff_ffff_ffff_ffff).L64(0x0000_0000) .L64(0).L64(0xffff_ffff_ffff_ffff).L16(4).L32(7) + // A normal location with tombstone. + .L64(tombstone).L64(tombstone).L16(4).L32(8) + // A base address selection with tombstone followed by a normal location. + .L64(0xffff_ffff_ffff_ffff).L64(tombstone) + .L64(0x10a00).L64(0x10b00).L16(4).L32(9) // A location list end. .L64(0).L64(0) // Some extra data. diff --git a/vendor/gimli/src/read/mod.rs b/vendor/gimli/src/read/mod.rs index 3110957c2..b2828d5f9 100644 --- a/vendor/gimli/src/read/mod.rs +++ b/vendor/gimli/src/read/mod.rs @@ -214,6 +214,9 @@ mod index; pub use self::index::*; #[cfg(feature = "read")] +mod lazy; + +#[cfg(feature = "read")] mod line; #[cfg(feature = "read")] pub use self::line::*; diff --git a/vendor/gimli/src/read/op.rs b/vendor/gimli/src/read/op.rs index 88ea20297..670d1ad21 100644 --- a/vendor/gimli/src/read/op.rs +++ b/vendor/gimli/src/read/op.rs @@ -346,10 +346,7 @@ where { /// Return true if the piece is empty. pub fn is_empty(&self) -> bool { - match *self { - Location::Empty => true, - _ => false, - } + matches!(*self, Location::Empty) } } @@ -1225,7 +1222,6 @@ impl<R: Reader, S: EvaluationStorage<R>> Evaluation<R, S> { self.stack.try_push(value).map_err(|_| Error::StackFull) } - #[allow(clippy::cyclomatic_complexity)] fn evaluate_one_operation(&mut self) -> Result<OperationEvaluationResult<R>> { let operation = Operation::parse(&mut self.pc, self.encoding)?; @@ -2889,7 +2885,6 @@ mod tests { result } - #[allow(clippy::too_many_arguments)] fn check_eval_with_args<F>( program: &[AssemblerEntry], expect: Result<&[Piece<EndianSlice<LittleEndian>>]>, diff --git a/vendor/gimli/src/read/rnglists.rs b/vendor/gimli/src/read/rnglists.rs index d8d49042f..12e3e04ee 100644 --- a/vendor/gimli/src/read/rnglists.rs +++ b/vendor/gimli/src/read/rnglists.rs @@ -232,7 +232,7 @@ impl<R: Reader> RangeLists<R> { let (mut input, format) = if unit_encoding.version <= 4 { (self.debug_ranges.section.clone(), RangeListsFormat::Bare) } else { - (self.debug_rnglists.section.clone(), RangeListsFormat::RLE) + (self.debug_rnglists.section.clone(), RangeListsFormat::Rle) }; input.skip(offset.0)?; Ok(RawRngListIter::new(input, unit_encoding, format)) @@ -277,7 +277,7 @@ enum RangeListsFormat { /// The bare range list format used before DWARF 5. Bare, /// The DW_RLE encoded range list format used in DWARF 5. - RLE, + Rle, } /// A raw iterator over an address range list. @@ -355,10 +355,10 @@ impl<T: ReaderOffset> RawRngListEntry<T> { encoding: Encoding, format: RangeListsFormat, ) -> Result<Option<Self>> { - match format { + Ok(match format { RangeListsFormat::Bare => { let range = RawRange::parse(input, encoding.address_size)?; - return Ok(if range.is_end() { + if range.is_end() { None } else if range.is_base_address(encoding.address_size) { Some(RawRngListEntry::BaseAddress { addr: range.end }) @@ -367,9 +367,9 @@ impl<T: ReaderOffset> RawRngListEntry<T> { begin: range.begin, end: range.end, }) - }); + } } - RangeListsFormat::RLE => Ok(match constants::DwRle(input.read_u8()?) { + RangeListsFormat::Rle => match constants::DwRle(input.read_u8()?) { constants::DW_RLE_end_of_list => None, constants::DW_RLE_base_addressx => Some(RawRngListEntry::BaseAddressx { addr: DebugAddrIndex(input.read_uleb128().and_then(R::Offset::from_u64)?), @@ -400,8 +400,8 @@ impl<T: ReaderOffset> RawRngListEntry<T> { _ => { return Err(Error::InvalidAddressRange); } - }), - } + }, + }) } } @@ -489,45 +489,78 @@ impl<R: Reader> RngListIter<R> { None => return Ok(None), }; - let range = match raw_range { - RawRngListEntry::BaseAddress { addr } => { - self.base_address = addr; - continue; - } - RawRngListEntry::BaseAddressx { addr } => { - self.base_address = self.get_address(addr)?; - continue; - } - RawRngListEntry::StartxEndx { begin, end } => { - let begin = self.get_address(begin)?; - let end = self.get_address(end)?; - Range { begin, end } - } - RawRngListEntry::StartxLength { begin, length } => { - let begin = self.get_address(begin)?; - let end = begin + length; - Range { begin, end } - } - RawRngListEntry::AddressOrOffsetPair { begin, end } - | RawRngListEntry::OffsetPair { begin, end } => { - let mut range = Range { begin, end }; - range.add_base_address(self.base_address, self.raw.encoding.address_size); - range - } - RawRngListEntry::StartEnd { begin, end } => Range { begin, end }, - RawRngListEntry::StartLength { begin, length } => Range { - begin, - end: begin + length, - }, - }; + let range = self.convert_raw(raw_range)?; + if range.is_some() { + return Ok(range); + } + } + } - if range.begin > range.end { - self.raw.input.empty(); - return Err(Error::InvalidAddressRange); + /// Return the next raw range. + /// + /// The raw range should be passed to `convert_range`. + #[doc(hidden)] + pub fn next_raw(&mut self) -> Result<Option<RawRngListEntry<R::Offset>>> { + self.raw.next() + } + + /// Convert a raw range into a range, and update the state of the iterator. + /// + /// The raw range should have been obtained from `next_raw`. + #[doc(hidden)] + pub fn convert_raw(&mut self, raw_range: RawRngListEntry<R::Offset>) -> Result<Option<Range>> { + let mask = !0 >> (64 - self.raw.encoding.address_size * 8); + let tombstone = if self.raw.encoding.version <= 4 { + mask - 1 + } else { + mask + }; + + let range = match raw_range { + RawRngListEntry::BaseAddress { addr } => { + self.base_address = addr; + return Ok(None); + } + RawRngListEntry::BaseAddressx { addr } => { + self.base_address = self.get_address(addr)?; + return Ok(None); + } + RawRngListEntry::StartxEndx { begin, end } => { + let begin = self.get_address(begin)?; + let end = self.get_address(end)?; + Range { begin, end } + } + RawRngListEntry::StartxLength { begin, length } => { + let begin = self.get_address(begin)?; + let end = begin.wrapping_add(length) & mask; + Range { begin, end } + } + RawRngListEntry::AddressOrOffsetPair { begin, end } + | RawRngListEntry::OffsetPair { begin, end } => { + if self.base_address == tombstone { + return Ok(None); + } + let mut range = Range { begin, end }; + range.add_base_address(self.base_address, self.raw.encoding.address_size); + range } + RawRngListEntry::StartEnd { begin, end } => Range { begin, end }, + RawRngListEntry::StartLength { begin, length } => { + let end = begin.wrapping_add(length) & mask; + Range { begin, end } + } + }; + + if range.begin == tombstone { + return Ok(None); + } - return Ok(Some(range)); + if range.begin > range.end { + self.raw.input.empty(); + return Err(Error::InvalidAddressRange); } + + Ok(Some(range)) } } @@ -553,8 +586,6 @@ pub(crate) struct RawRange { impl RawRange { /// Check if this is a range end entry. - /// - /// This will only occur for raw ranges. #[inline] pub fn is_end(&self) -> bool { self.begin == 0 && self.end == 0 @@ -563,14 +594,13 @@ impl RawRange { /// Check if this is a base address selection entry. /// /// A base address selection entry changes the base address that subsequent - /// range entries are relative to. This will only occur for raw ranges. + /// range entries are relative to. #[inline] pub fn is_base_address(&self, address_size: u8) -> bool { self.begin == !0 >> (64 - address_size * 8) } /// Parse an address range entry from `.debug_ranges` or `.debug_loc`. - #[doc(hidden)] #[inline] pub fn parse<R: Reader>(input: &mut R, address_size: u8) -> Result<RawRange> { let begin = input.read_address(address_size)?; @@ -610,6 +640,7 @@ mod tests { #[test] fn test_rnglists_32() { + let tombstone = !0u32; let encoding = Encoding { format: Format::Dwarf32, version: 5, @@ -619,7 +650,9 @@ mod tests { .L32(0x0300_0000) .L32(0x0301_0300) .L32(0x0301_0400) - .L32(0x0301_0500); + .L32(0x0301_0500) + .L32(tombstone) + .L32(0x0301_0600); let buf = section.get_contents().unwrap(); let debug_addr = &DebugAddr::from(EndianSlice::new(&buf, LittleEndian)); let debug_addr_base = DebugAddrBase(0); @@ -637,7 +670,7 @@ mod tests { .L8(0) .L32(0) .mark(&first) - // OffsetPair + // An OffsetPair using the unit base address. .L8(4).uleb(0x10200).uleb(0x10300) // A base address selection followed by an OffsetPair. .L8(5).L32(0x0200_0000) @@ -663,6 +696,25 @@ mod tests { .L8(2).uleb(1).uleb(2) // A StartxLength .L8(3).uleb(3).uleb(0x100) + + // Tombstone entries, all of which should be ignored. + // A BaseAddressx that is a tombstone. + .L8(1).uleb(4) + .L8(4).uleb(0x11100).uleb(0x11200) + // A BaseAddress that is a tombstone. + .L8(5).L32(tombstone) + .L8(4).uleb(0x11300).uleb(0x11400) + // A StartxEndx that is a tombstone. + .L8(2).uleb(4).uleb(5) + // A StartxLength that is a tombstone. + .L8(3).uleb(4).uleb(0x100) + // A StartEnd that is a tombstone. + .L8(6).L32(tombstone).L32(0x201_1500) + // A StartLength that is a tombstone. + .L8(7).L32(tombstone).uleb(0x100) + // A StartEnd (not ignored) + .L8(6).L32(0x201_1600).L32(0x201_1700) + // A range end. .L8(0) // Some extra data. @@ -784,6 +836,15 @@ mod tests { })) ); + // A StartEnd range following the tombstones + assert_eq!( + ranges.next(), + Ok(Some(Range { + begin: 0x0201_1600, + end: 0x0201_1700, + })) + ); + // A range end. assert_eq!(ranges.next(), Ok(None)); @@ -802,6 +863,7 @@ mod tests { #[test] fn test_rnglists_64() { + let tombstone = !0u64; let encoding = Encoding { format: Format::Dwarf64, version: 5, @@ -811,7 +873,9 @@ mod tests { .L64(0x0300_0000) .L64(0x0301_0300) .L64(0x0301_0400) - .L64(0x0301_0500); + .L64(0x0301_0500) + .L64(tombstone) + .L64(0x0301_0600); let buf = section.get_contents().unwrap(); let debug_addr = &DebugAddr::from(EndianSlice::new(&buf, LittleEndian)); let debug_addr_base = DebugAddrBase(0); @@ -830,7 +894,7 @@ mod tests { .L8(0) .L32(0) .mark(&first) - // OffsetPair + // An OffsetPair using the unit base address. .L8(4).uleb(0x10200).uleb(0x10300) // A base address selection followed by an OffsetPair. .L8(5).L64(0x0200_0000) @@ -856,6 +920,25 @@ mod tests { .L8(2).uleb(1).uleb(2) // A StartxLength .L8(3).uleb(3).uleb(0x100) + + // Tombstone entries, all of which should be ignored. + // A BaseAddressx that is a tombstone. + .L8(1).uleb(4) + .L8(4).uleb(0x11100).uleb(0x11200) + // A BaseAddress that is a tombstone. + .L8(5).L64(tombstone) + .L8(4).uleb(0x11300).uleb(0x11400) + // A StartxEndx that is a tombstone. + .L8(2).uleb(4).uleb(5) + // A StartxLength that is a tombstone. + .L8(3).uleb(4).uleb(0x100) + // A StartEnd that is a tombstone. + .L8(6).L64(tombstone).L64(0x201_1500) + // A StartLength that is a tombstone. + .L8(7).L64(tombstone).uleb(0x100) + // A StartEnd (not ignored) + .L8(6).L64(0x201_1600).L64(0x201_1700) + // A range end. .L8(0) // Some extra data. @@ -977,6 +1060,15 @@ mod tests { })) ); + // A StartEnd range following the tombstones + assert_eq!( + ranges.next(), + Ok(Some(Range { + begin: 0x0201_1600, + end: 0x0201_1700, + })) + ); + // A range end. assert_eq!(ranges.next(), Ok(None)); @@ -1027,6 +1119,7 @@ mod tests { #[test] fn test_ranges_32() { + let tombstone = !0u32 - 1; let start = Label::new(); let first = Label::new(); #[rustfmt::skip] @@ -1048,6 +1141,11 @@ mod tests { // A range that ends at -1. .L32(0xffff_ffff).L32(0x0000_0000) .L32(0).L32(0xffff_ffff) + // A normal range with tombstone. + .L32(tombstone).L32(tombstone) + // A base address selection with tombstone followed by a normal range. + .L32(0xffff_ffff).L32(tombstone) + .L32(0x10a00).L32(0x10b00) // A range end. .L32(0).L32(0) // Some extra data. @@ -1139,6 +1237,7 @@ mod tests { #[test] fn test_ranges_64() { + let tombstone = !0u64 - 1; let start = Label::new(); let first = Label::new(); #[rustfmt::skip] @@ -1160,6 +1259,11 @@ mod tests { // A range that ends at -1. .L64(0xffff_ffff_ffff_ffff).L64(0x0000_0000) .L64(0).L64(0xffff_ffff_ffff_ffff) + // A normal range with tombstone. + .L64(tombstone).L64(tombstone) + // A base address selection with tombstone followed by a normal range. + .L64(0xffff_ffff_ffff_ffff).L64(tombstone) + .L64(0x10a00).L64(0x10b00) // A range end. .L64(0).L64(0) // Some extra data. diff --git a/vendor/gimli/src/read/unit.rs b/vendor/gimli/src/read/unit.rs index 670e55efd..672435330 100644 --- a/vendor/gimli/src/read/unit.rs +++ b/vendor/gimli/src/read/unit.rs @@ -883,7 +883,6 @@ where } /// Return the input buffer after the last attribute. - #[allow(clippy::inline_always)] #[inline(always)] fn after_attrs(&self) -> Result<R> { if let Some(attrs_len) = self.attrs_len.get() { @@ -892,7 +891,7 @@ where Ok(input) } else { let mut attrs = self.attrs(); - while let Some(_) = attrs.next()? {} + while attrs.next()?.is_some() {} Ok(attrs.input) } } @@ -912,7 +911,6 @@ where } /// Parse an entry. Returns `Ok(None)` for null entries. - #[allow(clippy::inline_always)] #[inline(always)] fn parse( input: &mut R, @@ -1143,8 +1141,6 @@ impl<R: Reader> Attribute<R> { /// name. /// /// See "Table 7.5: Attribute encodings" and "Table 7.6: Attribute form encodings". - #[allow(clippy::cyclomatic_complexity)] - #[allow(clippy::match_same_arms)] pub fn value(&self) -> AttributeValue<R> { // Table 7.5 shows the possible attribute classes for each name. // Table 7.6 shows the possible attribute classes for each form. @@ -1980,7 +1976,7 @@ fn allow_section_offset(name: constants::DwAt, version: u16) -> bool { } } -pub(crate) fn parse_attribute<'unit, R: Reader>( +pub(crate) fn parse_attribute<R: Reader>( input: &mut R, encoding: Encoding, spec: AttributeSpecification, @@ -2205,7 +2201,7 @@ pub(crate) fn parse_attribute<'unit, R: Reader>( } } -pub(crate) fn skip_attributes<'unit, R: Reader>( +pub(crate) fn skip_attributes<R: Reader>( input: &mut R, encoding: Encoding, specs: &[AttributeSpecification], @@ -2294,7 +2290,6 @@ impl<'abbrev, 'entry, 'unit, R: Reader> AttrsIter<'abbrev, 'entry, 'unit, R> { /// Returns `None` when iteration is finished. If an error /// occurs while parsing the next attribute, then this error /// is returned, and all subsequent calls return `None`. - #[allow(clippy::inline_always)] #[inline(always)] pub fn next(&mut self) -> Result<Option<Attribute<R>>> { if self.attributes.is_empty() { @@ -2647,7 +2642,6 @@ impl<'abbrev, 'unit, R: Reader> EntriesCursor<'abbrev, 'unit, R> { /// println!("The first entry with no children is {:?}", /// first_entry_with_no_children.unwrap()); /// ``` - #[allow(clippy::type_complexity)] pub fn next_dfs( &mut self, ) -> Result<Option<(isize, &DebuggingInformationEntry<'abbrev, 'unit, R>)>> { @@ -4213,7 +4207,6 @@ mod tests { #[test] fn test_attribute_udata_sdata_value() { - #[allow(clippy::type_complexity)] let tests: &[( AttributeValue<EndianSlice<LittleEndian>>, Option<u64>, diff --git a/vendor/gimli/src/read/util.rs b/vendor/gimli/src/read/util.rs index 16eafdde4..747418bab 100644 --- a/vendor/gimli/src/read/util.rs +++ b/vendor/gimli/src/read/util.rs @@ -9,7 +9,8 @@ use core::ptr; use core::slice; mod sealed { - // SAFETY: Implementer must not modify the content in storage. + /// # Safety + /// Implementer must not modify the content in storage. pub unsafe trait Sealed { type Storage; @@ -161,7 +162,7 @@ impl<A: ArrayLike> ArrayVec<A> { } else { self.len -= 1; // SAFETY: this element is valid and we "forget" it by setting the length. - Some(unsafe { A::as_slice(&mut self.storage)[self.len].as_ptr().read() }) + Some(unsafe { A::as_slice(&self.storage)[self.len].as_ptr().read() }) } } diff --git a/vendor/gimli/src/write/line.rs b/vendor/gimli/src/write/line.rs index 310170d9a..c88b735bc 100644 --- a/vendor/gimli/src/write/line.rs +++ b/vendor/gimli/src/write/line.rs @@ -94,8 +94,6 @@ impl LineProgram { /// Panics if `comp_dir` is empty or contains a null byte. /// /// Panics if `comp_file` is empty or contains a null byte. - #[allow(clippy::too_many_arguments)] - #[allow(clippy::new_ret_no_self)] pub fn new( encoding: Encoding, line_encoding: LineEncoding, @@ -261,7 +259,7 @@ impl LineProgram { } else { let entry = self.files.entry(key); let index = entry.index(); - entry.or_insert(FileInfo::default()); + entry.or_default(); index }; FileId::new(index) @@ -1723,7 +1721,6 @@ mod tests { // Test that the address/line advance is correct. We don't test for optimality. #[test] - #[allow(clippy::useless_vec)] fn test_advance() { let encoding = Encoding { format: Format::Dwarf32, diff --git a/vendor/gimli/src/write/loc.rs b/vendor/gimli/src/write/loc.rs index ea0ecb1cf..6dfe45a6c 100644 --- a/vendor/gimli/src/write/loc.rs +++ b/vendor/gimli/src/write/loc.rs @@ -436,6 +436,7 @@ mod tests { }; use crate::LittleEndian; use std::collections::HashMap; + use std::sync::Arc; #[test] fn test_loc_list() { @@ -508,7 +509,7 @@ mod tests { DebugInfoOffset(0).into(), read::EndianSlice::default(), ), - abbreviations: read::Abbreviations::default(), + abbreviations: Arc::new(read::Abbreviations::default()), name: None, comp_dir: None, low_pc: 0, diff --git a/vendor/gimli/src/write/op.rs b/vendor/gimli/src/write/op.rs index c70eec2dd..287083b3e 100644 --- a/vendor/gimli/src/write/op.rs +++ b/vendor/gimli/src/write/op.rs @@ -279,12 +279,8 @@ impl Expression { } offsets.push(offset); for (operation, offset) in self.operations.iter().zip(offsets.iter().copied()) { - let refs = match refs { - Some(ref mut refs) => Some(&mut **refs), - None => None, - }; debug_assert_eq!(w.len(), offset); - operation.write(w, refs, encoding, unit_offsets, &offsets)?; + operation.write(w, refs.as_deref_mut(), encoding, unit_offsets, &offsets)?; } Ok(()) } @@ -630,7 +626,7 @@ impl Operation { } w.write_uleb128(entry_offset(base)?)?; w.write_udata(value.len() as u64, 1)?; - w.write(&value)?; + w.write(value)?; } Operation::FrameOffset(offset) => { w.write_u8(constants::DW_OP_fbreg.0)?; @@ -770,7 +766,7 @@ impl Operation { Operation::ImplicitValue(ref data) => { w.write_u8(constants::DW_OP_implicit_value.0)?; w.write_uleb128(data.len() as u64)?; - w.write(&data)?; + w.write(data)?; } Operation::ImplicitPointer { entry, byte_offset } => { if encoding.version >= 5 { @@ -872,7 +868,7 @@ pub(crate) mod convert { let mut offsets = Vec::new(); let mut offset = 0; let mut from_operations = from_expression.clone().operations(encoding); - while let Some(_) = from_operations.next()? { + while from_operations.next()?.is_some() { offsets.push(offset); offset = from_operations.offset_from(&from_expression); } @@ -1071,6 +1067,7 @@ mod tests { }; use crate::LittleEndian; use std::collections::HashMap; + use std::sync::Arc; #[test] fn test_operation() { @@ -1578,7 +1575,7 @@ mod tests { DebugInfoOffset(0).into(), read::EndianSlice::new(&[], LittleEndian), ), - abbreviations: read::Abbreviations::default(), + abbreviations: Arc::new(read::Abbreviations::default()), name: None, comp_dir: None, low_pc: 0, diff --git a/vendor/gimli/src/write/range.rs b/vendor/gimli/src/write/range.rs index b44ce1b7b..c707e1eab 100644 --- a/vendor/gimli/src/write/range.rs +++ b/vendor/gimli/src/write/range.rs @@ -315,6 +315,7 @@ mod tests { }; use crate::LittleEndian; use std::collections::HashMap; + use std::sync::Arc; #[test] fn test_range() { @@ -375,7 +376,7 @@ mod tests { DebugInfoOffset(0).into(), read::EndianSlice::default(), ), - abbreviations: read::Abbreviations::default(), + abbreviations: Arc::new(read::Abbreviations::default()), name: None, comp_dir: None, low_pc: 0, diff --git a/vendor/gimli/src/write/section.rs b/vendor/gimli/src/write/section.rs index e8f3378cd..db5eb9a28 100644 --- a/vendor/gimli/src/write/section.rs +++ b/vendor/gimli/src/write/section.rs @@ -111,7 +111,7 @@ impl<W: Writer + Clone> Sections<W> { debug_loclists: DebugLocLists(section.clone()), debug_str: DebugStr(section.clone()), debug_frame: DebugFrame(section.clone()), - eh_frame: EhFrame(section.clone()), + eh_frame: EhFrame(section), debug_info_refs: Vec::new(), debug_loc_refs: Vec::new(), debug_loclists_refs: Vec::new(), diff --git a/vendor/gimli/src/write/unit.rs b/vendor/gimli/src/write/unit.rs index bf85ff421..23027bc2c 100644 --- a/vendor/gimli/src/write/unit.rs +++ b/vendor/gimli/src/write/unit.rs @@ -365,7 +365,6 @@ impl Unit { &mut unit_refs, self, &mut offsets, - abbrevs, line_program, line_strings, strings, @@ -605,7 +604,6 @@ impl DebuggingInformationEntry { } /// Write the entry to the given sections. - #[allow(clippy::too_many_arguments)] fn write<W: Writer>( &self, w: &mut DebugInfo<W>, @@ -613,7 +611,6 @@ impl DebuggingInformationEntry { unit_refs: &mut Vec<(DebugInfoOffset, UnitEntryId)>, unit: &Unit, offsets: &mut UnitOffsets, - abbrevs: &mut AbbreviationTable, line_program: Option<DebugLineOffset>, line_strings: &DebugLineStrOffsets, strings: &DebugStrOffsets, @@ -654,7 +651,6 @@ impl DebuggingInformationEntry { unit_refs, unit, offsets, - abbrevs, line_program, line_strings, strings, @@ -1128,7 +1124,6 @@ impl AttributeValue { } /// Write the attribute value to the given sections. - #[allow(clippy::cyclomatic_complexity, clippy::too_many_arguments)] fn write<W: Writer>( &self, w: &mut DebugInfo<W>, @@ -1155,7 +1150,7 @@ impl AttributeValue { AttributeValue::Block(ref val) => { debug_assert_form!(constants::DW_FORM_block); w.write_uleb128(val.len() as u64)?; - w.write(&val)?; + w.write(val)?; } AttributeValue::Data1(val) => { debug_assert_form!(constants::DW_FORM_data1); @@ -1308,7 +1303,7 @@ impl AttributeValue { } AttributeValue::String(ref val) => { debug_assert_form!(constants::DW_FORM_string); - w.write(&val)?; + w.write(val)?; w.write_u8(0)?; } AttributeValue::Encoding(val) => { @@ -1558,7 +1553,6 @@ pub(crate) mod convert { /// Create a unit by reading the data in the input sections. /// /// Does not add entry attributes. - #[allow(clippy::too_many_arguments)] pub(crate) fn convert_entries<R: Reader<Offset = usize>>( from_header: read::UnitHeader<R>, unit_id: UnitId, @@ -1931,9 +1925,9 @@ mod tests { use crate::LittleEndian; use std::collections::HashMap; use std::mem; + use std::sync::Arc; #[test] - #[allow(clippy::cyclomatic_complexity)] fn test_unit_table() { let mut strings = StringTable::default(); @@ -2542,7 +2536,7 @@ mod tests { let unit = read::Unit { header: from_unit, - abbreviations: read::Abbreviations::default(), + abbreviations: Arc::new(read::Abbreviations::default()), name: None, comp_dir: None, low_pc: 0, @@ -2578,7 +2572,6 @@ mod tests { } #[test] - #[allow(clippy::cyclomatic_complexity)] fn test_unit_ref() { let mut units = UnitTable::default(); let unit_id1 = units.add(Unit::new( @@ -3015,7 +3008,7 @@ mod tests { let unit = read::Unit { header: from_unit, - abbreviations: read::Abbreviations::default(), + abbreviations: Arc::new(read::Abbreviations::default()), name: None, comp_dir: None, low_pc: 0, diff --git a/vendor/gimli/src/write/writer.rs b/vendor/gimli/src/write/writer.rs index 0785d1686..1ce3641fc 100644 --- a/vendor/gimli/src/write/writer.rs +++ b/vendor/gimli/src/write/writer.rs @@ -93,9 +93,7 @@ pub trait Writer { constants::DW_EH_PE_sdata2 => self.write_sdata(val as i64, 2), constants::DW_EH_PE_sdata4 => self.write_sdata(val as i64, 4), constants::DW_EH_PE_sdata8 => self.write_sdata(val as i64, 8), - _ => { - return Err(Error::UnsupportedPointerEncoding(format)); - } + _ => Err(Error::UnsupportedPointerEncoding(format)), } } @@ -334,7 +332,6 @@ mod tests { use std::{i64, u64}; #[test] - #[allow(clippy::cyclomatic_complexity)] fn test_writer() { let mut w = write::EndianVec::new(LittleEndian); w.write_address(Address::Constant(0x1122_3344), 4).unwrap(); |