-
-
Notifications
You must be signed in to change notification settings - Fork 85
dep: Bump publicly exposed dependencies #976
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
714b69b
a90289b
bd75def
8eafb07
e87c685
21ed7a8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55,11 +55,11 @@ type RangeLists<'a> = gimli::read::RangeLists<Slice<'a>>; | |
| type Unit<'a> = gimli::read::Unit<Slice<'a>>; | ||
| type DwarfInner<'a> = gimli::read::Dwarf<Slice<'a>>; | ||
|
|
||
| type Die<'d, 'u> = gimli::read::DebuggingInformationEntry<'u, 'u, Slice<'d>, usize>; | ||
| type Die<'d> = gimli::read::DebuggingInformationEntry<Slice<'d>, usize>; | ||
| type Attribute<'a> = gimli::read::Attribute<Slice<'a>>; | ||
| type UnitOffset = gimli::read::UnitOffset<usize>; | ||
| type DebugInfoOffset = gimli::DebugInfoOffset<usize>; | ||
| type EntriesRaw<'d, 'u> = gimli::EntriesRaw<'u, 'u, Slice<'d>>; | ||
| type EntriesRaw<'d, 'u> = gimli::EntriesRaw<'u, Slice<'d>>; | ||
|
|
||
| type UnitHeader<'a> = gimli::read::UnitHeader<Slice<'a>>; | ||
| type IncompleteLineNumberProgram<'a> = gimli::read::IncompleteLineProgram<Slice<'a>>; | ||
|
|
@@ -389,7 +389,7 @@ impl<'d> UnitRef<'d, '_> { | |
| /// abbrev can only be temporarily accessed in the callback. | ||
| fn resolve_reference<T, F>(&self, attr: Attribute<'d>, f: F) -> Result<Option<T>, DwarfError> | ||
| where | ||
| F: FnOnce(Self, &Die<'d, '_>) -> Result<Option<T>, DwarfError>, | ||
| F: FnOnce(Self, &Die<'d>) -> Result<Option<T>, DwarfError>, | ||
| { | ||
| let (unit, offset) = match attr.value() { | ||
| AttributeValue::UnitRef(offset) => (*self, offset), | ||
|
|
@@ -416,11 +416,10 @@ impl<'d> UnitRef<'d, '_> { | |
| /// Returns the source language declared in the root DIE of this compilation unit. | ||
| fn language(&self) -> Result<Option<Language>, DwarfError> { | ||
| let mut entries = self.unit.entries(); | ||
| let Some((_, root_entry)) = entries.next_dfs()? else { | ||
| let Some(root_entry) = entries.next_dfs()? else { | ||
| return Ok(None); | ||
| }; | ||
| let Some(AttributeValue::Language(lang)) = | ||
| root_entry.attr_value(constants::DW_AT_language)? | ||
| let Some(AttributeValue::Language(lang)) = root_entry.attr_value(constants::DW_AT_language) | ||
| else { | ||
| return Ok(None); | ||
| }; | ||
|
|
@@ -436,14 +435,14 @@ impl<'d> UnitRef<'d, '_> { | |
| /// cycles or malformed DWARF. | ||
| fn resolve_entry_language( | ||
| &self, | ||
| entry: &Die<'d, '_>, | ||
| entry: &Die<'d>, | ||
| depth: u8, | ||
| ) -> Result<Option<Language>, DwarfError> { | ||
| if depth == 0 { | ||
| return Ok(None); | ||
| } | ||
| if let Ok(Some(attr)) = entry.attr(constants::DW_AT_abstract_origin) { | ||
| return self.resolve_reference(attr, |ref_unit, ref_entry| { | ||
| if let Some(attr) = entry.attr(constants::DW_AT_abstract_origin) { | ||
| return self.resolve_reference(*attr, |ref_unit, ref_entry| { | ||
| // Recurse first to follow deeper chains. | ||
| if let Some(lang) = ref_unit.resolve_entry_language(ref_entry, depth - 1)? { | ||
| return Ok(Some(lang)); | ||
|
|
@@ -462,16 +461,15 @@ impl<'d> UnitRef<'d, '_> { | |
| /// Resolves the function name of a debug entry. | ||
| fn resolve_function_name( | ||
| &self, | ||
| entry: &Die<'d, '_>, | ||
| entry: &Die<'d>, | ||
| language: Language, | ||
| bcsymbolmap: Option<&'d BcSymbolMap<'d>>, | ||
| prior_offset: Option<UnitOffset>, | ||
| ) -> Result<Option<Name<'d>>, DwarfError> { | ||
| let mut attrs = entry.attrs(); | ||
| let mut fallback_name = None; | ||
| let mut reference_target = None; | ||
|
|
||
| while let Some(attr) = attrs.next()? { | ||
| for attr in entry.attrs() { | ||
| match attr.name() { | ||
| // Prioritize these. If we get them, take them. | ||
| constants::DW_AT_linkage_name | constants::DW_AT_MIPS_linkage_name => { | ||
|
|
@@ -498,7 +496,7 @@ impl<'d> UnitRef<'d, '_> { | |
| } | ||
|
|
||
| if let Some(attr) = reference_target { | ||
| return self.resolve_reference(attr, |ref_unit, ref_entry| { | ||
| return self.resolve_reference(*attr, |ref_unit, ref_entry| { | ||
| // Self-references may have a layer of indirection. Avoid infinite recursion | ||
| // in this scenario. | ||
| if let Some(prior) = prior_offset { | ||
|
|
@@ -544,7 +542,7 @@ impl<'d, 'a> DwarfUnit<'d, 'a> { | |
| let inner = UnitRef { info, unit }; | ||
| let mut entries = unit.entries(); | ||
| let entry = match entries.next_dfs()? { | ||
| Some((_, entry)) => entry, | ||
| Some(entry) => entry, | ||
| None => return Err(gimli::read::Error::MissingUnitDie.into()), | ||
| }; | ||
|
|
||
|
|
@@ -554,12 +552,12 @@ impl<'d, 'a> DwarfUnit<'d, 'a> { | |
| // range information has not been written yet and all units look like this. | ||
| if info.kind != ObjectKind::Relocatable | ||
| && unit.low_pc == 0 | ||
| && entry.attr(constants::DW_AT_ranges)?.is_none() | ||
| && entry.attr(constants::DW_AT_ranges).is_none() | ||
| { | ||
| return Ok(None); | ||
| } | ||
|
|
||
| let language = match entry.attr_value(constants::DW_AT_language)? { | ||
| let language = match entry.attr_value(constants::DW_AT_language) { | ||
| Some(AttributeValue::Language(lang)) => language_from_dwarf(lang), | ||
| _ => Language::Unknown, | ||
| }; | ||
|
|
@@ -573,7 +571,7 @@ impl<'d, 'a> DwarfUnit<'d, 'a> { | |
| // reference into the debug_str section. We use `string_value` | ||
| // to resolve it correctly in either case. | ||
| let producer = entry | ||
| .attr_value(constants::DW_AT_producer)? | ||
| .attr_value(constants::DW_AT_producer) | ||
| .and_then(|av| av.string_value(&info.inner.debug_str)); | ||
|
|
||
| // Trust the symbol table more to contain accurate mangled names. However, since Dart's name | ||
|
|
@@ -626,23 +624,23 @@ impl<'d, 'a> DwarfUnit<'d, 'a> { | |
| AttributeValue::DebugAddrIndex(index) => { | ||
| low_pc = Some(self.inner.info.address(self.inner.unit, index)?) | ||
| } | ||
| _ => return Err(GimliError::UnsupportedAttributeForm.into()), | ||
| _ => return Err(GimliError::UnsupportedAttributeForm(attr.form()).into()), | ||
| }, | ||
| constants::DW_AT_high_pc => match attr.value() { | ||
| AttributeValue::Addr(addr) => high_pc = Some(addr), | ||
| AttributeValue::DebugAddrIndex(index) => { | ||
| high_pc = Some(self.inner.info.address(self.inner.unit, index)?) | ||
| } | ||
| AttributeValue::Udata(size) => high_pc_rel = Some(size), | ||
| _ => return Err(GimliError::UnsupportedAttributeForm.into()), | ||
| _ => return Err(GimliError::UnsupportedAttributeForm(attr.form()).into()), | ||
| }, | ||
| constants::DW_AT_call_line => match attr.value() { | ||
| AttributeValue::Udata(line) => call_line = Some(line), | ||
| _ => return Err(GimliError::UnsupportedAttributeForm.into()), | ||
| _ => return Err(GimliError::UnsupportedAttributeForm(attr.form()).into()), | ||
| }, | ||
| constants::DW_AT_call_file => match attr.value() { | ||
| AttributeValue::FileIndex(file) => call_file = Some(file), | ||
| _ => return Err(GimliError::UnsupportedAttributeForm.into()), | ||
| _ => return Err(GimliError::UnsupportedAttributeForm(attr.form()).into()), | ||
| }, | ||
| constants::DW_AT_ranges | ||
| | constants::DW_AT_rnglists_base | ||
|
|
@@ -656,7 +654,7 @@ impl<'d, 'a> DwarfUnit<'d, 'a> { | |
| // are triggered by an inverted range (going high to low). | ||
| // See a few more examples of broken ranges here: | ||
| // https://github.com/emscripten-core/emscripten/issues/15552 | ||
| Err(gimli::Error::InvalidAddressRange) => None, | ||
| Err(gimli::Error::InvalidCfiSetLoc(_)) => None, | ||
|
sentry[bot] marked this conversation as resolved.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wrong error variant caught for broken range listsHigh Severity The error variant was changed from Reviewed by Cursor Bugbot for commit a90289b. Configure here.
Comment on lines
-659
to
+657
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In 0.32, the However, in 0.33, this variant is removed and |
||
| Err(err) => { | ||
| return Err(err.into()); | ||
| } | ||
|
|
@@ -778,11 +776,7 @@ impl<'d, 'a> DwarfUnit<'d, 'a> { | |
| /// does not reflect the original source language (e.g., a C++ CU containing functions | ||
| /// originally written in C). When such a CU's subprogram carries a cross-unit | ||
| /// `DW_AT_abstract_origin`, the referenced CU's language is more authoritative. | ||
| fn resolve_function_language( | ||
| &self, | ||
| entry: &Die<'d, '_>, | ||
| fallback_language: Language, | ||
| ) -> Language { | ||
| fn resolve_function_language(&self, entry: &Die<'d>, fallback_language: Language) -> Language { | ||
| self.inner | ||
| .resolve_entry_language(entry, UnitRef::MAX_ABSTRACT_ORIGIN_DEPTH) | ||
| .ok() | ||
|
|
@@ -1175,6 +1169,7 @@ struct DwarfSections<'data> { | |
| debug_info: DwarfSectionData<'data, gimli::read::DebugInfo<Slice<'data>>>, | ||
| debug_line: DwarfSectionData<'data, gimli::read::DebugLine<Slice<'data>>>, | ||
| debug_line_str: DwarfSectionData<'data, gimli::read::DebugLineStr<Slice<'data>>>, | ||
| debug_names: DwarfSectionData<'data, gimli::read::DebugNames<Slice<'data>>>, | ||
| debug_str: DwarfSectionData<'data, gimli::read::DebugStr<Slice<'data>>>, | ||
| debug_str_offsets: DwarfSectionData<'data, gimli::read::DebugStrOffsets<Slice<'data>>>, | ||
| debug_ranges: DwarfSectionData<'data, gimli::read::DebugRanges<Slice<'data>>>, | ||
|
|
@@ -1196,6 +1191,7 @@ impl<'data> DwarfSections<'data> { | |
| debug_info: DwarfSectionData::load(dwarf), | ||
| debug_line: DwarfSectionData::load(dwarf), | ||
| debug_line_str: DwarfSectionData::load(dwarf), | ||
| debug_names: DwarfSectionData::load(dwarf), | ||
| debug_str: DwarfSectionData::load(dwarf), | ||
| debug_str_offsets: DwarfSectionData::load(dwarf), | ||
| debug_ranges: DwarfSectionData::load(dwarf), | ||
|
|
@@ -1239,6 +1235,7 @@ impl<'d> DwarfInfo<'d> { | |
| debug_info: sections.debug_info.to_gimli(), | ||
| debug_line: sections.debug_line.to_gimli(), | ||
| debug_line_str: sections.debug_line_str.to_gimli(), | ||
| debug_names: sections.debug_names.to_gimli(), | ||
| debug_str: sections.debug_str.to_gimli(), | ||
| debug_str_offsets: sections.debug_str_offsets.to_gimli(), | ||
| debug_types: Default::default(), | ||
|
|
@@ -1255,7 +1252,7 @@ impl<'d> DwarfInfo<'d> { | |
| inner.populate_abbreviations_cache(AbbreviationsCacheStrategy::Duplicates); | ||
|
|
||
| // Prepare random access to unit headers. | ||
| let headers = inner.units().collect::<Vec<_>>()?; | ||
| let headers = FallibleIterator::collect::<Vec<_>>(inner.units())?; | ||
| let units = headers.iter().map(|_| OnceCell::new()).collect(); | ||
|
|
||
| Ok(DwarfInfo { | ||
|
|
@@ -1297,7 +1294,7 @@ impl<'d> DwarfInfo<'d> { | |
| &self, | ||
| offset: DebugInfoOffset, | ||
| ) -> Result<(UnitRef<'d, '_>, UnitOffset), DwarfError> { | ||
| let section_offset = UnitSectionOffset::DebugInfoOffset(offset); | ||
| let section_offset = UnitSectionOffset(offset.0); | ||
| let search_result = self | ||
| .headers | ||
| .binary_search_by_key(§ion_offset, UnitHeader::offset); | ||
|
|
||


Uh oh!
There was an error while loading. Please reload this page.