@@ -426,50 +426,42 @@ impl<'a> BootInformation<'a> {
426426
427427impl fmt:: Debug for BootInformation < ' _ > {
428428 fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
429- /// Limit how many Elf-Sections should be debug-formatted.
430- /// Can be thousands of sections for a Rust binary => this is useless output.
431- /// If the user really wants this, they should debug-format the field directly.
432- const ELF_SECTIONS_LIMIT : usize = 7 ;
433-
434429 let mut debug = f. debug_struct ( "Multiboot2BootInformation" ) ;
435430 debug
436431 . field ( "start_address" , & self . start_address ( ) )
437432 . field ( "end_address" , & self . end_address ( ) )
438433 . field ( "total_size" , & self . total_size ( ) )
439434 // now tags in alphabetical order
435+ . field ( "apm" , & self . apm_tag ( ) )
440436 . field ( "basic_memory_info" , & ( self . basic_memory_info_tag ( ) ) )
441437 . field ( "boot_loader_name" , & self . boot_loader_name_tag ( ) )
442- // .field("bootdev", &self.bootdev_tag())
438+ . field ( "bootdev" , & self . bootdev_tag ( ) )
443439 . field ( "command_line" , & self . command_line_tag ( ) )
444440 . field ( "efi_bs_not_exited" , & self . efi_bs_not_exited_tag ( ) )
441+ . field ( "efi_ih32" , & self . efi_ih32_tag ( ) )
442+ . field ( "efi_ih64" , & self . efi_ih64_tag ( ) )
445443 . field ( "efi_memory_map" , & self . efi_memory_map_tag ( ) )
446444 . field ( "efi_sdt32" , & self . efi_sdt32_tag ( ) )
447445 . field ( "efi_sdt64" , & self . efi_sdt64_tag ( ) )
448- . field ( "efi_ih32" , & self . efi_ih32_tag ( ) )
449- . field ( "efi_ih64" , & self . efi_ih64_tag ( ) ) ;
450-
451- // usually this is REALLY big (thousands of tags) => skip it here
452- {
453- let elf_sections_tag_entries_count =
454- self . elf_sections ( ) . map ( |x| x. count ( ) ) . unwrap_or ( 0 ) ;
455-
456- if elf_sections_tag_entries_count > ELF_SECTIONS_LIMIT {
457- debug. field ( "elf_sections (count)" , & elf_sections_tag_entries_count) ;
458- } else {
459- debug. field ( "elf_sections" , & self . elf_sections ( ) ) ;
460- }
461- }
462-
463- debug
446+ . field ( "elf_sections" , & self . elf_sections_tag ( ) )
464447 . field ( "framebuffer" , & self . framebuffer_tag ( ) )
465448 . field ( "load_base_addr" , & self . load_base_addr_tag ( ) )
466449 . field ( "memory_map" , & self . memory_map_tag ( ) )
467450 . field ( "modules" , & self . module_tags ( ) )
468- // .field("network", &self.network_tag())
451+ . field ( "network" , & self . network_tag ( ) )
469452 . field ( "rsdp_v1" , & self . rsdp_v1_tag ( ) )
470453 . field ( "rsdp_v2" , & self . rsdp_v2_tag ( ) )
471- . field ( "smbios_tag" , & self . smbios_tag ( ) )
472- . field ( "vbe_info_tag" , & self . vbe_info_tag ( ) )
454+ . field ( "smbios" , & self . smbios_tag ( ) )
455+ . field ( "vbe_info" , & self . vbe_info_tag ( ) )
456+ // computed fields
457+ . field ( "custom_tags_count" , & {
458+ self . tags ( )
459+ . filter ( |tag| {
460+ let id: TagType = tag. header ( ) . typ . into ( ) ;
461+ matches ! ( id, TagType :: Custom ( _) )
462+ } )
463+ . count ( )
464+ } )
473465 . finish ( )
474466 }
475467}
0 commit comments