@@ -1424,6 +1424,15 @@ read_symbol(const char *filename, struct map *map, struct symbol *sym,
1424
1424
}
1425
1425
#endif
1426
1426
1427
+ #if !defined(HAVE_LIBCAPSTONE_SUPPORT ) || !defined(HAVE_LIBLLVM_SUPPORT )
1428
+ static void symbol__disassembler_missing (const char * disassembler , const char * filename ,
1429
+ struct symbol * sym )
1430
+ {
1431
+ pr_debug ("The %s disassembler isn't linked in for %s in %s\n" ,
1432
+ disassembler , sym -> name , filename );
1433
+ }
1434
+ #endif
1435
+
1427
1436
#ifdef HAVE_LIBCAPSTONE_SUPPORT
1428
1437
static void print_capstone_detail (cs_insn * insn , char * buf , size_t len ,
1429
1438
struct annotate_args * args , u64 addr )
@@ -1715,7 +1724,21 @@ static int symbol__disassemble_capstone(char *filename, struct symbol *sym,
1715
1724
count = -1 ;
1716
1725
goto out ;
1717
1726
}
1718
- #endif
1727
+ #else // HAVE_LIBCAPSTONE_SUPPORT
1728
+ static int symbol__disassemble_capstone (char * filename , struct symbol * sym ,
1729
+ struct annotate_args * args __maybe_unused )
1730
+ {
1731
+ symbol__disassembler_missing ("capstone" , filename , sym );
1732
+ return -1 ;
1733
+ }
1734
+
1735
+ static int symbol__disassemble_capstone_powerpc (char * filename , struct symbol * sym ,
1736
+ struct annotate_args * args __maybe_unused )
1737
+ {
1738
+ symbol__disassembler_missing ("capstone powerpc" , filename , sym );
1739
+ return -1 ;
1740
+ }
1741
+ #endif // HAVE_LIBCAPSTONE_SUPPORT
1719
1742
1720
1743
static int symbol__disassemble_raw (char * filename , struct symbol * sym ,
1721
1744
struct annotate_args * args )
@@ -1983,7 +2006,14 @@ static int symbol__disassemble_llvm(char *filename, struct symbol *sym,
1983
2006
free (line_storage );
1984
2007
return ret ;
1985
2008
}
1986
- #endif
2009
+ #else // HAVE_LIBLLVM_SUPPORT
2010
+ static int symbol__disassemble_llvm (char * filename , struct symbol * sym ,
2011
+ struct annotate_args * args __maybe_unused )
2012
+ {
2013
+ symbol__disassembler_missing ("LLVM" , filename , sym );
2014
+ return -1 ;
2015
+ }
2016
+ #endif // HAVE_LIBLLVM_SUPPORT
1987
2017
1988
2018
/*
1989
2019
* Possibly create a new version of line with tabs expanded. Returns the
@@ -2242,24 +2272,21 @@ int symbol__disassemble(struct symbol *sym, struct annotate_args *args)
2242
2272
err = symbol__disassemble_raw (symfs_filename , sym , args );
2243
2273
if (err == 0 )
2244
2274
goto out_remove_tmp ;
2245
- #ifdef HAVE_LIBCAPSTONE_SUPPORT
2275
+
2246
2276
err = symbol__disassemble_capstone_powerpc (symfs_filename , sym , args );
2247
2277
if (err == 0 )
2248
2278
goto out_remove_tmp ;
2249
- #endif
2250
2279
}
2251
2280
}
2252
2281
2253
- #ifdef HAVE_LIBLLVM_SUPPORT
2254
2282
err = symbol__disassemble_llvm (symfs_filename , sym , args );
2255
2283
if (err == 0 )
2256
2284
goto out_remove_tmp ;
2257
- #endif
2258
- #ifdef HAVE_LIBCAPSTONE_SUPPORT
2285
+
2259
2286
err = symbol__disassemble_capstone (symfs_filename , sym , args );
2260
2287
if (err == 0 )
2261
2288
goto out_remove_tmp ;
2262
- #endif
2289
+
2263
2290
err = symbol__disassemble_objdump (symfs_filename , sym , args );
2264
2291
2265
2292
out_remove_tmp :
0 commit comments