Tricky solution:
Have to create a temp file to serve as the output of the lexer command and have linux block on this command. Then create a separate process to read from the temp file from inside the debugger.
mkfifo foo
After you created a fifo, run from bash:
lexer a.cl>foo
The above process should block.
gdb parser
Then, in gdb prompt, run
run<foo
And you should see an error message:
Starting program: /usr/class/cs143/cool/assignments/PA3/parser dump_with_types(cout,0);
This is much better than "Segmentation Fault" from the command line when you run ./lexer a.cl | ./parser
No comments:
Post a Comment