Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Issue with CDT CDI Debugger in Helios

Hi Marc,

I rechecked the values related to inferior.pid in both CDT 6.x (version for
which my code was working fine i.e. with Galileo) and CDT 7.x (for which it
is crashing both the eclipse i.e. in Helios)

Here are my observations:

1. Both has the similar values for PID i.e. 0 or -1 at the same time as I
went through their stack traces.
2. In both cases, suspend actually calls MIProcessAdapter.interrupt()
first.

However the code of MIProcessAdapter.interrupt() is different in CDT 6.x
and CDT 7.x version.
Below is the code snippet for each version

For CDT 6.x

public void interrupt (MIInferior inferior) {
    if  (fGDBProcess instanceof Spawner)  {
         if (inferior.isRunning())  {
              Spawner gdbSpawner = (Spawner) fGDBProcess;
              gdbSpawner.interrupt();
              waitForInterrupt(inferior);
         }
        // If we are still running try to drop the sig to the PID
        if  (inferior.isRunning() && inferior.getInferiorPID() > 0 ) {
              // lets try something else
              interruptInferior(inferior);
        }
     }
}


For CDT 7.x

public void interrupt (MIInferior inferior) {
     if  (fGDBProcess instanceof Spawner)  {
          if ( inferior.isRunning())   {
              Spawner gdbSpawner  = (Spawner)  fGDBProcess;
              if  ( inferior.isAttachedInferior()
&& !inferior.isRemoteInferior()) {
              // not all gdb versions forward the interrupt to an attached
              // local inferior, so interrupt the inferior directly.
              interruptInferior(inferior);
             }
            else {
            //  standard case (gdb launches process) and remote case
(gdbserver)
            gdbSpawner.interrupt();
           }
           waitForInterrupt(inferior);
         }
    }
}


Code for interruptInferior(MIInferior inferior) is same for both.

So, as you see there is change in the code in 7.x and looks like pid value
do not affect the decision in 7.x interrupt() method.
So, in case of 6.x  interruptInferior(...) is not getting called but in 7.x
interruptInferior(...) is getting called, at which point when raise() is
called, both eclipse instances are crashing.

I see on the console message as [Interrupt] . So, it looks like SIGINT is
going to both the eclipse processes.

Please explain the change and based on that what thing the user/client has
to take care in his code.

As such we had extended GDBCDIDebugger2  in which we create
MIProcessAdapter and MISession
And extended MISession class.

Let me know if there was supposed to be any change in using these classes
based on the change in the code of interrupt() ,method.

Thanks & Regards,
Nayna Jain
Nexus Tools Development
Bangalore, India
Contact : 402-56859



From:	Marc Khouzam <marc.khouzam@xxxxxxxxxxxx>
To:	"'CDT General developers list.'" <cdt-dev@xxxxxxxxxxx>
Cc:	"'cdt-dev-bounces@xxxxxxxxxxx'" <cdt-dev-bounces@xxxxxxxxxxx>
Date:	11/22/2012 12:40 AM
Subject:	Re: [cdt-dev] Issue with CDT CDI Debugger in Helios
Sent by:	cdt-dev-bounces@xxxxxxxxxxx




> -----Original Message-----
> From: cdt-dev-bounces@xxxxxxxxxxx
> [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Nayna Jain
> Sent: Wednesday, November 21, 2012 12:32 PM
> To: CDT General developers list.
> Cc: CDT General developers list.; cdt-dev-bounces@xxxxxxxxxxx
> Subject: Re: [cdt-dev] Issue with CDT CDI Debugger in Helios
>
> Hi Marc,
>
> Here are more details of the issue.
>
> The error is happening in the method interrupInferior() of
> MIProcessAdapter
> class.
>
> protected void interruptInferior(MIInferior inferior) {
>    if ( fGDBProcess instanceof Spawner) {
>         Spawner gdbSpawner = (Spawner) fGDBProcess;
>         gdbSpawner.raise(inferior.getInferiorPID(), gdbSpawner.INT);
>      }
> }
>
> So, as soon as it executes gdbSpawner.raise(...) method, it
> closes both the
> child and main eclipse without throwing any error.
> And I found that inferior.getInferiorPID() valud is always 0.
> Not sure what
> it is supposed to be as such.

The PID must be the process id of the program that is being
debugged.  Sending an INT signal to pid 0 sounds like it could
have dramatic consequences.  I don't even want to try it on
my shell :)

