Skip to content

Commit ab8afc4

Browse files
committed
Minor Mac changes.
1 parent e1ac5ed commit ab8afc4

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

libcoz/inspect.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ bool memory_map::process_file(const string& name, uintptr_t load_address,
726726
set<string> included_files;
727727
dwarf::line_table table;
728728
#ifdef __APPLE__
729-
// On macOS, DWARF 5 format errors are common - catch and skip problematic CUs
729+
// On macOS, catch DWARF parsing errors and skip problematic CUs
730730
try {
731731
table = unit.get_line_table();
732732
} catch (const dwarf::format_error& e) {

libcoz/macho_support.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@ bool get_section_type(const char* sectname, dwarf::section_type* out) {
324324

325325
const char* suffix = sectname + 8;
326326
if(std::strcmp(suffix, "abbrev") == 0) *out = dwarf::section_type::abbrev;
327+
else if(std::strcmp(suffix, "addr") == 0) *out = dwarf::section_type::addr;
327328
else if(std::strcmp(suffix, "aranges") == 0) *out = dwarf::section_type::aranges;
328329
else if(std::strcmp(suffix, "frame") == 0) *out = dwarf::section_type::frame;
329330
else if(std::strcmp(suffix, "info") == 0) *out = dwarf::section_type::info;

libcoz/util.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@
2929
*/
3030
static size_t get_time() {
3131
#if defined(__APPLE__)
32+
// Note: mach_absolute_time() returns ticks, not nanoseconds.
33+
// However, converting to nanoseconds causes experiments to run too long
34+
// for short benchmarks. The profiler constants implicitly assume
35+
// the current behavior on macOS.
3236
return mach_absolute_time();
3337
#else
3438
struct timespec ts;

0 commit comments

Comments
 (0)