Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Debug support in C/C++ Unit Testing Plugin

Hi,

I am working on debug support in C/C++ Unit Testing Plugin. It means that user should be able to easily start debug session for the "C/C++ Unit" configuration.

To make "C/C++ Unit" view work properly I need to be able to do 2 things:
  • I need to be able to provide additional program arguments (not only stored in PROGRAM_ARGUMENTS attribute of launch configuration);
  • I need to be able to handle output and/or error streams of the started process (and prevent its output to "Console" view).
I also want to reuse standard CDI & DSF launch delegates as much as possible and I want to place all the code necessary for test modules launching in org.eclipse.cdt.testsrunner.

For CDI I decided to derive LocalCDILaunchDelegate. To handle program arguments I have just override getProgramArgumentsArray(). To obtain
output/error streams I have wrapped the process creation in launchLocalDebugSession() with a custom method wrapProcess() that by default just return the process passed to its arguments. However in my implementation of delegate it stores the necessary stream and returns a wrapper (that returns null on getInputStream()/getErrorStream() if necessary).
Is this an acceptable solution? And if yes, could I move LocalCDILaunchDelegate from org.eclipse.cdt.launch.internal to org.eclipse.cdt.launch to be able to place my delegate in org.eclipse.cdt.testsrunner? Or will it be better to configure package visibility in "Runtime" tab of plugins.xml and to add org.eclipse.cdt.testsrunner there?

For DSF I have no solution how to do the similar things. I have found that program arguments are provided by GDBBackend service and the inferior process is created in GDBProcesses & GDBProcesses_7_0, but I don't know how I can override the default behaviour. Can somebody advise me something or is there another way to do the things described above?


Anton

Back to the top