Hi,
I tried running the same code but I am getting different kind of errors.
These are the errors
valgrind --db-attach=yes --log-file=testout.txt myprogram.cpp < input.txt
myprogram.cpp: line 3: using: command not found
myprogram.cpp: line 4: syntax error near unexpected token `('
myprogram.cpp: line 4: `int main(void)'

But when I run the above program using g++ with the following steps my program 
gets compiled correctly.

g++ myprogram.cpp  ===>No wrrors reported.

Why am I getting errors when I run the command 

valgrind --db-attach=yes --log-file=testout.txt myprogram.cpp < 
input.txt.I am running the above command in RHEL.

Please let me know if I am doing anything incorrect?

Thanks,
Ajit

--- On Mon, 4/12/10, Alexander Potapenko <[email protected]> wrote:

From: Alexander Potapenko <[email protected]>
Subject: Re: [Valgrind-users] 3.5.0, macosx snow leopard, stdin
To: "Anna Ceguerra" <[email protected]>
Cc: [email protected]
Date: Monday, April 12, 2010, 4:21 PM

I've built your program and Valgrind prints:
input i
I is : 1

, so everything is ok for me.

BTW, --db-attach is unimplemented on OS X, so this flag won't help in
the case of any error.

Alex.

On Mon, Apr 12, 2010 at 2:14 PM, Anna Ceguerra <[email protected]> wrote:
> Hi,
> I  am trying to do the following (valgrind 3.5.0, mac osx):
> valgrind --db-attach=yes --log-file=testout.txt myprogram < input.txt
> where input.txt contains the number 1
> and myprogram is as follows:
> #include <iostream>
> #include <cstdlib>
> using namespace std;
> int main()
> {
> unsigned int i;
> cout << "input i" << endl;
> cin >> i;
> cout << "I is : " << i << endl;
> }
>
> But valgrind keeps exiting without even printing "input i"
> Is there anything that I'm doing wrong?
> Thanks for your help.
> Regards,
> Anna.
>
> ------------------------------------------------------------------------------
> Download Intel® Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> Valgrind-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/valgrind-users
>
>



-- 
Alexander Potapenko
Software Engineer
Google Moscow

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users



      
------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to