Text File

Aihuxp.110 NET.blfp utzoo!decvax!ucbvax!mhtsa!ihnss!ihuxp!shqer Tue Jul 28 13:40:23 1981 BLFP 3.22 From: ihn5g!jdd Subject: BLFP 3.22 (This newsletter may contain proprietary information so it is not to be distributed outside Bell Labs.)

Bell Labs Free Press Tuesday, 28 July 1981 Volume 3 : Issue 22

Today's Topics: HP2621p Printer Malfuntion, Forgotten Command: diff3, Printing Strings in Debuggers ----------------------------------------------------------------------

>From karn Mon Jul 27 17:41:16 1981 CDT remote from ihnss Subject: hp printer falling behind

One possibility is the XON/XOFF handshake option in the terminal. Check the "x" handshake option and make sure it is set.

Phil

------------------------------

>From ber Tue Jul 28 01:27:37 1981 remote from harpo Subject: hp2621p

It sounds to me like your terminal is not running the Xon/Xoff protocol check the straps. Mine are:

handshake --------- etX

which is what UNIX likes to see. Let me know if this does it.

brian

------------------------------

>From ikeya!rob Tue Jul 28 01:48 EDT 1981 remote from research Subject: HP2621's and the lot

The HP2621 has a buffer to store received characters, and the printer goes at less than 1200 baud, so if the characters are coming at 1200 baud or faster, the terminal cannot keep up. The X "strap" may be set, which causes the terminal to spew ^S/^Q to control the buffer filling up. However, the amount of space left in the buffer when the ^S is sent is small, although larger in more recent terminals, and some Unices do not stop sending before the buffer fills up. It takes code in the driver to handle 2621's properly.

If the buffer fills up or the terminal receiver gets overruns, the terminal puts delete characters in the buffer.

------------------------------

>From rsk Sun Jul 26 20:33:01 1981 remote from pur-ee Subject: Forgotten Commands

I got one for ya...."diff3" which does a three-way file comparison--sure beats running "diff" three times and slogging through all the output... By the way, I was surprised to hear that "pack" and "unpack" are not in common use at your site--since disk-limits are tight and rigidly enforced here, everybody, and i mean everybody, uses "pack" to save space.

pur-ee!rsk rich kulawiec

[pur-ee no longer receives the BLFP because they are non-BTL. JLS]

------------------------------

>From steffen Tue Jul 28 12:28:10 1981 CDT remote from ihuxp Subject: Portability Problem: Printing Strings in Debuggers

Although C does not have a string data type per se, character arrays are commonly used as a defacto string data type. A fixed size char array is used to contain a variable length string of chars terminated by a null char.

The problem is how to safely print char arrays as strings in debugging tools. If you tell printf to print a char array as a string it prints chars until it finds a null char (value of 0), so if the char array does not contain a null char, and it does not find one before it reaches the end of the allowed address spectrum, the program aborts due to a bus or memory error.

Obviously you must limit the number of characters printed, but how do you determine the limit? The compiler symbol table contains the length of all the char arrays, but this does not tell you the length of an array passed as an arguement to a function. Picking an arbitrary limit (like 50) does not work because some char arrays may be longer, and you will still get a memory error if you try to print a char array that is smaller than the limit and abuts the address boundry. Thus, the debugger must really know the allowable address range for the program so it can make sure that it does not exceed it when printing a char array.

Is there a portable method of determining this address range? I say "portable" because there is a subroutine flow tracing program ("trace" in the Unix Stockroom) which has solved this problem for PDP 11 Unix, but the solution does not appear to be portable. I would prefer something that would be portable across all implementations of the C language, but since this may be impossible, I will settle for portability across all versions of Unix. The a.out file should contain the address range information, but is it the same for all versions of Unix?

Joe Steffen ihuxp!steffen or ihuxk!steffen IH 2C-331 x5381

------------------------------

End of Bell Labs Free Press ***************************

----------------------------------------------------------------- gopher://quux.org/ conversion by John Goerzen <jgoerzen@complete.org> of http://communication.ucsd.edu/A-News/

This Usenet Oldnews Archive article may be copied and distributed freely, provided:

1. There is no money collected for the text(s) of the articles.

2. The following notice remains appended to each copy:

The Usenet Oldnews Archive: Compilation Copyright (C) 1981, 1996 Bruce Jones, Henry Spencer, David Wiseman.