|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Class representing a server that uses addr2line.exe. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __CATADDR2LINESERVER_H__ |
|
19 #define __CATADDR2LINESERVER_H__ |
|
20 |
|
21 // Includes. |
|
22 #include "ATCommonDefines.h" |
|
23 |
|
24 #define BUFSIZE 4096 |
|
25 |
|
26 class CATAddr2lineServer |
|
27 { |
|
28 public: |
|
29 |
|
30 //Creator |
|
31 CATAddr2lineServer(); |
|
32 |
|
33 //Destructor |
|
34 ~CATAddr2lineServer(); |
|
35 |
|
36 /** |
|
37 * Get function name for given address. |
|
38 * @sFullPathAndBinaryName |
|
39 * @return True if initialization succesfull. |
|
40 */ |
|
41 bool Initialize( const string& sFullPathAndBinaryName ); |
|
42 |
|
43 /** |
|
44 * Write data to a pipe. |
|
45 * @sAddress |
|
46 */ |
|
47 VOID WriteToPipe( const string& sAddress ); |
|
48 |
|
49 /** |
|
50 * Read data to a pipe. |
|
51 * @return Data from pipe. |
|
52 */ |
|
53 string ReadFromPipe(VOID); |
|
54 |
|
55 /** |
|
56 * Gets process created state. |
|
57 * @return True if process created successfully. |
|
58 */ |
|
59 bool GetProcessCreatedState( void ); |
|
60 |
|
61 #ifndef MODULE_TEST |
|
62 private: |
|
63 #endif |
|
64 |
|
65 HANDLE m_hChildStdinRd, m_hChildStdinWr, m_hChildStdinWrDup, |
|
66 m_hChildStdoutRd, m_hChildStdoutWr, m_hChildStdoutRdDup, |
|
67 m_hChildErroutRd, m_hChildErroutWr, m_hChildErroutRdDup, |
|
68 m_hSaveStdin, m_hSaveStdout, m_hSaveErrout; |
|
69 |
|
70 SECURITY_ATTRIBUTES m_saAttr; |
|
71 string m_sFullPathAndBinaryName; |
|
72 bool m_bProcessCreated; |
|
73 |
|
74 /** |
|
75 * Creates child process for addr2line.exe. |
|
76 * @return True if process created successfully. |
|
77 */ |
|
78 BOOL CreateChildProcess(VOID); |
|
79 |
|
80 /** |
|
81 * Prints error and returns false. |
|
82 * @param sInput error string. |
|
83 * @return false. |
|
84 */ |
|
85 bool PrintErrorAndExit( const string sInput ); |
|
86 |
|
87 |
|
88 }; |
|
89 #endif |