diff -r 000000000000 -r f0f2b8682603 memana/analyzetoolclient/commandlineengine/internal/inc/cataddr2lineserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/memana/analyzetoolclient/commandlineengine/internal/inc/cataddr2lineserver.h Thu Feb 11 15:51:35 2010 +0200 @@ -0,0 +1,89 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class representing a server that uses addr2line.exe. +* +*/ + +#ifndef __CATADDR2LINESERVER_H__ +#define __CATADDR2LINESERVER_H__ + +// Includes. +#include "ATCommonDefines.h" + +#define BUFSIZE 4096 + +class CATAddr2lineServer +{ +public: + + //Creator + CATAddr2lineServer(); + + //Destructor + ~CATAddr2lineServer(); + + /** + * Get function name for given address. + * @sFullPathAndBinaryName + * @return True if initialization succesfull. + */ + bool Initialize( const string& sFullPathAndBinaryName ); + + /** + * Write data to a pipe. + * @sAddress + */ + VOID WriteToPipe( const string& sAddress ); + + /** + * Read data to a pipe. + * @return Data from pipe. + */ + string ReadFromPipe(VOID); + + /** + * Gets process created state. + * @return True if process created successfully. + */ + bool GetProcessCreatedState( void ); + +#ifndef MODULE_TEST +private: +#endif + + HANDLE m_hChildStdinRd, m_hChildStdinWr, m_hChildStdinWrDup, + m_hChildStdoutRd, m_hChildStdoutWr, m_hChildStdoutRdDup, + m_hChildErroutRd, m_hChildErroutWr, m_hChildErroutRdDup, + m_hSaveStdin, m_hSaveStdout, m_hSaveErrout; + + SECURITY_ATTRIBUTES m_saAttr; + string m_sFullPathAndBinaryName; + bool m_bProcessCreated; + + /** + * Creates child process for addr2line.exe. + * @return True if process created successfully. + */ + BOOL CreateChildProcess(VOID); + + /** + * Prints error and returns false. + * @param sInput error string. + * @return false. + */ + bool PrintErrorAndExit( const string sInput ); + + +}; +#endif