File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66#include < teenypath.h>
77#include " jet/live/LiveContext.hpp"
88
9+ namespace
10+ {
11+ bool endsWith (const std::string& value, const std::string& ending)
12+ {
13+ if (ending.size () > value.size ()) {
14+ return false ;
15+ }
16+ return std::equal (ending.rbegin (), ending.rend (), value.rbegin ());
17+ }
18+ }
19+
920namespace jet
1021{
1122 std::unordered_set<std::string> DepfileDependenciesHandler::getDependencies (const LiveContext* context,
@@ -31,7 +42,10 @@ namespace jet
3142 }
3243
3344 if (cu.depFilePath .empty ()) {
34- context->events ->addLog (LogSeverity::kWarning , " Empty depfile path for cu: " + cu.sourceFilePath );
45+ // asm files don't have deps and it's okay
46+ if (!::endsWith (cu.sourceFilePath , " .asm" )) {
47+ context->events ->addLog (LogSeverity::kWarning , " Empty depfile path for cu: " + cu.sourceFilePath );
48+ }
3549 return deps;
3650 }
3751
Original file line number Diff line number Diff line change 3131namespace
3232{
3333 uintptr_t thisExecutableLoadAddress = 0 ;
34+
35+ bool isSystemImage (const std::string& imagePathStr)
36+ {
37+ return imagePathStr.find (" /usr/lib" ) != std::string::npos ||
38+ imagePathStr.find (" /System/Library" ) != std::string::npos;
39+ }
3440}
3541
3642namespace jet
@@ -41,6 +47,10 @@ namespace jet
4147
4248 for (uint32_t i = 0 ; i < _dyld_image_count (); i++) {
4349 auto imagePath = TeenyPath::path{_dyld_get_image_name (i)};
50+ // Skipping system images as they're not available anyway
51+ if (::isSystemImage (imagePath.string ())) {
52+ continue ;
53+ }
4454 if (imagePath.exists ()) {
4555 imagePath = imagePath.resolve_absolute ();
4656 if (imagePath.string () == context->thisExecutablePath ) {
@@ -66,6 +76,10 @@ namespace jet
6676 std::string realFilepath = filepath.empty () ? context->thisExecutablePath : filepath;
6777 for (uint32_t i = 0 ; i < _dyld_image_count (); i++) {
6878 auto imagePath = TeenyPath::path{_dyld_get_image_name (i)};
79+ // Skipping system images as they're not available anyway
80+ if (::isSystemImage (imagePath.string ())) {
81+ continue ;
82+ }
6983 if (imagePath.exists ()) {
7084 imagePath = imagePath.resolve_absolute ();
7185 if (imagePath.string () == realFilepath) {
You can’t perform that action at this time.
0 commit comments