| Summary: | Implement support for gdb targets with native reverse execution support | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | Kai Schuetz <kai.schuetz.eclipse> | ||||
| Component: | cdt-debug-dsf-gdb | Assignee: | Project Inbox <cdt-debug-dsf-gdb-inbox> | ||||
| Status: | NEW --- | QA Contact: | Jonah Graham <jonah> | ||||
| Severity: | enhancement | ||||||
| Priority: | P3 | CC: | pawel.1.piech | ||||
| Version: | 8.0 | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Kai Schuetz
From the cdt-dev mailing list: -----Original Message----- From: cdt-dev-bounces@eclipse.org [mailto:cdt-dev-bounces@eclipse.org] On Behalf Of Kai Schuetz Sent: Tuesday, August 31, 2010 6:07 AM To: CDT General developers list. Subject: Re: [cdt-dev] DSF-GDB: How to support targets which natively support reverse execution ? I’ve entered Bug 324069 <https://bugs.eclipse.org/bugs/show_bug.cgi?id=324069> for this. I was not able to find a gdb command to query if reverse execution is supported, at least not side-effect free. When issuing a command like reverse-step an error will occur if not supported, however this has a side-effect. For targets connected via the remote serial protocol there is the qSupported command telling if reverse stepping and continuation are supported. Since the used has to explicitly enable reverse execution in the CDT Debugger configuration tab maybe it’s not a problem to show the buttons, even if they will not work ? Kai (In reply to comment #1) > I was not able to find a gdb command to query if reverse execution is > supported, at least not side-effect free. When issuing a command like > reverse-step an error will occur if not supported, however this has a > side-effect. I played around a bit and found that this may work: > gdb.7.0 -i mi a.out (gdb) start (gdb) -gdb-set exec-direction reverse ^done (gdb) show exec-direction &"show exec-direction\n" ~"Forward.\n" ^done (gdb) -gdb-set exec-direction forward ^done I noticed a bug if we use -gdb-show instead of 'show', where it actually reports Reverse. So we must use 'show'. Can you try with your target and let me know if it reports Reverse properly? Process Record and Replay does. The trick here will be to decouple the reverse execution buttons from the toggle reverse button. How things work now is that the buttons only appear once the user has pressed on the toggle reverse button. What I think we should do is to try to make the buttons appear when a target supports reverse execution. We'll have to figure out when is the right time to ask the target about its support. Should be after the command to connect to a remote target, but maybe also after starting the execution of the program. I'm not sure what to do about the current 'toggle reverse debugging' button in that case. In DSF-GDB, that button is really tied to the 'record' command. Created attachment 177885 [details]
Un-finished prototype
I wrote the beginning of a prototype to illustrate what I had in mind.
Using -gdb-set exec-direction reverse may not prove as simple as I hoped. Using this command has no side-effects, only if the target is not currently running, so we have to be careful when we send it. In the case of non-stop mode, we may connect to a running target that will not be interrupted. So, we can't use this trick for non-stop. There may be no solution for non-stop, except to assume the target supports reverse, and then turn it off when the first reverse command fails. I've added a fix to GDB so that -list-target-features will show if reverse execution is supported on the current target. However, this fix will only be available starting with GDB 7.2. http://sourceware.org/ml/gdb-patches/2010-09/msg00053.html |