Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] How to issue a SuspendedEvent?

So I managed to get back to this. I've been chasing it for a day and I'm totally baffled on how to make this work. We're sending the suspended event, and it's being accepted down at StackFramesVMNode.buildDelta(), but nothing is refreshing. We're in a suspended debug session and then resetting the target's instruction pointer to 0xfffffff0 (reset vector), through a monitor command. If I send the ISuspendedDMEvent after the monitor command completes, then nothing happens. I was thinking that GDB hadn't refreshed information, so I issued createMIDataDisassemble and createMIStackListFrames to the command factory and got:

063,853 (gdb) 
063,901 26^done,asm_insns=[{address="0xffffffc1",inst="add    BYTE PTR [eax],al"},{address="0xffffff\
c3",inst="add    BYTE PTR [eax],al"},{address="0xffffffc5",inst="add    BYTE PTR [eax],al"},{address\
="0xffffffc7",inst="add    BYTE PTR [eax],al"},{address="0xffffffc9",inst="add    BYTE PTR [eax],al"\
},{address="0xffffffcb",inst="add    BYTE PTR [eax],al"},{address="0xffffffcd",inst="add    BYTE PTR\
 [eax],al"},{address="0xffffffcf",inst="add    BYTE PTR [eax],al"},{address="0xffffffd1",inst="add  \
  BYTE PTR [eax],al"},{address="0xffffffd3",inst="add    BYTE PTR [eax],al"},{address="0xffffffd5",i\
nst="inc    ecx"},{address="0xffffffd6",inst="dec    ebp"},{address="0xffffffd7",inst="inc    esp"},\
{address="0xffffffd8",inst="add    BYTE PTR [eax+0x65],dl"},{address="0xffffffdb",inst="jb     0x50"\
},{address="0xffffffdd",inst="imul   ebp,DWORD PTR [ebp+0x6d],0x2a006e6f"},{address="0xffffffe4",ins\
t="add    BYTE PTR [eax],al"},{address="0xffffffe6",inst="add    BYTE PTR [esi],ah"},{address="0xfff\
fffe8",inst="add    BYTE PTR [eax],al"},{address="0xffffffea",inst="add    BYTE PTR [eax],al"},{addr\
ess="0xffffffec",inst="add    BYTE PTR [eax+0x41e90000],al"}]
063,903 (gdb) 
063,904 27^done,stack=[frame={level="0",addr="0x0010237d",func="??"},frame={level="1",addr="0x001014\
17",func="??"}]
063,904 (gdb) 
082,697 28-gdb-exit
082,703 28^exit
082,704 =thread-exited,id="1",group-id="i1"
082,705 =thread-group-exited,id="i1"

from GDB traces. I notice here that the disassembly and the stack pointers are out of sync. However, even if I issue a suspended event after this, it still gets to StackFramesVMNode.buildDelta() and calls buildDeltaForSuspendedEvent. So, it's not a matter of the signal passing right, but I have no idea what's going wrong here. Essentially, I'd like to put the target in reset and then update the UI to show disassembly at fffffff0, but I just can't figure out what the sequence needs to be. Any help would be great.
Thanks,
Jason

----- Original Message -----
From: "Marc Khouzam" <marc.khouzam@xxxxxxxxxxxx>
To: "CDT General developers list." <cdt-dev@xxxxxxxxxxx>
Sent: Tuesday, April 3, 2012 8:33:50 AM
Subject: Re: [cdt-dev] How to issue a SuspendedEvent?

> -----Original Message-----
> From: cdt-dev-bounces@xxxxxxxxxxx 
> [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Jason Litton
> Sent: Monday, April 02, 2012 5:10 PM
> To: CDT General developers list.
> Subject: Re: [cdt-dev] How to issue a SuspendedEvent?
> 
> I didn't get that to work on first try. It's throwing a null 
> pointer on context. I was trying to recast the DMContext, 
> though, which didn't work. I'll be getting back to it in a 
> couple days (just playing catch-up now, as I'm sure many of 
> us are doing). But what's the best way to get the 
> IExecutionDMContext needed in the constructor of the extending class?

I guess it depends on what you are trying to do.
The IExecutionDMContext contained in the ISuspendedDMEvent indicates
which thread or process just got suspended.  If you don't have a
thread or process in your case, then maybe using an ISuspendedDMEvent
is not the best way to go.  

You can have a look at StackFramesVMNode.buildDelta() or
StackFramesVMNode.getDeltaFlags() to see how the stack frames
are refreshed based on different events that are received.

You can see if any event fits the behavior you are trying to
achieve.  If not, you may choose to definea new event altogether
to notify the views that something happened that requires an
update.

Marc 

> ----- Original Message -----
> From: "Marc Khouzam" <marc.khouzam@xxxxxxxxxxxx>
> To: "CDT General developers list." <cdt-dev@xxxxxxxxxxx>
> Sent: Monday, April 2, 2012 9:49:45 AM
> Subject: Re: [cdt-dev] How to issue a SuspendedEvent?
> 
> > -----Original Message-----
> > From: cdt-dev-bounces@xxxxxxxxxxx 
> > [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Jason Litton
> > Sent: Monday, April 02, 2012 11:30 AM
> > To: CDT General developers list.
> > Subject: [cdt-dev] How to issue a SuspendedEvent?
> > 
> > Hi all,
> > I spoke with Marc a bit at the CDT Summit about this, but 
> > looking at the code, I can't figure out how to make it work. 
> > I'm trying to force a stackframe update after issuing a 
> > command through an AbstractMIControl. Marc said that I would 
> > need to issue a SuspendedEvent, but I only see those as inner 
> > classes.  So, how do I issue a new SuspendedEvent so that the 
> > stackframes will update? And who does it go to?
> 
> Yes, the Suspended events are part of the RunControl service.
> If you want to send an ISuspendedDMEvent for some other reason,
> you can create a new class that implements ISuspendedDMEvent
> and dispatch it using the DSF session.
> 
> The ISuspendedDMEvent is being listen for in different places
> where the UI will then be updated.
> 
> Hope this helps
> 
> 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


Back to the top