Add .debug_sup support - #1674
Irene-dev-888 wants to merge 1 commit into
Conversation
Signed-off-by: Irene Siboni <irene.siboni.8@gmail.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1674 +/- ##
==========================================
- Coverage 95.24% 95.16% -0.08%
==========================================
Files 58 59 +1
Lines 11341 11485 +144
==========================================
+ Hits 10802 10930 +128
- Misses 539 555 +16 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Sorry for the delay. I hope to get to taking a look by the end of the week. |
| @@ -0,0 +1,300 @@ | |||
| //! Support for reading of GNU .`debug_sup` data as prescribed in DWARF v5 | |||
There was a problem hiding this comment.
Please mention what this section is actually used for.
| /// Read the debug sup section. | ||
| pub(crate) fn read_debug_sup( | ||
| parser: &ElfParser, | ||
| ) -> Result<Option<(u16, bool, &Path, BuildId<'_>)>> { |
There was a problem hiding this comment.
Introduce a proper struct type?
| let path = data | ||
| .read_cstr() | ||
| .ok_or_invalid_data(|| "failed to read .debug_sup filename")?; |
There was a problem hiding this comment.
File summary seems to indicate that there is only a path if is_supplementary is 1. Yet we read it unconditionally...?
| assert!(error.to_string().contains("build ID")); | ||
| } | ||
|
|
||
| /// Check that we can successfully read an ELF file's debug altlink. |
| /// # Notes | ||
| /// This function ignores any errors encountered. | ||
| fn find_altdebug_file( | ||
| fn find_supplementary_file( |
There was a problem hiding this comment.
Varius error paths still reference "altlink".
| //! compilation unit | ||
| //! - `is_supplementary`: u8 which is set to 1 if the file in which the | ||
| //! section is stored is a supplementary file, 0 o.w. | ||
| //! - `sup_filename`: null-terminated supplementary file filename (is |
There was a problem hiding this comment.
Seems to be a "path", not a file name? Also see https://dwarfstd.org/issues/260116.1.html
| use test_tag::tag; | ||
|
|
||
|
|
||
| /// Check that we can correctly read a build id from debug altlink section |
| /// If the source file contains a valid debug sup, this parser | ||
| /// represents it. | ||
| _supee_parser: Option<Rc<ElfParser>>, |
There was a problem hiding this comment.
So wouldn't/shouldn't this be mutually exclusive with the altlink stuff, given that it supposedly standardizes and superseds it? Then we should probably merge the fields. It's even how the logic below is written up...
| /// Check that we correctly incorporate debug sup files in the | ||
| /// inspection process. | ||
| #[test] | ||
| fn inspect_debug_sup_honoring() { |
There was a problem hiding this comment.
Parametrize the altlink test instead of duplicating everything please
|
|
||
| /// Check that we resolve debug sup correctly. | ||
| #[test] | ||
| fn debug_sup_resolution() { |
There was a problem hiding this comment.
Parametrize the altlink test instead of duplicating everything
Add support for .debug_sup sections, in case
dwzis invoked with the--dwarf-5option.