@@ -33,6 +33,7 @@ use gimli::{
3333 DebuggingInformationEntry , Operation , Unit , UnitOffset , UnitSectionOffset ,
3434} ;
3535
36+ use binaryninja:: settings:: QueryOptions ;
3637use log:: warn;
3738
3839pub ( crate ) fn get_uid < R : ReaderType > (
@@ -414,9 +415,10 @@ pub(crate) fn download_debug_info(
414415 build_id : & str ,
415416 view : & BinaryView ,
416417) -> Result < Ref < BinaryView > , String > {
417- let settings = Settings :: new ( "" ) ;
418-
419- let debug_server_urls = settings. get_string_list ( "network.debuginfodServers" , Some ( view) , None ) ;
418+ let mut settings_query_opts = QueryOptions :: new_with_view ( view) ;
419+ let settings = Settings :: new ( ) ;
420+ let debug_server_urls =
421+ settings. get_string_list_with_opts ( "network.debuginfodServers" , & mut settings_query_opts) ;
420422
421423 for debug_server_url in debug_server_urls. iter ( ) {
422424 let artifact_url = format ! ( "{}/buildid/{}/debuginfo" , debug_server_url, build_id) ;
@@ -487,19 +489,21 @@ pub(crate) fn find_local_debug_file_for_build_id(
487489 build_id : & str ,
488490 view : & BinaryView ,
489491) -> Option < String > {
490- let settings = Settings :: new ( "" ) ;
491- let debug_dirs_enabled = settings. get_bool (
492+ let mut settings_query_opts = QueryOptions :: new_with_view ( view) ;
493+ let settings = Settings :: new ( ) ;
494+ let debug_dirs_enabled = settings. get_bool_with_opts (
492495 "analysis.debugInfo.enableDebugDirectories" ,
493- Some ( view) ,
494- None ,
496+ & mut settings_query_opts,
495497 ) ;
496498
497499 if !debug_dirs_enabled {
498500 return None ;
499501 }
500502
501- let debug_info_paths =
502- settings. get_string_list ( "analysis.debugInfo.debugDirectories" , Some ( view) , None ) ;
503+ let debug_info_paths = settings. get_string_list_with_opts (
504+ "analysis.debugInfo.debugDirectories" ,
505+ & mut settings_query_opts,
506+ ) ;
503507
504508 if debug_info_paths. is_empty ( ) {
505509 return None ;
@@ -530,6 +534,8 @@ pub(crate) fn load_debug_info_for_build_id(
530534 build_id : & str ,
531535 view : & BinaryView ,
532536) -> ( Option < Ref < BinaryView > > , bool ) {
537+ let mut settings_query_opts = QueryOptions :: new_with_view ( view) ;
538+ let settings = Settings :: new ( ) ;
533539 if let Some ( debug_file_path) = find_local_debug_file_for_build_id ( build_id, view) {
534540 return (
535541 binaryninja:: load_with_options (
@@ -539,16 +545,19 @@ pub(crate) fn load_debug_info_for_build_id(
539545 ) ,
540546 false ,
541547 ) ;
542- } else if Settings :: new ( "" ) . get_bool ( "network.enableDebuginfod" , Some ( view ) , None ) {
548+ } else if settings . get_bool_with_opts ( "network.enableDebuginfod" , & mut settings_query_opts ) {
543549 return ( download_debug_info ( build_id, view) . ok ( ) , true ) ;
544550 }
545551 ( None , false )
546552}
547553
548554pub ( crate ) fn find_sibling_debug_file ( view : & BinaryView ) -> Option < String > {
549- let settings = Settings :: new ( "" ) ;
550- let load_sibling_debug =
551- settings. get_bool ( "analysis.debugInfo.loadSiblingDebugFiles" , Some ( view) , None ) ;
555+ let mut settings_query_opts = QueryOptions :: new_with_view ( view) ;
556+ let settings = Settings :: new ( ) ;
557+ let load_sibling_debug = settings. get_bool_with_opts (
558+ "analysis.debugInfo.loadSiblingDebugFiles" ,
559+ & mut settings_query_opts,
560+ ) ;
552561
553562 if !load_sibling_debug {
554563 return None ;
0 commit comments