🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

3 total messages Started by ericr@hpvcfs1.HP Mon, 27 Feb 1989 16:59
Zortech/Codeview vs. local variables?
#2651
Author: ericr@hpvcfs1.HP
Date: Mon, 27 Feb 1989 16:59
23 lines
806 bytes
I just received my update to Zortech C++ (1.07e) and am trying to
use it with Codeview version 2.2 (It came with my Masm 5.1).  To keep
things simple, I compiled the wc program that comes with the Zortech
package using the -g option "ztc -g wc.c" and try to use Codeview.
Codeview sees the line information and single steps through the program
just fine, but I am unable to look at any local variables.  Using
the 'X?*' command, codeview lists all of the local variables in the current
function, but it will not let me set watchpoints nor use the "?" command
to see what their values are.  Am I missing something?

Any help would be appreciated.

Other configuration info:

Running MSDOS 3.3 on a Hewlett Packard Vectra RS/20 (80386).


Thanks,

Eric Ross
hplabs!hpvcfs1!ericr
ericr%hpvcper@hplabs.hp.com
Re: Zortech/Codeview vs. local variables?
#2658
Author: usenet@cps3xx.UU
Date: Tue, 28 Feb 1989 14:22
33 lines
1643 bytes
in article <1120002@hpvcfs1.HP.COM>, ericr@hpvcfs1.HP.COM (Eric Ross) says:
>
> I just received my update to Zortech C++ (1.07e) and am trying to
> use it with Codeview version 2.2 (It came with my Masm 5.1).  To keep
> things simple, I compiled the wc program that comes with the Zortech
> package using the -g option "ztc -g wc.c" and try to use Codeview.
> Codeview sees the line information and single steps through the program
> just fine, but I am unable to look at any local variables.  Using
> the 'X?*' command, codeview lists all of the local variables in the current
> function, but it will not let me set watchpoints nor use the "?" command
> to see what their values are.  Am I missing something?
>
> Any help would be appreciated.
>
I've been using Zortech C++ v1.02 and Codeview, whatever version comes
with MASM5.0.

I believe I've been compiling with "ztc -g -co" and having it link with
the MicroSoft Linker. What I've been doing to examine a local variable
is when I get to a point at which I need to see a variable's value is
change the source mode so that I see assembly code with the c lines
interspersed as comments. From that you can easily find a variable's
value. As 99.9% of my code doesn't use floats or doubles, this does not
present any problem to me.

Granted, it would be a lot easier to print local variables and use
watchpoints.

John H. Lawitzke      UUCP: Work: ...rutgers!mailrus!frith!fciiho!jhl
Michigan Farm Bureau              ...decvax!purdue!mailrus!frith!fciiho!jhl
Insurance Group                   ...uunet!frith!fciiho!jhl
                            Home: ...uunet!frith!fciiho!ipecac!jhl
The meaning of this
#2666
Author: levy@fine.Prince
Date: Tue, 28 Feb 1989 19:24
73 lines
2197 bytes
I created the |iline| (input line) class to automate the common (for me)
situation where a program must parse its input line by line,
and it doesn't know a priori how long the input lines are going to be.
An |iline| is used like an |istream| (of which it is a derived class),
with the following two additional functions: a constructor which takes
an existing |istream| as an argument, and binds the |iline| to it;
and |fill| which fills the |iline| with the next line from the |istream|.

Below is a simplified version of the code (it doesn't handle lines
of arbitrary length).  I can post the full thing if there is interest.

My questions are:
(1) How have other people handled this situation?  I started using C++
very recently, and may be taking a completely wrong, or at least
inefficient, approach.
(2) If I replace |this->istream| with |istream| in the body of
|iline::fill|, the program doesn't behave correctly.  The |istream|
structure within the |iline| simply doesn't get updated.  But how
can |this->istream| differ from |istream| if |istream| is a member
function of the object pointed to by this?  Where is that explained
in the C++ book?

Thanks.

*************************************************

#include <stream.h>

class iline: public istream
{
  istream* src_p;  // source istream
  int size;        // size of char array to hold a line of input
  char* beg;       // beginning of ditto
public:
  iline(istream& src_=cin, int size_0);
  ~iline() { delete beg; };
  iline& fill(char term='\n');
};

// The implicit call to |istream()| sets the state to |bad|, so reading
// will fail from an |iline| which hasn't yet been |fill|ed.

iline::iline(istream& src_=cin, int size_0)
{
  beg=new char[size=size_];
  src_p=&src_;
};

// In reality we should make sure a whole line has been read,
// and increase the size of the char array if not.

iline& iline::fill(char term='\n')
{
  clear();
  failif(!src_p->getline(beg,size-1,term));
  if (!fail())
    this->istream(size,beg);
  return *this;
}

// An example of use

main()
{
  iline foo;  // bound to cin by default
  int i;
  while (foo.fill()) {
    while (foo >> i)
      cout << i << ";";
    cout << "\n";
  }
}
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads