diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/monitor.cc | 5 | ||||
| -rw-r--r-- | src/object_utils.h | 14 |
2 files changed, 8 insertions, 11 deletions
diff --git a/src/monitor.cc b/src/monitor.cc index caaa11618a..b641160684 100644 --- a/src/monitor.cc +++ b/src/monitor.cc @@ -800,12 +800,15 @@ void Monitor::TranslateLocation(const Method* method, uint32_t pc, const char*& source_file, uint32_t& line_number) const { // If method is null, location is unknown if (method == NULL) { - source_file = "unknown"; + source_file = ""; line_number = 0; return; } MethodHelper mh(method); source_file = mh.GetDeclaringClassSourceFile(); + if (source_file == NULL) { + source_file = ""; + } line_number = mh.GetLineNumFromNativePC(pc); } diff --git a/src/object_utils.h b/src/object_utils.h index 0412858084..3af700762c 100644 --- a/src/object_utils.h +++ b/src/object_utils.h @@ -169,11 +169,8 @@ class ClassHelper { std::string descriptor(GetDescriptor()); const DexFile& dex_file = GetDexFile(); const DexFile::ClassDef* dex_class_def = dex_file.FindClassDef(descriptor); - if (dex_class_def == NULL) { - return NULL; - } else { - return dex_file.GetSourceFile(*dex_class_def); - } + CHECK(dex_class_def != NULL); + return dex_file.GetSourceFile(*dex_class_def); } std::string GetLocation() { @@ -477,11 +474,8 @@ class MethodHelper { const char* descriptor = GetDeclaringClassDescriptor(); const DexFile& dex_file = GetDexFile(); const DexFile::ClassDef* dex_class_def = dex_file.FindClassDef(descriptor); - if (dex_class_def == NULL) { - return NULL; - } else { - return dex_file.GetSourceFile(*dex_class_def); - } + CHECK(dex_class_def != NULL); + return dex_file.GetSourceFile(*dex_class_def); } bool IsStatic() { return method_->IsStatic(); |