This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Help with solaris testing


Hi Mark, thanks, and sorry for not replying sooner.  Only now
I came back to the issue.

On Tuesday 29 July 2008 16:39:15, Mark Kettenis wrote:

> > When running the testsuite under Solaris, I get a bunch of failures
> > and they appear to be related to something translating "\r" -> "\r\n".
> > The eols end up being "\r\r\n" instead of "\r\n", and a lot of test
> > patterns don't expect that.
> >
> > How do people test under solaris?  Is this perhaps a well known
> > issue with an easy well known fix?
>
> This is strange; I've tested GDB on Solaris in the past and never
> encountered this problem.
>
> What does stty -a say on the system?  Could it be that one of ocrnl or
> onlret is set?

Hmm, not really.

 -bash-3.2$ /usr/bin/stty -a
 ...
 opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel tab3

I just found a workaround.  Overriding the stty settings expect does on
the pty used in spawn's,

 proc default_gdb_start { } {
  ...
  global stty_init
  set stty_init "<the stty -a settings of my terminal>"

  ...
 }

... makes the issue go away.

This bit here http://www.cotse.com/dlf/man/expect/spawn.htm:

 "Internally, spawn uses a pty, initialized the same way as the userâs tty.   
 This is further initialized so that all settings are âsaneâ (according to   
 stty(1))."

The latter seems to indicate where the problem is:

On solaris:
 pedro@opensolaris:~/orlando/gdb/multi_process/build-solaris/gdb$ /usr/bin/stty
 speed 38400 baud; -parity
 rows = 34; columns = 118; ypixels = 0; xpixels = 0;
 swtch = <undef>;
 brkint -inpck -istrip icrnl -ixon ixoff imaxbel onlcr onocr tab3 echo echoe echok echonl echoctl echoke iexten

On linux:
 [pedro@orlando][~/gdb/multi_process/src/gdb/testsuite/gdb.base]>/bin/stty
 speed 38400 baud; line = 0;
 -brkint -imaxbel iutf8

Probably, passing -nottyinit to spawn would "fix" it too.

Anybody seen this before?  What's the correct fix for this?

-- 
Pedro Alves
---
 gdb/testsuite/lib/gdb.exp |    4 ++++
 1 file changed, 4 insertions(+)

Index: src/gdb/testsuite/lib/gdb.exp
===================================================================
--- src.orig/gdb/testsuite/lib/gdb.exp	2008-08-05 14:03:59.000000000 +0100
+++ src/gdb/testsuite/lib/gdb.exp	2008-08-05 14:42:40.000000000 +0100
@@ -1154,6 +1154,10 @@ proc default_gdb_start { } {
     global gdb_prompt
     global timeout
     global gdb_spawn_id;
+    global stty_init
+
+#    set stty_init raw
+    set stty_init "-parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts -ignbrk brkint ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl -ixon ixoff -iuclc -ixany imaxbel opost -olcuc -ocrnl onlcr onocr -onlret -ofill -ofdel nl0 cr0 tab3 bs0 vt0 ff0 isig icanon iexten echo echoe echok echonl -noflsh -xcase -tostop -echoprt echoctl echoke"
 
     gdb_stop_suppressing_tests;
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]