File tree Expand file tree Collapse file tree 5 files changed +38
-1
lines changed
02-inlines.dSYM/Contents/Resources/DWARF Expand file tree Collapse file tree 5 files changed +38
-1
lines changed Original file line number Diff line number Diff line change @@ -606,8 +606,14 @@ class MachOObjectFile : public ObjectFile {
606606 ParseSymbols (sink->input_file ().data (), nullptr , sink);
607607 break ;
608608 }
609+ case DataSource::kInlines : {
610+ CheckNotObject (" inlines" , sink);
611+ dwarf::File dwarf;
612+ ReadDebugSectionsFromMachO (debug_file ().file_data (), &dwarf, sink);
613+ ReadDWARFInlines (dwarf, sink, true );
614+ break ;
615+ }
609616 case DataSource::kArchiveMembers :
610- case DataSource::kInlines :
611617 default :
612618 THROW (" Mach-O doesn't support this data source" );
613619 }
Original file line number Diff line number Diff line change 1+ # Test that -d inlines works for Mach-O binaries
2+ #
3+ # Source: tests/testdata/macho/test_inlines.c
4+ #
5+ # To regenerate test binary and dSYM (requires macOS):
6+ # mkdir -p /tmp/build && cd /tmp/build
7+ # cp $BLOATY_ROOT/tests/testdata/macho/test_inlines.c .
8+ # clang -g -O2 -c test_inlines.c -o test_inlines.o
9+ # clang -g test_inlines.o -o 02-inlines
10+ # # The dSYM bundle (02-inlines.dSYM) is created automatically by clang
11+ # cp 02-inlines $BLOATY_ROOT/tests/testdata/macho/
12+ # cp -r 02-inlines.dSYM $BLOATY_ROOT/tests/testdata/macho/
13+ #
14+ # RUN: %bloaty %S/../testdata/macho/02-inlines --debug-file=%S/../testdata/macho/02-inlines.dSYM/Contents/Resources/DWARF/02-inlines -d inlines --domain=vm | %FileCheck %s
15+
16+ # CHECK: VM SIZE
17+ # CHECK: test_inlines.c:
Original file line number Diff line number Diff line change 1+ // Test file for inline function support in bloaty
2+ // This source generates the 02-inlines binary and dSYM for testing -d inlines
3+
4+ static inline int add (int a , int b ) { return a + b ; }
5+
6+ static inline int multiply (int a , int b ) { return a * b ; }
7+
8+ int external_call (int x ) { return add (x , 5 ) + multiply (x , 2 ); }
9+
10+ int main (void ) {
11+ int x = 10 ;
12+ int y = external_call (x );
13+ return y ;
14+ }
You can’t perform that action at this time.
0 commit comments