@@ -11,6 +11,7 @@ use alloc::vec::Vec;
1111use core:: cmp;
1212
1313use fallible_iterator:: FallibleIterator ;
14+ use gimli:: ReaderOffset ;
1415
1516use crate :: {
1617 Context , DebugFile , Error , Function , LazyFunctions , LazyLines , LazyResult ,
@@ -203,7 +204,7 @@ impl<R: gimli::Reader> ResUnits<R> {
203204 let mut units = sections. units ( ) ;
204205 while let Some ( header) = units. next ( ) ? {
205206 let unit_id = res_units. len ( ) ;
206- let offset = match header. offset ( ) . as_debug_info_offset ( ) {
207+ let offset = match header. offset ( ) . to_debug_info_offset ( & header ) {
207208 Some ( offset) => offset,
208209 None => continue ,
209210 } ;
@@ -365,7 +366,7 @@ impl<R: gimli::Reader> ResUnits<R> {
365366 . binary_search_by_key ( & offset. 0 , |unit| unit. offset . 0 )
366367 {
367368 // There is never a DIE at the unit offset or before the first unit.
368- Ok ( _) | Err ( 0 ) => Err ( gimli:: Error :: NoEntryAtGivenOffset ) ,
369+ Ok ( _) | Err ( 0 ) => Err ( gimli:: Error :: NoEntryAtGivenOffset ( offset . 0 . into_u64 ( ) ) ) ,
369370 Err ( i) => Ok ( & self . units [ i - 1 ] . dw_unit ) ,
370371 }
371372 }
@@ -479,7 +480,7 @@ impl<R: gimli::Reader> SupUnits<R> {
479480 let mut sup_units = Vec :: new ( ) ;
480481 let mut units = sections. units ( ) ;
481482 while let Some ( header) = units. next ( ) ? {
482- let offset = match header. offset ( ) . as_debug_info_offset ( ) {
483+ let offset = match header. offset ( ) . to_debug_info_offset ( & header ) {
483484 Some ( offset) => offset,
484485 None => continue ,
485486 } ;
@@ -503,7 +504,7 @@ impl<R: gimli::Reader> SupUnits<R> {
503504 . binary_search_by_key ( & offset. 0 , |unit| unit. offset . 0 )
504505 {
505506 // There is never a DIE at the unit offset or before the first unit.
506- Ok ( _) | Err ( 0 ) => Err ( gimli:: Error :: NoEntryAtGivenOffset ) ,
507+ Ok ( _) | Err ( 0 ) => Err ( gimli:: Error :: NoEntryAtGivenOffset ( offset . 0 . into_u64 ( ) ) ) ,
507508 Err ( i) => Ok ( & self . units [ i - 1 ] . dw_unit ) ,
508509 }
509510 }
0 commit comments