alloy-sandbox running on osx (ivm only).

This commit is contained in:
Ben Vanik 2014-08-21 22:46:12 -07:00
parent 93285acf7b
commit 7ae303dfa2
4 changed files with 20 additions and 7 deletions

View File

@ -22,6 +22,17 @@ and set the 'Command' to `$(SolutionDir)$(TargetPath)` and the
'Working Directory' to `$(SolutionDir)..\..`. You can specify flags and
the file to run in the 'Command Arguments' field (or use `--flagfile=flags.txt`).
### OSX
* Mac OSX 10.9+
* Xcode 5.1+
#### Debugging
Choose `Product > Scheme > Edit Scheme`. For xenia-run, alloy-sandbox, and the
other executables select the Run action on the left and set
`Options > Working Directory` to your root xenia/ git path.
## xenia-build
A simple build script is included to manage basic tasks such as building

View File

@ -10,6 +10,7 @@
#include <alloy/runtime/raw_module.h>
#include <poly/platform.h>
#include <poly/string.h>
namespace alloy {
namespace runtime {
@ -19,8 +20,9 @@ RawModule::RawModule(Runtime* runtime)
RawModule::~RawModule() {}
int RawModule::LoadFile(uint64_t base_address, const std::string& path) {
FILE* file = fopen(path.c_str(), "rb");
int RawModule::LoadFile(uint64_t base_address, const std::wstring& path) {
auto fixed_path = poly::to_string(poly::fix_path_separators(path));
FILE* file = fopen(fixed_path.c_str(), "rb");
fseek(file, 0, SEEK_END);
size_t file_length = ftell(file);
fseek(file, 0, SEEK_SET);
@ -37,11 +39,11 @@ int RawModule::LoadFile(uint64_t base_address, const std::string& path) {
fclose(file);
// Setup debug info.
auto last_slash = path.find_last_of(poly::path_separator);
auto last_slash = fixed_path.find_last_of(poly::path_separator);
if (last_slash != std::string::npos) {
name_ = path.substr(last_slash + 1);
name_ = fixed_path.substr(last_slash + 1);
} else {
name_ = path;
name_ = fixed_path;
}
// TODO(benvanik): debug info

View File

@ -22,7 +22,7 @@ class RawModule : public Module {
RawModule(Runtime* runtime);
~RawModule() override;
int LoadFile(uint64_t base_address, const std::string& path);
int LoadFile(uint64_t base_address, const std::wstring& path);
const std::string& name() const override { return name_; }

View File

@ -94,7 +94,7 @@ int main(std::vector<std::wstring>& args) {
runtime->Initialize(std::move(frontend), std::move(backend));
auto module = std::make_unique<alloy::runtime::RawModule>(runtime.get());
module->LoadFile(0x00001000, "test\\codegen\\instr_add.bin");
module->LoadFile(0x00001000, L"test\\codegen\\instr_add.bin");
runtime->AddModule(std::move(module));
{