@@ -324,19 +324,19 @@ static RzDebugReasonType rz_debug_native_wait(RzDebug *dbg, int pid) {
324
324
bool autoload_pdb = dbg -> corebind .cfggeti (core , "pdb.autoload" );
325
325
if (autoload_pdb ) {
326
326
PLIB_ITEM lib = r -> lib ;
327
- dbg -> corebind . cmdf ( core , "\"o \\\"%s\\\" 0x%p\"" , lib -> Path , lib -> BaseOfDll ) ;
328
- char * o_res = dbg -> corebind . cmdstrf ( core , "o~+%s" , lib -> Name ) ;
329
- int fd = atoi ( o_res );
330
- free ( o_res );
331
- if (fd ) {
332
- char * pdb_file = dbg -> corebind . cmdstr ( core , "i~dbg_file" );
333
- if (pdb_file && ( rz_str_trim ( pdb_file ), * pdb_file )) {
334
- if (!rz_file_exists (pdb_file + 9 )) {
327
+ RzBinOptions opts = { 0 } ;
328
+ opts . obj_opts . baseaddr = ( uintptr_t ) lib -> BaseOfDll ;
329
+ RzBinFile * cur = rz_bin_cur ( core -> bin );
330
+ RzBinFile * bf = rz_bin_open ( core -> bin , lib -> Path , & opts );
331
+ if (bf ) {
332
+ const RzBinInfo * info = rz_bin_object_get_info ( bf -> o );
333
+ if (RZ_STR_ISNOTEMPTY ( info -> debug_file_name )) {
334
+ if (!rz_file_exists (info -> debug_file_name )) {
335
335
dbg -> corebind .cmdf (core , "idpd" );
336
336
}
337
- dbg -> corebind .cmdf (core , "idp" );
337
+ dbg -> corebind .cmd (core , "idp" );
338
338
}
339
- dbg -> corebind . cmdf (core , "o-%d" , fd );
339
+ rz_bin_file_set_cur_binfile (core -> bin , cur );
340
340
}
341
341
}
342
342
} else {
0 commit comments