| 309 | |
| 310 | |
| 311 | void PrintUsage() |
| 312 | { |
| 313 | std::cout << |
| 314 | "Usage: DbgMsgSrc <opt>\n" |
| 315 | "\n" |
| 316 | " -1 read 'titan_crash_debugview_43mb.log' and output it through OutputDebugStringA\n" |
| 317 | " -2 <filename> read <filename> and output it through OutputDebugStringA\n" |
| 318 | " -3 run endless test\n" |
| 319 | " -s run -n repeatedly (10x / second) in separate processes)\n" |
| 320 | " -w Send OutputDebugStringA 'WithoutNewLine'\n" |
| 321 | " -n Send OutputDebugStringA 'WithNewLine\\n'\n" |
| 322 | " -e Send empty OutputDebugStringA message (does not trigger DBwinMutex!)\n" |
| 323 | // about -4: |
| 324 | // we cannot guarantee what happens if 1x OutputDebugStringA is send |
| 325 | // the process might already be gone be time we handle the message |
| 326 | // however, if 2 messages are send, the process is guarenteed to be alive |
| 327 | // at least after receiving the first message but before setting the m_dbWinBufferReady flag.. |
| 328 | // (because before setting the flag the traced process is still waiting for the flag) |
| 329 | // this means sending 2 messages and dieing ASAP afterwards is the worst-case we can still handle reliablely. |
| 330 | " -4 Send 2x OutputDebugStringA 'WithNewLine\\n' (process handle cache test)\n" |
| 331 | " -5 Send OutputDebugStringA '1\\n2\\n3\\n'\n" |
| 332 | " -6 Send OutputDebugStringA '1 ' '2 ' '3\\n' in separate messages\n" |
| 333 | " -7 DbgMsgTest, sends 5 different test lines, using different newlines styles\n" |
| 334 | " -8 <frequency> DbgMsgSrc, Send OutputDebugStringA test lines with the specified frequency\n" |
| 335 | " -9 DBGVIEWCLEAR test\n" |
| 336 | " -A cout/cerr test\n" |
| 337 | " -u <address> <port> Send UDP messsages to address:port\n"; |
| 338 | } |
| 339 | |
| 340 | int Main(int argc, char* argv[]) |
| 341 | { |