Debug Target is null [message #1809429] |
Tue, 16 July 2019 06:43 |
Kien Minh Quan Messages: 7 Registered: July 2019 |
Junior Member |
|
|
Hi everyone,
These days, I have faced to the inextricable issue in getting value of Debug Target in CDT Debugger after I had launched into Debug mode. In particular, I used method getDebugTarget() for Launch object, it just returns null, which wasn't what I actually expected. So I wonder whether I launched CDT Debugger in the right way, and there is any Debug Target added into Launch object default. Please help me to get over this obstacle.
I'm definitely grateful when receiving your feedback.
Many thanks!
Below is my code in python that I used for launch CDT Debugger.:
from py4j.java_gateway import JavaGateway, java_import
gateway = JavaGateway()
jvm = gateway.jvm
java_import(jvm, 'org.eclipse.debug.core.*')
java_import(jvm, 'org.eclipse.cdt.launch.*')
java_import(jvm, 'org.eclipse.debug.core.ILaunchManager')
java_import(jvm, 'org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants')
java_import(jvm, 'org.eclipse.debug.core.Launch')
DebugPlugin = jvm.DebugPlugin.getDefault()
manager = DebugPlugin.getLaunchManager()
ATTR_PROJECT_NAME = jvm.ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME
ATTR_PROGRAM_NAME= jvm.ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME
ID_LAUNCH_C_APP = jvm.ICDTLaunchConfigurationConstants.ID_LAUNCH_C_APP
DEBUG_MODE = jvm.ILaunchManager.DEBUG_MODE
RUN_MODE = jvm.ILaunchManager.RUN_MODE
type = manager.getLaunchConfigurationType(ID_LAUNCH_C_APP)
wc = type.newInstance(None, project)
wc.setAttribute(ATTR_PROJECT_NAME, project)
wc.setAttribute(ATTR_PROGRAM_NAME, program)
config = wc.doSave()
launch = config.launch(DEBUG_MODE, None)
|
|
|
|
Powered by
FUDForum. Page generated in 0.03149 seconds