Skip to content

Commit c6aac5b

Browse files
committed
fixing some warning messages
1 parent 0ed3615 commit c6aac5b

2 files changed

Lines changed: 29 additions & 1 deletion

File tree

src/jet/live/DepfileDependenciesHandler.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@
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+
920
namespace 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

src/jet/live/_macos/MachoProgramInfoLoader.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@
3131
namespace
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

3642
namespace 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) {

0 commit comments

Comments
 (0)