[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[cdt-dev] Can someone explain the following launch session code in GDBCDIDebugger2 class
|
Hi,
There is the following code in the method startAttachGDBSession() of
GDBCDIDebugger2 class. The me
try {
CLITargetAttach attach = factory.createCLITargetAttach(
pid );
miSession.postCommand( attach );
MIInfo info = attach.getMIInfo();
if ( info == null ) {
throw new MIException( MIPlugin.getResourceString(
"src.common.No_answer" ) ); //$NON-NLS-1$
}
miSession.getMIInferior().setInferiorPID( pid );
// @@@ for attach we nee to manually set the connected
state
// attach does not send the ^connected ack
miSession.getMIInferior().setConnected();
}
catch( MIException e ) {
throw newCoreException( MessageFormat.format(
MIPlugin.getResourceString( "src.GDBCDIDebugger2.2" ), new Integer[] { new
Integer( pid ) } ), e ); //$NON-NLS-1$
}
// @@@ We have to set the suspended state manually
miSession.getMIInferior().setSuspended();
miSession.getMIInferior().update();
Can some one explain this code ? It would be great if someone can explain
statement wise.
Moreover I observed that the code should work fine even if we comment
miSession.getMIInferior().setInferiorPID(pid);
miSession.getMIInferior().setConnected();
Similarly there is the following code for launching core debug session...
i.e...
protected void startCoreGDBSession( ILaunchConfiguration config, Session
session, IProgressMonitor monitor ) throws CoreException {
getMISession( session ).getMIInferior().setSuspended();
try {
session.getSharedLibraryManager().update();
}
catch( CDIException e ) {
throw newCoreException( e );
}
}
So, in startAttachGDBSession() we do miSession.getMInferior().update()..
But in startCoreGDBSession() we do
miSession.getSharedLibraryManager().update().
Can someone please explain the purpose of each of them.
Thanks & Regards,
Nayna Jain
Nexus Tools Development
Bangalore, India
Contact : 402-56859