You should find out why you don't actually know the pid of
the inferior.  You could put a guard not to send the INT
singnal if the pid is 0 and confirm that your eclipse no
longer dies.

> I found that raise() method is native method in Spawner class
> so couldn't
> debug further.
>
> Let me know if this information is helpful and if you can
> provide on some
> information on the crashing of the eclipse because of this.
>
>
> Thanks & Regards,
> Nayna Jain
> Nexus Tools Development
> Bangalore, India
> Contact : 402-56859
>
>
>
> From:		 Nayna Jain/India/IBM@IBMIN
> To:		 "CDT General developers list." <cdt-dev@xxxxxxxxxxx>
> Date:		 11/20/2012 07:42 PM
> Subject:		 Re: [cdt-dev] Issue with CDT CDI Debugger in Helios
> Sent by:		 cdt-dev-bounces@xxxxxxxxxxx
>
>
>
> Hi Marc,
>
> Thanks for the inputs.
>
> Sure, I will try both the steps:
>
> #1. Different version of JVM or Eclipse
> #2. Isolate the problem bit more to give more details here.
>
> After that, shall get back to you.
>
>
> Thanks & Regards,
> Nayna Jain
> Nexus Tools Development
> Bangalore, India
> Contact : 402-56859
>
>
>
> From:		 		  Marc Khouzam <marc.khouzam@xxxxxxxxxxxx>
> To:		 		  "'CDT General developers list.'"
<cdt-dev@xxxxxxxxxxx>
> Date:		 		  11/20/2012 07:33 PM
> Subject:		 		  Re: [cdt-dev] Issue with CDT CDI
> Debugger in Helios
> Sent by:		 		  cdt-dev-bounces@xxxxxxxxxxx
>
>
>
>
> > -----Original Message-----
> > From: cdt-dev-bounces@xxxxxxxxxxx
> > [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Nayna Jain
> > Sent: Tuesday, November 20, 2012 4:40 AM
> > To: cdt-dev@xxxxxxxxxxx
> > Subject: [cdt-dev] Issue with CDT CDI Debugger in Helios
> >
> >
> > Hi all,
> >
> > We had created our own debug launch using Eclipse Platform
> and CDT CDI
> > debugger framework.
> >
> > Now as we are migrating to Helios, it is mentioned that the default
> > framework is DSF.
>
> That is true although CDI should keep working as before.
>
> > I  have following questions -
> >
> > #1. I have our own debug launch created. So, we have
> TestLaunchType in
> > DebugConfigurations with its tabs etc. And on debug, it has its own
> > ILaunchDelgate using ICDIDebugger interface. So, does it mean
> > that it is by
> > default using CDI interface now or do I need to do some
> > changes that it is
> > not calling some DSF code because DSF Is the default one
>
> CDI and DSF are kept separated and you should not get any of the
> DSF code running when using the CDI launch infrastructure.
> You can look at LocalCDILaunchDelegate to see if you are doing
> similar things.
>
> > #2. My Launch configuration tries to connect to remote target using
> > gdbserver running on remote system. The launch happens
> > correctly but as
> > soon as I click on Suspend button for any thread, eclipse
> (both child
> > eclipse with my plugins and my main eclipse) crashes without
> > throwing any
> > error on console or logs. Is it because of some mixing of
> CDI or DSF.
>
> Most probably not.  If it is the jvm that is crashing then I suggest
> trying another version of Java.  You could also try using the latest
> Eclipse release (Juno SR1).
>
> > Can someone give me some pointers on that what changes do
> > those users need
> > to do who have their plugins using CDI Framework and
> currently want to
> > continue on that. ?
>
> There theoretically should not be anything to do.  In practice though,
> we don't actively work on CDI so maybe a bug has slipped in
> and we didn't
> catch it.  You'd have to isolate the problem a bit more to give us a
> better idea of what is going on.
>
> BR,
>
> Marc
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/cdt-dev
>
>
>
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/cdt-dev
>
>
>
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/cdt-dev
>
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev





Back to the top