@@ -476,8 +476,10 @@ pub struct ProcedureReferenceSymbol<'t> {
476
476
///
477
477
/// Note that this symbol might be located in a different module.
478
478
pub symbol_index : SymbolIndex ,
479
- /// Index of the module containing the actual symbol.
480
- pub module : u16 ,
479
+ /// Index of the module in [`DebugInformation::modules`] containing the actual symbol.
480
+ ///
481
+ /// [`DebugInformation::modules`]: struct.DebugInformation.html#method.modules
482
+ pub module : Option < usize > ,
481
483
/// Name of the procedure reference.
482
484
pub name : Option < RawString < ' t > > ,
483
485
}
@@ -492,7 +494,7 @@ impl<'t> TryFromCtx<'t, SymbolKind> for ProcedureReferenceSymbol<'t> {
492
494
global : matches ! ( kind, S_PROCREF | S_PROCREF_ST ) ,
493
495
sum_name : buf. parse ( ) ?,
494
496
symbol_index : buf. parse ( ) ?,
495
- module : buf. parse ( ) ?,
497
+ module : buf. parse :: < u16 > ( ) ?. checked_sub ( 1 ) . map ( usize :: from ) ,
496
498
name : parse_optional_name ( & mut buf, kind) ?,
497
499
} ;
498
500
@@ -511,8 +513,10 @@ pub struct DataReferenceSymbol<'t> {
511
513
///
512
514
/// Note that this symbol might be located in a different module.
513
515
pub symbol_index : SymbolIndex ,
514
- /// Index of the module containing the actual symbol.
515
- pub module : u16 ,
516
+ /// Index of the module in [`DebugInformation::modules`] containing the actual symbol.
517
+ ///
518
+ /// [`DebugInformation::modules`]: struct.DebugInformation.html#method.modules
519
+ pub module : Option < usize > ,
516
520
/// Name of the data reference.
517
521
pub name : Option < RawString < ' t > > ,
518
522
}
@@ -526,7 +530,7 @@ impl<'t> TryFromCtx<'t, SymbolKind> for DataReferenceSymbol<'t> {
526
530
let symbol = DataReferenceSymbol {
527
531
sum_name : buf. parse ( ) ?,
528
532
symbol_index : buf. parse ( ) ?,
529
- module : buf. parse ( ) ?,
533
+ module : buf. parse :: < u16 > ( ) ?. checked_sub ( 1 ) . map ( usize :: from ) ,
530
534
name : parse_optional_name ( & mut buf, kind) ?,
531
535
} ;
532
536
@@ -545,8 +549,10 @@ pub struct AnnotationReferenceSymbol<'t> {
545
549
///
546
550
/// Note that this symbol might be located in a different module.
547
551
pub symbol_index : SymbolIndex ,
548
- /// Index of the module containing the actual symbol.
549
- pub module : u16 ,
552
+ /// Index of the module in [`DebugInformation::modules`] containing the actual symbol.
553
+ ///
554
+ /// [`DebugInformation::modules`]: struct.DebugInformation.html#method.modules
555
+ pub module : Option < usize > ,
550
556
/// Name of the annotation reference.
551
557
pub name : RawString < ' t > ,
552
558
}
@@ -560,7 +566,7 @@ impl<'t> TryFromCtx<'t, SymbolKind> for AnnotationReferenceSymbol<'t> {
560
566
let symbol = AnnotationReferenceSymbol {
561
567
sum_name : buf. parse ( ) ?,
562
568
symbol_index : buf. parse ( ) ?,
563
- module : buf. parse ( ) ?,
569
+ module : buf. parse :: < u16 > ( ) ?. checked_sub ( 1 ) . map ( usize :: from ) ,
564
570
name : parse_symbol_name ( & mut buf, kind) ?,
565
571
} ;
566
572
@@ -1764,7 +1770,7 @@ mod tests {
1764
1770
global: true ,
1765
1771
sum_name: 0 ,
1766
1772
symbol_index: SymbolIndex ( 108 ) ,
1767
- module: 1 ,
1773
+ module: Some ( 0 ) ,
1768
1774
name: Some ( "Baz::f_public" . into( ) ) ,
1769
1775
} )
1770
1776
) ;
@@ -1878,7 +1884,7 @@ mod tests {
1878
1884
global: false ,
1879
1885
sum_name: 0 ,
1880
1886
symbol_index: SymbolIndex ( 1152 ) ,
1881
- module: 182 ,
1887
+ module: Some ( 181 ) ,
1882
1888
name: Some ( "capture_current_context" . into( ) ) ,
1883
1889
} )
1884
1890
) ;
0 commit comments