From 561ee6dff99cb50f5c41bebae79e05d8cfef2926 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Mon, 13 Sep 2010 20:38:55 -0600 Subject: [PATCH] add debug logging to finder.cpp --- src/finder.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/finder.cpp b/src/finder.cpp index ae784eb48c..7ad3245c7a 100644 --- a/src/finder.cpp +++ b/src/finder.cpp @@ -16,6 +16,8 @@ using namespace vm; namespace { +const bool DebugFind = false; + const char* append(System* s, const char* a, const char* b, const char* c) @@ -141,6 +143,9 @@ class DirectoryElement: public Element { s->free(file); if (s->success(status)) { + if (DebugFind) { + fprintf(stderr, "found %s in %s\n", name, this->name); + } return region; } else { return 0; @@ -487,7 +492,11 @@ class JarElement: public Element { while (*name == '/') name++; - return (index ? index->find(name, region->start()) : 0); + System::Region* r = (index ? index->find(name, region->start()) : 0); + if (DebugFind and r) { + fprintf(stderr, "found %s in %s\n", name, this->name); + } + return r; } virtual bool exists(const char* name) {