Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugging with IDE #6

Closed
kronocharia opened this issue Feb 14, 2015 · 2 comments
Closed

Debugging with IDE #6

kronocharia opened this issue Feb 14, 2015 · 2 comments

Comments

@kronocharia
Copy link

Has anyone worked out how to run and debug the piped series of executables in an IDE? Perhaps it can be done by writing a wrapper main to test by calling all the function inside?

@kronocharia
Copy link
Author

Ok so I forgot to post this, but I have a solution, for any xcode users, and probably a similar thing can be done with VS.

Xcode project generated using: #5
You can tell xcode (or whatever) to wait until the the executable launches, by doing something like
screen shot 2015-02-14 at 02 02 21

If you then in the terminal execute ./make_world 10 0.1 | ./step_world 0.1 100,
Xcode will see the executable step_world executable running and then latches the debugger onto it, assuming you have a breakpoint.

However you need raise(SIGSTOP); #include <signal.h> right inside main otherwise the process terminates before xcode gets a chance to hook in,
screen shot 2015-02-14 at 02 07 21

Perhaps a single wrapper main target might be still a better solution, but in the meantime this seems to work, at least for running the examples, I dont know how well it will hold up when we actually start to changing things

@m8pple
Copy link
Contributor

m8pple commented Feb 16, 2015

Looks like you have a good solution; my approach would have been to generate
the input into a file, then redirect that into stdin for debugging. GDB supports it:
https://sourceware.org/gdb/current/onlinedocs/gdb/Input_002fOutput.html#Input_002fOutput
and VS as well:
https://msdn.microsoft.com/en-us/library/kcw4dzyf(v=VS.110).aspx

But I'll link it back, as people may find it useful. Thanks.

@m8pple m8pple closed this as completed Feb 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants