Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions core/debugadapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@ limitations under the License.

#include <binaryninjacore.h>
#include <binaryninjaapi.h>
#include <filesystem>
#include <lowlevelilinstruction.h>
#include <mediumlevelilinstruction.h>
#include <highlevelilinstruction.h>
#ifndef WIN32
#include "libgen.h"
#endif
#include "debugadapter.h"
#include "debuggercontroller.h"

Expand Down Expand Up @@ -80,7 +78,8 @@ std::string DebugModule::GetPathBaseName(const std::string& path)
_splitpath_s(path.c_str(), NULL, 0, NULL, 0, baseName, MAX_PATH, ext, MAX_PATH);
return std::string(baseName) + std::string(ext);
#else
return basename(strdup(path.c_str()));
std::filesystem::path fs_path(path);
return fs_path.stem();
#endif
}

Expand Down
10 changes: 6 additions & 4 deletions core/debuggercommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ limitations under the License.
*/

#pragma once
#include <cstdint>
#include <filesystem>
#include <string.h>
#include <optional>
#ifndef WIN32
#include "libgen.h"
#endif
#include <string>
#include <vector>

namespace BinaryNinjaDebugger {
struct ModuleNameAndOffset
Expand Down Expand Up @@ -63,7 +64,8 @@ namespace BinaryNinjaDebugger {
_splitpath_s(path.c_str(), NULL, 0, NULL, 0, baseName, MAX_PATH, ext, MAX_PATH);
return std::string(baseName) + std::string(ext);
#else
return basename(strdup(path.c_str()));
std::filesystem::path fs_path(path);
return fs_path.stem();
#endif
}

Expand Down