Skip to content

Commit

Permalink
tinha um bug no Reader pro windows... arrumei eu acho
Browse files Browse the repository at this point in the history
  • Loading branch information
yuriserka committed Nov 24, 2019
1 parent c649339 commit 0d6a70d
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 13 deletions.
6 changes: 1 addition & 5 deletions src/instructions/instruction_set/invokes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,7 @@ static std::string getStringForType(Utils::Frame *frame,
} else {
const void *address = static_cast<const void *>(objectref);
auto classname = refname.substr(1, refname.find_first_of(';') - 1);
char delimiter = '/';
#if defined(_WIN32) || defined(WIN32)
delimiter = '\\';
#endif
std::replace(classname.begin(), classname.end(), delimiter, '.');
std::replace(classname.begin(), classname.end(), '/', '.');
ss << classname << "@" << address;
}
break;
Expand Down
4 changes: 0 additions & 4 deletions src/reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ Reader::Reader(ClassFile *cf, const std::string &fpath) {
p = Utils::Flags::options.kPATH + []() -> std::string {
auto has_end_slash = Utils::Flags::options.kPATH.find_last_of("/\\");
if (has_end_slash != Utils::Flags::options.kPATH.size() - 1) {
#if defined(_WIN32) || defined(WIN32)
return "\\";
#else
return "/";
#endif
}
return "";
}() + fpath;
Expand Down
5 changes: 1 addition & 4 deletions src/utils/memory_areas/method_area.cc
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,8 @@ const ClassFile *MethodArea::loadClass(const std::string &classname) {
std::stringstream ss;
const ClassFile *new_class = new ClassFile();
char delimiter = '/';
#if defined(_WIN32) || defined(WIN32)
delimiter = '\\';
#endif
auto splitted_path = Utils::String::split(classname, delimiter);
if (splitted_path.empty()) {
if (splitted_path.size() == 1) {
ss << Utils::Flags::options.kPATH << delimiter << classname << ".class";
} else {
ss << "." << delimiter << "classes" << delimiter << classname << ".class";
Expand Down

0 comments on commit 0d6a70d

Please sign in to comment.