Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Project Builder's "Standard I/O"?



Hello!

How does one get a "Standard Tool" program to take Standard I/O while
run or debugged in Project Builder? Is it at all possible?

Say I have a legacy C program which just reads from Standard Input until
it finds an EOF, and then writes to Standard Output. Say it has sources

bar.c
baz.c
foo.c
foo.h
Makefile

where the Makefile is just

foo: foo.c bar.c baz.c
cc -g -o foo foo.c bar.c baz.c

I believe this is managed in PB by
- creating a New Project of type Empty Project;
- adding the above files to it;
- adding a New Target of type Legacy Makefile; and finally
- adding foo to it as New Custom Executable, once it's been built for
the first time.

Now, if I select this executable in the targets pane and assign it a
Launch Argument of "< ../testfile.txt", then it runs fine with this
argument. I can debug it in all the GUI goodness of PB, set gdb break
points graphically, etc. Life is good.

But if I remove the launch argument and try to run/debug it as an
interactive program (as I would on the command line), well, it launches
fine, but any input I try to give it in the "Standard I/O" tab of the
debug pane is just echoed back, unprocessed. Also this Standard I/O
seems to ignore EOF. So, I guess I have 2 questions:


1) Is this the correct way to set up a "Legacy Makefile" project in PB?

2) If yes, is there a PB way to send "Standard Input" to the program?



Note:

I know this is overkill in the case of a baby program like the above,
but I have in mind larger ones with elaborate "legacy" makefiles, which
would be great to be able to work with in PB. I looked this up in the
list archive but didn't really find the answer, though a few messages
address the same question:

http://lists.apple.com/archives/projectbuilder-users/2001/Feb/10/simpleconsoleoutputnotdi.txt
http://lists.apple.com/archives/projectbuilder-users/2001/Feb/13/simpleconsoleoutputnotdi.txt
http://lists.apple.com/archives/projectbuilder-users/2001/Apr/30/standardinputinprojectbu.txt
http://lists.apple.com/archives/projectbuilder-users/2002/Nov/12/newbie.001.txt

Thanks in advance to anyone who can help!
_______________________________________________
projectbuilder-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/projectbuilder-users
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.