@@ -428,50 +428,42 @@ impl<'a> BootInformation<'a> {
428428
429429impl fmt:: Debug for BootInformation < ' _ > {
430430 fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
431- /// Limit how many Elf-Sections should be debug-formatted.
432- /// Can be thousands of sections for a Rust binary => this is useless output.
433- /// If the user really wants this, they should debug-format the field directly.
434- const ELF_SECTIONS_LIMIT : usize = 7 ;
435-
436431 let mut debug = f. debug_struct ( "Multiboot2BootInformation" ) ;
437432 debug
438433 . field ( "start_address" , & self . start_address ( ) )
439434 . field ( "end_address" , & self . end_address ( ) )
440435 . field ( "total_size" , & self . total_size ( ) )
441436 // now tags in alphabetical order
437+ . field ( "apm" , & self . apm_tag ( ) )
442438 . field ( "basic_memory_info" , & ( self . basic_memory_info_tag ( ) ) )
443439 . field ( "boot_loader_name" , & self . boot_loader_name_tag ( ) )
444- // .field("bootdev", &self.bootdev_tag())
440+ . field ( "bootdev" , & self . bootdev_tag ( ) )
445441 . field ( "command_line" , & self . command_line_tag ( ) )
446442 . field ( "efi_bs_not_exited" , & self . efi_bs_not_exited_tag ( ) )
443+ . field ( "efi_ih32" , & self . efi_ih32_tag ( ) )
444+ . field ( "efi_ih64" , & self . efi_ih64_tag ( ) )
447445 . field ( "efi_memory_map" , & self . efi_memory_map_tag ( ) )
448446 . field ( "efi_sdt32" , & self . efi_sdt32_tag ( ) )
449447 . field ( "efi_sdt64" , & self . efi_sdt64_tag ( ) )
450- . field ( "efi_ih32" , & self . efi_ih32_tag ( ) )
451- . field ( "efi_ih64" , & self . efi_ih64_tag ( ) ) ;
452-
453- // usually this is REALLY big (thousands of tags) => skip it here
454- {
455- let elf_sections_tag_entries_count =
456- self . elf_sections ( ) . map ( |x| x. count ( ) ) . unwrap_or ( 0 ) ;
457-
458- if elf_sections_tag_entries_count > ELF_SECTIONS_LIMIT {
459- debug. field ( "elf_sections (count)" , & elf_sections_tag_entries_count) ;
460- } else {
461- debug. field ( "elf_sections" , & self . elf_sections ( ) ) ;
462- }
463- }
464-
465- debug
448+ . field ( "elf_sections" , & self . elf_sections_tag ( ) )
466449 . field ( "framebuffer" , & self . framebuffer_tag ( ) )
467450 . field ( "load_base_addr" , & self . load_base_addr_tag ( ) )
468451 . field ( "memory_map" , & self . memory_map_tag ( ) )
469452 . field ( "modules" , & self . module_tags ( ) )
470- // .field("network", &self.network_tag())
453+ . field ( "network" , & self . network_tag ( ) )
471454 . field ( "rsdp_v1" , & self . rsdp_v1_tag ( ) )
472455 . field ( "rsdp_v2" , & self . rsdp_v2_tag ( ) )
473- . field ( "smbios_tag" , & self . smbios_tag ( ) )
474- . field ( "vbe_info_tag" , & self . vbe_info_tag ( ) )
456+ . field ( "smbios" , & self . smbios_tag ( ) )
457+ . field ( "vbe_info" , & self . vbe_info_tag ( ) )
458+ // computed fields
459+ . field ( "custom_tags_count" , & {
460+ self . tags ( )
461+ . filter ( |tag| {
462+ let id: TagType = tag. header ( ) . typ . into ( ) ;
463+ matches ! ( id, TagType :: Custom ( _) )
464+ } )
465+ . count ( )
466+ } )
475467 . finish ( )
476468 }
477469}
0 commit comments