Created
March 29, 2018 00:11
-
-
Save croepha/7ada96a51782ffc04dab9a906b708e8a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int main() { | |
SBDebugger::Initialize(); | |
SBDebugger debugger(SBDebugger::Create()); | |
assert(debugger.IsValid()); | |
debugger.SetAsync(false); | |
SBStream out_stream; | |
out_stream.RedirectToFileHandle(stdout, false); | |
debugger.GetDescription(out_stream); | |
out_stream.Printf("\n"); | |
SBTarget target = debugger.CreateTarget("./build/stb_sb_test.exec"); | |
assert(target.IsValid()); | |
auto bp = target.BreakpointCreateByRegex("push_string"); | |
cro_log(bp.GetNumLocations()); | |
bp.GetDescription(out_stream); | |
out_stream.Printf("\n"); | |
auto process = target.LaunchSimple(0,0,0); | |
assert(process.IsValid()); | |
process.GetDescription(out_stream); | |
out_stream.Printf("\n"); | |
auto state = process.GetState(); | |
cro_log(SBDebugger::StateAsCString(state)); // "launching", expecting it to block and stop at the breakpoint... | |
process.GetDescription(out_stream); | |
out_stream.Printf("\n"); | |
SBDebugger::Terminate(); | |
cro_log("fin"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment