[comp.lsi] Help needed when using DBX and MAGIC

dchan@mozart.steinmetz (10/21/87)

We need some help on our Sun's (SunOS 3.4) when debugging the 1986
Berkeley version of MAGIC (a VLSI layout tool).

In particular, when we use dbx to debug some local modifications
to MAGIC, we get the error 

	Stopped (tty output)

we get the prompt, then type
	reset	(because echo is turned off)
	fg	(because the job is in the background)
and then we get the error
	signal IO (possible input/output) in ioctl at 0xee85c
	ioctl+6:                bcss    isatty+0x3c
	(dbx) 


When we try it without the debugger, the program runs properly.
The normal behavior is to create a new window on the monitor,
with a prompt in the original window.

This looks like a problem with stdout, fork, and dbx.
Can anyone give us a clue as to why this is occuring and how to debug
MAGIC without adding a lot of printf statements?

Thanks in advance.

John Pedicone
	pedicone@ge-crd.arpa
	uunet!steinmetz!mozart!pedicone

gwu@VLSI.CS.CMU.EDU (George Wu) (10/23/87)

     I would guess that the reason for this lies somewhere along the lines
that Magic tries to do I/O in cbreak mode. Dbx on the other hand wants to use
the normal buffered I/O mode. So of course, a conflict occurs, and dbx gives
up. Playing with the tty status (via reset) only confuses the issue more.

     I would suggest you try using the GNU debugger, gdb. While I have never
used this debugger, I've heard many claims from devout users, including the
claim that it handles programs that use raw and cbreak mode programs. It also
reputedly handles large programs better.

     And now for my own question. Someone has recently asked me about a black
and white version of Magic. Now I know Magic has a Sun b/w driver, but this
guy's only got b/w IBM RTs. So has anyone does this job, or part of it? Thanks
in advance.

							George

gwu@VLSI.CS.CMU.EDU (George Wu) (10/23/87)

     Oops, I forgot to mention that he does have X running on the RTs. So if
you've got Magic running under b/w X, let me know. Thanks again.

						George

perez@devvax.JPL.NASA.GOV (Craig D. Perez) (10/23/87)

In article <217@PT.CS.CMU.EDU> gwu@VLSI.CS.CMU.EDU (George Wu) writes:
>
>     I would guess that the reason for this lies somewhere along the lines
>that Magic tries to do I/O in cbreak mode. Dbx on the other hand wants to use
>the normal buffered I/O mode. So of course, a conflict occurs, and dbx gives
>up. Playing with the tty status (via reset) only confuses the issue more.

   I have never had trouble with dbx and cbreak mode... dbx runs my
program normally when I am debugging. The only reason why I could see
I/O problems with dbx is if MAGIC is doing non standard reads and
writes in cbreak mode (i.e. playing directly with screen attributes
and terminal settings).
                              Craig (Perez@devvax.JPL.NASA.Gov)

DISCLAIMER: I'm myself and no one else... This is MY opinion!!!
-----------> Please direct flames to me and not the net...

mayo@mustard.Berkeley.EDU.berkeley.edu (Bob Mayo) (10/23/87)

Magic does async IO, so that the background DRC can be interrupted.  This 
gives rise to the DBX problem mentioned.  You can instruct some versions
of DBX to ignore certain signals.  There is also an undocumented flag in
Magic ("-D") that causes it to behave a bit differently for debugging
purposes.  Either of these will, I think, allow Magic to run under DBX.

--Bob Mayo
ucbvax!mayo
mayo@berkeley.edu