Bug 15072 - [Reverse Debugging] if breakpoint present gdb does not send *stopped event when reverse-finish
Summary: [Reverse Debugging] if breakpoint present gdb does not send *stopped event wh...
Status: NEW
Alias: None
Product: gdb
Classification: Unclassified
Component: breakpoints (show other bugs)
Version: HEAD
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-28 12:16 UTC by velimir
Modified: 2013-04-24 06:40 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description velimir 2013-01-28 12:16:58 UTC
Hi,

it seems that GDB from version 7.4 until latest tested version 7.5.50.20130128 does not send *stopped event when there is a breakpoint on the calling function where the reverse-finish will end up.

Additional info can be found at: 
https://bugs.eclipse.org/bugs/show_bug.cgi?id=399103

Consider the following simple program:
======================================
 1 #include <iostream>
 2 using namespace std;
 3
 4 void my_func() {
 5   int a = 10;
 6   a++;
 7   cout << "a=" << a << endl;
 8   return;
 9 }
10
11 int main() {
12   cout << "!!!Hello World!!!" << endl;
13   my_func();
14   return 0;
15 }
======================================

How to reproduce it:
1. Start the debugging.
2. Set breakpoint at line 13.
3. Do "run"/"continue".
6. Do "step".
7. Do reverse-finish.

Here is the output of gdbTrace in Eclipse:
[please note the missing *stopped event in GDB 7.4]

With GDB 7.3:
=============
935,900 48-interpreter-exec --thread 1 --frame 0 console reverse-finish
935,901 ~"Run back to call of #0  my_func () at ../src/Test_Project.cpp:5\n"
935,903 48^running
935,903 *running,thread-id="all"
935,903 (gdb) 
935,903 *stopped
935,904 *running,thread-id="all"
935,904 ~"\nBreakpoint "
935,904 ~"1, main () at ../src/Test_Project.cpp:13\n"
935,906 ~"13\t\tmy_func();\n"
935,906 *stopped,frame={addr="0x00000000004020c2",func="main",args=[],file="../src/Test_Project.cpp",fullname="<PATH_TO_PROJECT/Test_Project/src/Test_Project.cpp",line="13"},thread-id="1",stopped-threads="all",core="2"
935,907 (gdb)
<BLABLABLA>

With GDB 7.4:
=============
104,131 50-interpreter-exec --thread 1 --frame 0 console reverse-finish
104,133 ~"Run back to call of #0  my_func () at ../src/Test_Project.cpp:5\n"
104,134 50^running
104,134 *running,thread-id="all"
104,134 (gdb) 
104,134 =breakpoint-modified,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x00000000004020c2",func="main()",file="../src/Test_Project.cpp",fullname="<PATH_TO_PROJECT>/test_project/Test_Project/src/Test_Project.cpp",line="13",times="2",original-location="<PATH_TO_PROJECT>/test_project/Test_Project/src/Test_Project.cpp:13"}
104,136 ~"\nBreakpoint "
104,136 ~"1, main () at ../src/Test_Project.cpp:13\n"
104,137 ~"13\t\tmy_func();\n"
104,137 (gdb)
Comment 1 Andreas Kaufmann 2013-04-18 13:56:45 UTC
The same problem happens if I use:
-exec-finish --reverse
Comment 2 Andreas Kaufmann 2013-04-24 06:40:26 UTC
Proposed patch to fix this issue:
http://sourceware.org/ml/gdb-patches/2013-04/msg00643.html