1 //===-- MICmnResources.cpp --------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
11 // File: MICmnResources.cpp
13 // Overview: CMICmnResources implementation.
15 // Environment: Compilers: Visual C++ 12.
16 // gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
17 // Libraries: See MIReadmetxt.
22 // Third party headers
26 #include "MICmnResources.h"
29 const CMICmnResources::SRsrcTextData CMICmnResources::ms_pResourceId2TextData[] = {
30 {IDS_PROJNAME, "LLDB Machine Interface Driver (MI) All rights reserved"},
31 {IDS_MI_VERSION_DESCRIPTION_DEBUG, "Version: 1.0.0.9 (Debug)"}, // See version history in MIDriverMain.cpp
32 {IDS_MI_VERSION_DESCRIPTION, "Version: 1.0.0.9"},
33 {IDS_MI_APPNAME_SHORT, "MI"},
34 {IDS_MI_APPNAME_LONG, "Machine Interface Driver"},
35 {IDS_MI_APP_FILEPATHNAME, "Application: %s"},
36 {IDS_MI_APP_ARGS, "Command line args: "},
38 "Version: GNU gdb (GDB) 7.4 \n(This is a MI stub on top of LLDB and not GDB)\nAll rights reserved.\n"}, // *** Eclipse needs this
40 {IDS_UTIL_FILE_ERR_INVALID_PATHNAME, "File Handler. Invalid file name path"},
41 {IDS_UTIL_FILE_ERR_OPENING_FILE, "File Handler. Error %s opening '%s'"},
42 {IDS_UTIL_FILE_ERR_OPENING_FILE_UNKNOWN, "File Handler. Unknown error opening '%s'"},
43 {IDE_UTIL_FILE_ERR_WRITING_FILE, "File Handler. Error %s writing '%s'"},
44 {IDE_UTIL_FILE_ERR_WRITING_NOTOPEN, "File Handler. File '%s' not open for write"},
45 {IDS_RESOURCES_ERR_STRING_NOT_FOUND, "Resources. String (%d) not found in resources"},
46 {IDS_RESOURCES_ERR_STRING_TABLE_INVALID, "Resources. String resource table is not set up"},
47 {IDS_MI_CLIENT_MSG, "Client message: \"%s\""},
48 {IDS_LOG_MSG_CREATION_DATE, "Creation date %s time %s%s"},
49 {IDS_LOG_MSG_FILE_LOGGER_PATH, "File logger path: %s%s"},
50 {IDS_LOG_MSG_VERSION, "Version: %s%s"},
51 {IDS_LOG_ERR_FILE_LOGGER_DISABLED, "Log. File logger temporarily disabled due to file error '%s'"},
52 {IDS_LOG_MEDIUM_ERR_INIT, "Log. Medium '%s' initialise failed. %s"},
53 {IDS_LOG_MEDIUM_ERR_WRITE_ANY, "Log. Failed to write log data to any medium."},
54 {IDS_LOG_MEDIUM_ERR_WRITE_MEDIUMFAIL, "Log. One or mediums failed writing log data."},
55 {IDS_MEDIUMFILE_NAME, "File"},
56 {IDS_MEDIUMFILE_ERR_INVALID_PATH, "<Invalid - not set>"},
57 {IDS_MEDIUMFILE_ERR_FILE_HEADER, "<Invalid - header not set>"},
58 {IDS_MEDIUMFILE_NAME_LOG, "File medium. %s"},
59 {IDE_MEDIUMFILE_ERR_GET_FILE_PATHNAME_SYS, "File Medium. Failed to retrieve the system/executable path for the Log file"},
60 {IDE_OS_ERR_UNKNOWN, "Unknown OS error"},
61 {IDE_OS_ERR_RETRIEVING, "Unabled to retrieve OS error message"},
62 {IDS_DRIVERMGR_DRIVER_ERR_INIT, "Driver Manager. Driver '%s' (ID:'%s') initialise failed. %s"},
63 {IDE_MEDIUMSTDERR_NAME, "Stderr"},
64 {IDE_MEDIUMSTDOUT_NAME, "Stdout"},
65 {IDE_MI_APP_EXIT_OK, "Program exited OK"},
66 {IDE_MI_APP_EXIT_WITH_PROBLEM, "Program exited with a problem, see '%s' file"},
67 {IDE_MI_APP_EXIT_WITH_PROBLEM_NO_LOG, "Program exited with a problem, the application's log file '%s' was disabled"},
68 {IDE_MI_APP_DESCRIPTION, "Description:\nThe Machine Interface Driver (MI Driver) is a stand alone executable\nthat either be used via "
69 "a client i.e. Eclipse or directly from the command\nline. It processes MI commands, actions those commands "
70 "using the internal\ndebugger then forms MI response formatted text which is returned to the\nclient."},
71 {IDE_MI_APP_INFORMATION, "Information:\nCurrent limitations. The MI Driver currently only handles remote target\ndebugging. Local "
72 "debugging has not been implemented. The MI Driver has\nbeen designed primarily to be used with Eclipse Juno "
73 "and a custom plugin.\nThe custom plugin is not necessary to operate the MI Driver."},
74 {IDE_MI_APP_ARG_USAGE, "\nMI driver usage:\n\n\tlldb-mi [--longOption] [-s hortOption] [executeable]\n\n[] = optional argument."},
75 {IDE_MI_APP_ARG_HELP, "-h\n--help\n\tPrints out usage information for the MI debugger. Exit the MI\n\tDriver immediately."},
76 {IDE_MI_APP_ARG_VERSION, "--version\n\tPrints out GNU (gdb) version information. Exit the MI Driver\n\timmediately."},
77 {IDE_MI_APP_ARG_VERSION_LONG, "--versionLong\n\tPrints out MI Driver version information. Exit the MI Driver\n\timmediately."},
78 {IDE_MI_APP_ARG_INTERPRETER, "--interpreter\n\tUse the MI Driver for the debugger (MI mode)(Default is the\n\tLLDB driver). Any LLDB "
79 "command line options are ignored even\n\tif the MI Driver falls through to the LLDB driver. "
80 "(Depends\n\ton the build configuration see MICmnConfig.h)\n\tNormally specified by the driver client "
81 "i.e. Eclipse.\n\tCannot specify an executable with this option, use --executable."},
82 {IDE_MI_APP_ARG_EXECUTEABLE, "--executable\n\tUse the MI Driver in MI mode for the debugging the specified\n\texecutable. Any LLDB "
83 "command line options are ignored even\n\tif the MI Driver falls through to the LLDB driver. "
84 "(Depends\n\ton the build configuration see MICmnConfig.h)\n\tNormally specified from the command line."},
85 {IDE_MI_APP_ARG_NO_APP_LOG, "--noLog\n\tUse this argument to tell the MI Driver not to update it's log\n\tfile '%s'."},
86 {IDE_MI_APP_ARG_EXAMPLE, "Example MI command:\n\t3-info-gdb-mi-command gdb-set\n\t3^done,command={exists=\"true\"}"},
87 {IDE_MI_APP_ARG_EXECUTABLE, "executable (NOT IMPLEMENTED)\n\tThe file path to the executable i.e. '\"C:\\My Dev\\foo.exe\"'."},
88 {IDS_STDIN_ERR_INVALID_PROMPT, "Stdin. Invalid prompt description '%s'"},
89 {IDS_STDIN_ERR_THREAD_CREATION_FAILED, "Stdin. Thread creation failed '%s'"},
90 {IDS_STDIN_ERR_THREAD_DELETE, "Stdin. Thread failed to delete '%s'"},
91 {IDS_STDIN_ERR_CHKING_BYTE_AVAILABLE, "Stdin. Peeking on stdin stream '%s'"},
92 {IDS_STDIN_INPUT_CTRL_CHARS, "Stdin. Receive characters not handled as a command: "},
93 {IDS_CMD_QUIT_HELP, "MI Driver Command: quit\n\tExit the MI Driver application."},
94 {IDS_THREADMGR_ERR_THREAD_ID_INVALID, "Thread Mgr. Thread ID '%s' is not valid"},
95 {IDS_THREADMGR_ERR_THREAD_FAIL_CREATE, "Thread Mgr: Failed to create thread '%s'"},
96 {IDS_THREADMGR_ERR_THREAD_ID_NOT_FOUND, "Thread Mgr: Thread with ID '%s' not found"},
97 {IDS_THREADMGR_ERR_THREAD_STILL_ALIVE, "Thread Mgr: The thread(s) are still alive at Thread Mgr shutdown: %s"},
98 {IDS_FALLTHRU_DRIVER_CMD_RECEIVED, "Fall Thru Driver. Received command '%s'. Is was %shandled"},
99 {IDS_CMDFACTORY_ERR_INVALID_CMD_NAME, "Command factory. MI command name '%s' is invalid"},
100 {IDS_CMDFACTORY_ERR_INVALID_CMD_CR8FN,
101 "Command factory. Command creation function invalid for command '%s'. Does function exist? Pointer assigned to it?"},
102 {IDS_CMDFACTORY_ERR_CMD_NOT_REGISTERED, "Command factory. Command '%s' not registered"},
103 {IDS_CMDFACTORY_ERR_CMD_ALREADY_REGED, "Command factory. Command '%s' by that name already registered"},
104 {IDS_CMDMGR_ERR_CMD_FAILED_CREATE, "Command manager. Command creation failed. %s"},
105 {IDS_CMDMGR_ERR_CMD_INVOKER, "Command manager. %s "},
106 {IDS_PROCESS_SIGNAL_RECEIVED, "Process signal. Application received signal '%s' (%d)"},
107 {IDS_MI_INIT_ERR_LOG, "Log. Error occurred during initialisation %s"},
108 {IDS_MI_INIT_ERR_RESOURCES, "Resources. Error occurred during initialisation %s"},
109 {IDS_MI_INIT_ERR_INIT, "Driver. Error occurred during initialisation %s"},
110 {IDS_MI_INIT_ERR_STREAMSTDIN, "Stdin. Error occurred during initialisation %s"},
111 {IDS_MI_INIT_ERR_STREAMSTDIN_OSHANDLER, "Stdin. The OS specific stdin stream handler has not been specified for this OS"},
112 {IDS_MI_INIT_ERR_OS_STDIN_HANDLER, "Stdin handler. Error occurred during initialisation %s"},
113 {IDS_MI_INIT_ERR_STREAMSTDOUT, "Stdout. Error occurred during initialisation %s"},
114 {IDS_MI_INIT_ERR_STREAMSTDERR, "Stderr. Error occurred during initialisation %s"},
115 {IDS_MI_INIT_ERR_FALLTHRUDRIVER, "Fall Through Driver. Error occurred during initialisation %s"},
116 {IDS_MI_INIT_ERR_THREADMGR, "Thread Mgr. Error occurred during initialisation %s"},
117 {IDS_MI_INIT_ERR_CMDINTERPRETER, "Command interpreter. %s"},
118 {IDS_MI_INIT_ERR_CMDMGR, "Command manager. %s"},
119 {IDS_MI_INIT_ERR_CMDFACTORY, "Command factory. %s"},
120 {IDS_MI_INIT_ERR_CMDINVOKER, "Command invoker. %s"},
121 {IDS_MI_INIT_ERR_CMDMONITOR, "Command monitor. %s"},
122 {IDS_MI_INIT_ERR_LLDBDEBUGGER, "LLDB Debugger. %s"},
123 {IDS_MI_INIT_ERR_DRIVERMGR, "Driver manager. %s"},
124 {IDS_MI_INIT_ERR_DRIVER, "Driver. %s"},
125 {IDS_MI_INIT_ERR_OUTOFBANDHANDLER, "Out-of-band handler. %s "},
126 {IDS_MI_INIT_ERR_DEBUGSESSIONINFO, "LLDB debug session info. %s "},
127 {IDS_MI_INIT_ERR_THREADMANAGER, "Unable to init thread manager."},
128 {IDS_MI_INIT_ERR_CLIENT_USING_DRIVER, "Initialising the client to this driver failed."},
129 {IDS_MI_INIT_ERR_LOCAL_DEBUG_SESSION, "Initialising a local debug session failed."},
130 {IDS_CODE_ERR_INVALID_PARAMETER_VALUE, "Code. Invalid parameter passed to function '%s'"},
131 {IDS_CODE_ERR_INVALID_PARAM_NULL_POINTER, "Code. NULL pointer passes as a parameter to function '%s'"},
132 {IDS_CODE_ERR_INVALID_ENUMERATION_VALUE, "Code. Invalid enumeration value encountered in function '%s'"},
134 IDS_LLDBDEBUGGER_ERR_INVALIDLISTENER, "LLDB Debugger. LLDB Listener is not valid",
137 IDS_LLDBDEBUGGER_ERR_INVALIDDEBUGGER, "LLDB Debugger. LLDB Debugger is not valid",
139 {IDS_LLDBDEBUGGER_ERR_CLIENTDRIVER,
140 "LLDB Debugger. CMIDriverBase derived driver needs to be set prior to CMICmnLLDBDDebugger initialisation"},
141 {IDS_LLDBDEBUGGER_ERR_STARTLISTENER, "LLDB Debugger. Starting listening events for '%s' failed"},
142 {IDS_LLDBDEBUGGER_ERR_THREADCREATIONFAIL, "LLDB Debugger. Thread creation failed '%s'"},
143 {IDS_LLDBDEBUGGER_ERR_THREAD_DELETE, "LLDB Debugger. Thread failed to delete '%s'"},
144 {IDS_LLDBDEBUGGER_ERR_INVALIDBROADCASTER, "LLDB Debugger. Invalid SB broadcaster class name '%s' "},
145 {IDS_LLDBDEBUGGER_ERR_INVALIDCLIENTNAME, "LLDB Debugger. Invalid client name '%s' "},
146 {IDS_LLDBDEBUGGER_ERR_CLIENTNOTREGISTERD, "LLDB Debugger. Client name '%s' not registered for listening events"},
147 {IDS_LLDBDEBUGGER_ERR_STOPLISTENER, "LLDB Debugger. Failure occurred stopping event for client '%s' SBBroadcaster '%s'"},
148 {IDS_LLDBDEBUGGER_ERR_BROARDCASTER_NAME, "LLDB Debugger. Broardcaster's name '%s' is not valid"},
149 {IDS_LLDBDEBUGGER_WRN_UNKNOWN_EVENT, "LLDB Debugger. Unhandled event '%s'"},
150 {IDS_LLDBOUTOFBAND_ERR_UNKNOWN_EVENT, "LLDB Out-of-band. Handling event for '%s', an event enumeration '%d' not recognised"},
151 {IDS_LLDBOUTOFBAND_ERR_PROCESS_INVALID, "LLDB Out-of-band. Invalid '%s' in '%s'"},
152 {IDS_LLDBOUTOFBAND_ERR_BRKPT_NOTFOUND, "LLDB Out-of-band. %s. Breakpoint information for breakpoint ID %d not found"},
153 {IDS_LLDBOUTOFBAND_ERR_BRKPT_INFO_GET, "LLDB Out-of-band. %s. Failed to retrieve breakpoint information for for breakpoint ID %d"},
154 {IDS_LLDBOUTOFBAND_ERR_BRKPT_INFO_SET, "LLDB Out-of-band. %s. Failed to set breakpoint information for for breakpoint ID %d"},
155 {IDS_LLDBOUTOFBAND_ERR_FORM_MI_RESPONSE, "LLDB Out-of-band. %s. Failed to form the MI Out-of-band response"},
156 {IDS_LLDBOUTOFBAND_ERR_FRAME_INFO_GET, "LLDB Out-of-band. %s. Failed to retrieve frame information"},
157 {IDS_LLDBOUTOFBAND_ERR_SETNEWDRIVERSTATE,
158 "LLDB Out-of-band. %s. Event handler tried to set new MI Driver running state and failed. %s"},
159 {IDS_LLDBOUTOFBAND_ERR_BRKPT_CNT_EXCEEDED,
160 "LLDB Out-of-band. '%s'. Number of valid breakpoint exceeded %d. Cannot create new breakpoint with ID %d"},
161 {IDS_DBGSESSION_ERR_SHARED_DATA_RELEASE,
162 "LLDB debug session info. Release some or all of the data shared across command instances failed"},
163 {IDS_DBGSESSION_ERR_SHARED_DATA_ADD, "LLDB debug session info. Failed to add '%s' data to the shared data command container"},
164 {IDS_MI_SHTDWN_ERR_LOG, "Log. Error occurred during shutdown. %s"},
165 {IDS_MI_SHUTDOWN_ERR, "Server shutdown failure. %s"},
166 {IDE_MI_SHTDWN_ERR_RESOURCES, "Resources. Error occurred during shutdown. %s"},
167 {IDE_MI_SHTDWN_ERR_STREAMSTDIN, "Stdin. Error occurred during shutdown. %s"},
168 {IDS_MI_SHTDWN_ERR_OS_STDIN_HANDLER, "Stdin handler. Error occurred during shutdown. %s"},
169 {IDS_MI_SHTDWN_ERR_STREAMSTDOUT, "Stdout. Error occurred during shutdown. %s"},
170 {IDS_MI_SHTDWN_ERR_STREAMSTDERR, "Stderr. Error occurred during shutdown. %s"},
171 {IDS_MI_SHTDWN_ERR_THREADMGR, "Thread Mgr. Error occurred during shutdown. %s"},
172 {IDS_MI_SHTDWN_ERR_CMDINTERPRETER, "Command interpreter. Error occurred during shutdown. %s"},
173 {IDS_MI_SHTDWN_ERR_CMDMGR, "Command manager. Error occurred during shutdown. %s"},
174 {IDS_MI_SHTDWN_ERR_CMDFACTORY, "Command factory. Error occurred during shutdown. %s"},
175 {IDS_MI_SHTDWN_ERR_CMDMONITOR, "Command invoker. Error occurred during shutdown. %s"},
176 {IDS_MI_SHTDWN_ERR_CMDINVOKER, "Command monitor. Error occurred during shutdown. %s"},
177 {IDS_MI_SHTDWN_ERR_LLDBDEBUGGER, "LLDB Debugger. Error occurred during shutdown. %s"},
178 {IDS_MI_SHTDWN_ERR_DRIVERMGR, "Driver manager. Error occurred during shutdown. %s"},
179 {IDS_MI_SHTDWN_ERR_DRIVER, "Driver. Error occurred during shutdown. %s"},
180 {IDS_MI_SHTDWN_ERR_OUTOFBANDHANDLER, "Out-of-band handler. Error occurred during shutdown. %s"},
181 {IDS_MI_SHTDWN_ERR_DEBUGSESSIONINFO, "LLDB debug session info. Error occurred during shutdown. %s"},
182 {IDE_MI_SHTDWN_ERR_THREADMANAGER, "Unable to shutdown thread manager"},
183 {IDS_DRIVER_ERR_PARSE_ARGS, "Driver. Driver '%s'. Parse args error '%s'"},
184 {IDS_DRIVER_ERR_PARSE_ARGS_UNKNOWN, "Driver. Driver '%s'. Parse args error unknown"},
185 {IDS_DRIVER_ERR_CURRENT_NOT_SET, "Driver. Current working driver has not been set. Call CMIDriverMgr::SetUseThisDriverToDoWork()"},
186 {IDS_DRIVER_ERR_NON_REGISTERED, "Driver. No suitable drivers registered with the CMIDriverMgr to do work"},
187 {IDS_DRIVER_SAY_DRIVER_USING, "Driver. Using driver '%s' internally"},
188 {IDS_DRIVER_ERR_ID_INVALID, "Driver. Driver '%s' invalid ID '%s'"},
189 {IDS_DRIVER_ERR_FALLTHRU_DRIVER_ERR, "Driver. Fall through driver '%s' (ID:'%s') error '%s'"},
190 {IDS_DRIVER_CMD_RECEIVED, "Driver. Received command '%s'. It was %shandled%s"},
191 {IDS_DRIVER_CMD_NOT_IN_FACTORY, ". Command '%s' not in Command Factory"},
193 IDS_DRIVER_ERR_DRIVER_STATE_ERROR, "Driver. Driver running state error. Cannot go to next state from present state as not allowed",
195 {IDS_DRIVER_WAITING_STDIN_DATA, "Driver. Main thread suspended waiting on Stdin Monitor to resume main thread"},
196 {IDS_DRIVER_ERR_MAINLOOP, "Driver. Error in do main loop. %s"},
197 {IDS_DRIVER_ERR_LOCAL_DEBUG_NOT_IMPL, "Driver. --executable argument given. Local debugging is not implemented."},
198 {IDS_DRIVER_ERR_LOCAL_DEBUG_INIT, "Driver. --executable argument given. Initialising local debugging failed."},
199 {IDS_STDOUT_ERR_NOT_ALL_DATA_WRITTEN, "Stdout. Not all data was written to stream. The data '%s'"},
200 {IDS_STDERR_ERR_NOT_ALL_DATA_WRITTEN, "Stderr. Not all data was written to stream. The data '%s'"},
201 {IDS_CMD_ARGS_ERR_N_OPTIONS_REQUIRED, "Command Args. Missing options, %d or more required"},
202 {IDS_CMD_ARGS_ERR_OPTION_NOT_FOUND, "Command Args. Option '%s' not found"},
203 {IDS_CMD_ARGS_ERR_VALIDATION_MANDATORY, "Mandatory args not found: %s"},
204 {IDS_CMD_ARGS_ERR_VALIDATION_INVALID, "Invalid args: %s"},
205 {IDS_CMD_ARGS_ERR_VALIDATION_MAN_INVALID, "Mandatory args not found: %s. Invalid args: %s"},
206 {IDS_CMD_ARGS_ERR_VALIDATION_MISSING_INF, "Args missing additional information: %s"},
207 {IDS_CMD_ARGS_ERR_CONTEXT_NOT_ALL_EATTEN, "Not all arguments or options were recognised: %s"},
208 {IDS_CMD_ARGS_ERR_PREFIX_MSG, "Command Args. Validation failed. "},
209 {IDS_VARIANT_ERR_USED_BASECLASS, "Variant container: Variant object used the base class. See CMIUtilVariant"},
210 {IDS_VARIANT_ERR_MAP_KEY_INVALID, "Variant container: Invalid ID '%s'"},
211 {IDS_WORD_INVALIDBRKTS, "<Invalid>"},
212 {IDS_WORD_NONE, "None"},
213 {IDS_WORD_NOT, "not"},
214 {IDS_WORD_INVALIDEMPTY, "<empty>"},
215 {IDS_WORD_INVALIDNULLPTR, "<NULL ptr>"},
216 {IDS_WORD_UNKNOWNBRKTS, "<unknown>"},
217 {IDS_WORD_NOT_IMPLEMENTED, "Not implemented"},
218 {IDS_WORD_NOT_IMPLEMENTED_BRKTS, "<not implemented>"},
219 {IDS_WORD_UNKNOWNTYPE_BRKTS, "<unknowntype>"},
220 {IDS_WORD_ERR_MSG_NOT_IMPLEMENTED_BRKTS, "<error message not implemented>"},
221 {IDS_CMD_ERR_N_OPTIONS_REQUIRED, "Command '%s'. Missing options, %d required"},
222 {IDS_CMD_ERR_OPTION_NOT_FOUND, "Command '%s'. Option '%s' not found"},
223 {IDS_CMD_ERR_ARGS, "Command '%s'. %s"},
224 {IDS_CMD_WRN_ARGS_NOT_HANDLED, "Command '%s'. Warning the following options not handled by the command: %s"},
225 {IDS_CMD_ERR_FNFAILED, "Command '%s'. Fn '%s' failed"},
226 {IDS_CMD_ERR_SHARED_DATA_NOT_FOUND, "Command '%s'. Shared data '%s' not found"},
227 {IDS_CMD_ERR_LLDBPROCESS_DETACH, "Command '%s'. Process detach failed. '%s'"},
228 {IDS_CMD_ERR_SETWKDIR, "Command '%s'. Failed to set working directory '%s'"},
229 {IDS_CMD_ERR_INVALID_TARGET, "Command '%s'. Target binary '%s' is invalid. %s"},
230 {IDS_CMD_ERR_INVALID_TARGET_CURRENT, "Command '%s'. Current SBTarget is invalid"},
231 {IDS_CMD_ERR_INVALID_TARGET_TYPE, "Command '%s'. Target type '%s' is not recognised"},
232 {IDS_CMD_ERR_INVALID_TARGET_PLUGIN, "Command '%s'. Target plugin is invalid. %s"},
233 {IDS_CMD_ERR_CONNECT_TO_TARGET, "Command '%s'. Error connecting to target: '%s'"},
234 {IDS_CMD_ERR_INVALID_TARGETPLUGINCURRENT, "Command '%s'. Current target plugin is invalid"},
235 {IDS_CMD_ERR_NOT_IMPLEMENTED, "Command '%s'. Command not implemented"},
236 {IDS_CMD_ERR_NOT_IMPLEMENTED_DEPRECATED, "Command '%s'. Command not implemented as it has been deprecated"},
237 {IDS_CMD_ERR_CREATE_TARGET, "Command '%s'. Create target failed: %s"},
238 {IDS_CMD_ERR_BRKPT_LOCATION_FORMAT, "Command '%s'. Incorrect format for breakpoint location '%s'"},
239 {IDS_CMD_ERR_BRKPT_INVALID, "Command '%s'. Breakpoint '%s' invalid"},
240 {IDS_CMD_ERR_BRKPT_CNT_EXCEEDED, "Command '%s'. Number of valid breakpoint exceeded %d. Cannot create new breakpoint '%s'"},
241 {IDS_CMD_ERR_SOME_ERROR, "Command '%s'. Error: %s"},
242 {IDS_CMD_ERR_THREAD_INVALID, "Command '%s'. Thread ID invalid"},
243 {IDS_CMD_ERR_THREAD_FRAME_RANGE_INVALID, "Command '%s'. Thread frame range invalid"},
244 {IDS_CMD_ERR_FRAME_INVALID, "Command '%s'. Frame ID invalid"},
245 {IDS_CMD_ERR_VARIABLE_DOESNOTEXIST, "Command '%s'. Variable '%s' does not exist"},
246 {IDS_CMD_ERR_VARIABLE_ENUM_INVALID, "Command '%s'. Invalid enumeration for variable '%s' formatted string '%s'"},
247 {IDS_CMD_ERR_VARIABLE_EXPRESSIONPATH, "Command '%s'. Failed to get expression for variable '%s'"},
248 {IDS_CMD_ERR_VARIABLE_CREATION_FAILED, "Failed to create variable object for '%s'"},
249 {IDS_CMD_ERR_CMD_RUN_BUT_NO_ACTION, "<Error: Command run but command did not do anything useful. No MI response formed>"},
250 {IDS_CMD_ERR_EVENT_HANDLED_BUT_NO_ACTION, "<Error: Command run and event caught, did nothing useful. No MI Out-of-Bound formed>"},
251 {IDS_CMD_ERR_DISASM_ADDR_START_INVALID, "Command '%s'. Invalid start value '%s'"},
252 {IDS_CMD_ERR_DISASM_ADDR_END_INVALID, "Command '%s'. Invalid end value '%s'"},
253 {IDS_CMD_ERR_MEMORY_ALLOC_FAILURE, "Command '%s'. Failed to allocate memory %d bytes"},
254 {IDS_CMD_ERR_LLDB_ERR_NOT_READ_WHOLE_BLK, "Command '%s'. LLDB unable to read entire memory block of %u bytes at address 0x%08x"},
255 {IDS_CMD_ERR_LLDB_ERR_READ_MEM_BYTES, "Command '%s'. Unable to read memory block of %u bytes at address 0x%08x: %s "},
256 {IDS_CMD_ERR_INVALID_PROCESS, "Command '%s'. Invalid process during debug session"},
257 {IDS_CMD_ERR_INVALID_FORMAT_TYPE, "Command '%s'. Invalid var format type '%s'"},
258 {IDS_CMD_ERR_BRKPT_INFO_OBJ_NOT_FOUND, "Command '%s'. Breakpoint information for breakpoint ID %d not found"},
259 {IDS_CMD_ERR_LLDB_ERR_READ_MEM_BYTES, "Command '%s'. Unable to write memory block of %u bytes at address 0x%08x: %s "},
260 {IDS_CMD_ERR_LLDB_ERR_NOT_WRITE_WHOLEBLK, "Command '%s'. LLDB unable to write entire memory block of %u bytes at address 0x%08x"},
261 {IDS_CMD_ERR_SET_NEW_DRIVER_STATE, "Command '%s'. Command tried to set new MI Driver running state and failed. %s"},
262 {IDS_CMD_ERR_INFO_PRINTFN_NOT_FOUND, "The request '%s' was not recogised, not implemented"},
263 {IDS_CMD_ERR_INFO_PRINTFN_FAILED, "The request '%s' failed."},
264 {IDS_CMD_ERR_GDBSET_OPT_SOLIBSEARCHPATH, "'solib-search-path' requires at least one argument"}};
266 //++ ------------------------------------------------------------------------------------
267 // Details: CMICmnResources constructor.
273 CMICmnResources::CMICmnResources(void)
274 : m_nResourceId2TextDataSize(0)
276 // Do not use this constructor, use Initialize()
279 //++ ------------------------------------------------------------------------------------
280 // Details: CMICmnResources destructor.
286 CMICmnResources::~CMICmnResources(void)
288 // Do not use this destructor, use Shutdown()
291 //++ ------------------------------------------------------------------------------------
292 // Details: Initialize the resources and set locality for the server.
295 // Return: MIstatus::success - Functional succeeded.
296 // MIstatus::failure - Functional failed.
300 CMICmnResources::Initialize(void)
302 m_clientUsageRefCnt++;
305 return MIstatus::success;
307 m_bInitialized = ReadResourceStringData();
309 return m_bInitialized;
312 //++ ------------------------------------------------------------------------------------
313 // Details: Release resources for *this object.
316 // Return: MIstatus::success - Functional succeeded.
317 // MIstatus::failure - Functional failed.
321 CMICmnResources::Shutdown(void)
323 if (--m_clientUsageRefCnt > 0)
324 return MIstatus::success;
327 return MIstatus::success;
329 // Tear down resource explicitly
330 m_mapRscrIdToTextData.clear();
332 m_bInitialized = false;
334 return MIstatus::success;
337 //++ ------------------------------------------------------------------------------------
338 // Details: Initialize the resources and set locality for the server.
341 // Return: MIstatus::success - Functional succeeded.
342 // MIstatus::failure - Functional failed.
346 CMICmnResources::ReadResourceStringData(void)
348 m_nResourceId2TextDataSize = sizeof ms_pResourceId2TextData / sizeof ms_pResourceId2TextData[0];
349 for (MIuint i = 0; i < m_nResourceId2TextDataSize; i++)
351 const SRsrcTextData *pRscrData = &ms_pResourceId2TextData[i];
352 MapPairRscrIdToTextData_t pr(pRscrData->id, pRscrData->pTextData);
353 m_mapRscrIdToTextData.insert(pr);
356 return MIstatus::success;
359 //++ ------------------------------------------------------------------------------------
360 // Details: Retrieve the corresponding text assigned to the resource ID.
362 // Args: vResourceId - (R) MI resource ID.
363 // Return: CMIUtilString - Resource text.
367 CMICmnResources::GetString(const MIuint vResourceId) const
370 const bool bFound = GetStringFromResource(vResourceId, str);
377 //++ ------------------------------------------------------------------------------------
378 // Details: Determine the MI resource ID existings.
380 // Args: vResourceId - (R) MI resource ID.
381 // Return: True - Exists.
382 // False - Not found.
386 CMICmnResources::HasString(const MIuint vResourceId) const
389 return GetStringFromResource(vResourceId, str);
392 //++ ------------------------------------------------------------------------------------
393 // Details: Retrieve the resource text data for the given resource ID. If a resourse ID
394 // cannot be found and error is given returning the ID of the resource that
395 // cannot be located.
397 // Args: vResourceId - (R) MI resource ID.
398 // vrwResourceString - (W) Text.
399 // Return: MIstatus::success - Functional succeeded.
400 // MIstatus::failure - Functional failed.
404 CMICmnResources::GetStringFromResource(const MIuint vResourceId, CMIUtilString &vrwResourceString) const
406 MapRscrIdToTextData_t::const_iterator it = m_mapRscrIdToTextData.find(vResourceId);
407 if (it == m_mapRscrIdToTextData.end())
409 // Check this is a static variable init that needs this before we are ready
412 (const_cast<CMICmnResources *>(this))->Initialize();
413 it = m_mapRscrIdToTextData.find(vResourceId);
414 if (it == m_mapRscrIdToTextData.end())
416 vrwResourceString = MIRSRC(IDS_RESOURCES_ERR_STRING_TABLE_INVALID);
417 return MIstatus::failure;
421 if (it == m_mapRscrIdToTextData.end())
423 vrwResourceString = CMIUtilString::Format(MIRSRC(IDS_RESOURCES_ERR_STRING_NOT_FOUND), vResourceId);
424 return MIstatus::failure;
428 const MIuint nRsrcId((*it).first);
430 const MIchar *pRsrcData((*it).second);
433 vrwResourceString = pRsrcData;
435 return MIstatus::success;