Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] PR 15520 - GDB step command crashed on non-stop mode
@ 2013-09-16  8:11 Muhammad Waqas
  2013-09-17  7:19 ` Agovic, Sanimir
  0 siblings, 1 reply; 6+ messages in thread
From: Muhammad Waqas @ 2013-09-16  8:11 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 4556 bytes --]

Hi!

In adjust_pc_after_break

if (singlestep_breakpoints_inserted_p
	  || !ptid_equal (ecs->ptid, inferior_ptid)
	  || !currently_stepping (ecs->event_thread)
	  || ecs->event_thread->prev_pc == breakpoint_pc)
	regcache_write_pc (regcache, breakpoint_pc);

We should check for breakpoint_pc is software_breakpoint (
as here we only consider it is software breakpoint that is not enough
in my thoughts) which is missing right now and it keep executing
again and again the same instruction until the breakpoint is ripped
off the moribund list and our program crashed if breakpoint is not
software.

I place this check and this fix the bug. What's your thought is it ok?
Tested on x86_64-Ubuntu-linux-gnu, no regressions.

Find the patch in attachment as well.

gdb/ChangeLog
2013-09-13  Muhammad Waqas  <mwaqas@codesourcery.com>

	PR 15520
	* infrun.c (adjust_pc_after_break): In non-stop mode
	verify software_breakpoint at breakpoint_pc before backup
	to breakpoint address.

gdb.base/ChangeLog
2013-09-13  Muhammad Waqas  <mwaqas@codesourcery.com>

	PR 15520
	*gdb.base/pr15520.cc: New file.
	*gdb.base/pr15520.exp: New file.

Index: infrun.c
===================================================================
RCS file: /cvs/src/src/gdb/infrun.c,v
retrieving revision 1.590
diff -u -p -r1.590 infrun.c
--- infrun.c	3 Sep 2013 17:22:45 -0000	1.590
+++ infrun.c	16 Sep 2013 08:06:02 -0000
@@ -3038,7 +3038,8 @@ adjust_pc_after_break (struct execution_
       if (singlestep_breakpoints_inserted_p
 	  || !ptid_equal (ecs->ptid, inferior_ptid)
 	  || !currently_stepping (ecs->event_thread)
-	  || ecs->event_thread->prev_pc == breakpoint_pc)
+	  || (ecs->event_thread->prev_pc == breakpoint_pc
+	      && software_breakpoint_inserted_here_p (aspace, breakpoint_pc)))
 	regcache_write_pc (regcache, breakpoint_pc);

       do_cleanups (old_cleanups);
Index: testsuite/gdb.base/pr15520.cc
===================================================================
RCS file: testsuite/gdb.base/pr15520.cc
diff -N testsuite/gdb.base/pr15520.cc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ testsuite/gdb.base/pr15520.cc	16 Sep 2013 08:06:03 -0000
@@ -0,0 +1,33 @@
+# Copyright 2013 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+#include <string>
+using namespace std;
+
+void
+fun (string &str1, string &str2)
+{
+  str1 += str2;
+}
+
+int
+main (void)
+{
+  string str1 = "abc";
+  string str2 = "def";
+  fun(str1,str2);
+
+  return 0;
+}
Index: testsuite/gdb.base/pr15520.exp
===================================================================
RCS file: testsuite/gdb.base/pr15520.exp
diff -N testsuite/gdb.base/pr15520.exp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ testsuite/gdb.base/pr15520.exp	16 Sep 2013 08:06:03 -0000
@@ -0,0 +1,36 @@
+# Copyright 2013 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+#
+# test running programs
+#
+standard_testfile .cc
+
+if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
+    return -1
+}
+
+if ![runto_main] {
+    untested non-stop-step
+    return -1
+}
+
+gdb_test "set target-async on" ".*" "Set async mode"
+gdb_test "set non-stop on" ".*" "Set non stop mode"
+
+gdb_breakpoint "fun"
+gdb_continue_to_breakpoint "fun"
+gdb_test "step" ".*}.*" "step 1"
+gdb_test "step" ".*main .*$srcfile.*\[\n\r\].*return 0;.*" "step 2"

[-- Attachment #2: diff --]
[-- Type: text/plain, Size: 3428 bytes --]

Index: infrun.c
===================================================================
RCS file: /cvs/src/src/gdb/infrun.c,v
retrieving revision 1.590
diff -u -p -r1.590 infrun.c
--- infrun.c	3 Sep 2013 17:22:45 -0000	1.590
+++ infrun.c	16 Sep 2013 08:06:02 -0000
@@ -3038,7 +3038,8 @@ adjust_pc_after_break (struct execution_
       if (singlestep_breakpoints_inserted_p
 	  || !ptid_equal (ecs->ptid, inferior_ptid)
 	  || !currently_stepping (ecs->event_thread)
-	  || ecs->event_thread->prev_pc == breakpoint_pc)
+	  || (ecs->event_thread->prev_pc == breakpoint_pc
+	      && software_breakpoint_inserted_here_p (aspace, breakpoint_pc)))
 	regcache_write_pc (regcache, breakpoint_pc);
 
       do_cleanups (old_cleanups);
Index: testsuite/gdb.base/pr15520.cc
===================================================================
RCS file: testsuite/gdb.base/pr15520.cc
diff -N testsuite/gdb.base/pr15520.cc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ testsuite/gdb.base/pr15520.cc	16 Sep 2013 08:06:03 -0000
@@ -0,0 +1,33 @@
+# Copyright 2013 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+#include <string>
+using namespace std;
+
+void
+fun (string &str1, string &str2)
+{
+  str1 += str2;
+}
+
+int
+main (void)
+{
+  string str1 = "abc";
+  string str2 = "def";
+  fun(str1,str2);
+
+  return 0;
+}
Index: testsuite/gdb.base/pr15520.exp
===================================================================
RCS file: testsuite/gdb.base/pr15520.exp
diff -N testsuite/gdb.base/pr15520.exp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ testsuite/gdb.base/pr15520.exp	16 Sep 2013 08:06:03 -0000
@@ -0,0 +1,36 @@
+# Copyright 2013 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+#
+# test running programs
+#
+standard_testfile .cc
+
+if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
+    return -1
+}
+
+if ![runto_main] {
+    untested non-stop-step
+    return -1
+}
+
+gdb_test "set target-async on" ".*" "Set async mode"
+gdb_test "set non-stop on" ".*" "Set non stop mode"
+
+gdb_breakpoint "fun"
+gdb_continue_to_breakpoint "fun"
+gdb_test "step" ".*}.*" "step 1"
+gdb_test "step" ".*main .*$srcfile.*\[\n\r\].*return 0;.*" "step 2"

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH] PR 15520 - GDB step command crashed on non-stop mode
  2013-09-16  8:11 [PATCH] PR 15520 - GDB step command crashed on non-stop mode Muhammad Waqas
@ 2013-09-17  7:19 ` Agovic, Sanimir
  2013-09-17  7:59   ` Muhammad Waqas
  0 siblings, 1 reply; 6+ messages in thread
From: Agovic, Sanimir @ 2013-09-17  7:19 UTC (permalink / raw)
  To: 'Muhammad Waqas'; +Cc: gdb-patches

Hello Muhammad,

I looked at the test only as I lack knowledge about the stepping/breakpoint algorithm.

A single comment below.

> -----Original Message-----
> From: gdb-patches-owner@sourceware.org [mailto:gdb-patches-owner@sourceware.org] On Behalf
> Of Muhammad Waqas
> Sent: Monday, September 16, 2013 10:11 AM
> To: gdb-patches@sourceware.org
> Subject: [PATCH] PR 15520 - GDB step command crashed on non-stop mode
> 
> Index: testsuite/gdb.base/pr15520.exp
> ===================================================================
> RCS file: testsuite/gdb.base/pr15520.exp
> diff -N testsuite/gdb.base/pr15520.exp
> --- /dev/null	1 Jan 1970 00:00:00 -0000
> +++ testsuite/gdb.base/pr15520.exp	16 Sep 2013 08:06:03 -0000
> @@ -0,0 +1,36 @@
>[...]
> +
> +if ![runto_main] {
> +    untested non-stop-step
> +    return -1
> +}
> +
> +gdb_test "set target-async on" ".*" "Set async mode"
> +gdb_test "set non-stop on" ".*" "Set non stop mode"
>
Use gdb_test_no_output instead of gdb_test.

 -Sanimir
Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen, Deutschland
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Christian Lamprechter, Hannes Schwaderer, Douglas Lusk
Registergericht: Muenchen HRB 47456
Ust.-IdNr./VAT Registration No.: DE129385895
Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] PR 15520 - GDB step command crashed on non-stop mode
  2013-09-17  7:19 ` Agovic, Sanimir
@ 2013-09-17  7:59   ` Muhammad Waqas
  2013-09-20 12:08     ` Muhammad Waqas
  2013-11-07 15:14     ` Tom Tromey
  0 siblings, 2 replies; 6+ messages in thread
From: Muhammad Waqas @ 2013-09-17  7:59 UTC (permalink / raw)
  To: Agovic, Sanimir; +Cc: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 4261 bytes --]

On 09/17/2013 12:19 PM, Agovic, Sanimir wrote:
> Hello Muhammad,
> 
> I looked at the test only as I lack knowledge about the stepping/breakpoint algorithm.
> 
> A single comment below.
> 
Thanks.
> Use gdb_test_no_output instead of gdb_test.

Fixed it.

Also I updated pr15520.cc. In this unintentionally I used # for
comments, I correct it as well.
Find Patch in attachment as well.
gdb/ChangeLog
2013-09-13  Muhammad Waqas  <mwaqas@codesourcery.com>

	PR 15520
	* infrun.c (adjust_pc_after_break): In non-stop mode
	verify software_breakpoint at breakpoint_pc before backup
	to breakpoint address.

gdb.base/ChangeLog
2013-09-13  Muhammad Waqas  <mwaqas@codesourcery.com>

	PR 15520
	*gdb.base/pr15520.cc: New file.
	*gdb.base/pr15520.exp: New file.

Index: infrun.c
===================================================================
RCS file: /cvs/src/src/gdb/infrun.c,v
retrieving revision 1.590
diff -u -p -r1.590 infrun.c
--- infrun.c	3 Sep 2013 17:22:45 -0000	1.590
+++ infrun.c	17 Sep 2013 07:51:11 -0000
@@ -3038,7 +3038,8 @@ adjust_pc_after_break (struct execution_
       if (singlestep_breakpoints_inserted_p
 	  || !ptid_equal (ecs->ptid, inferior_ptid)
 	  || !currently_stepping (ecs->event_thread)
-	  || ecs->event_thread->prev_pc == breakpoint_pc)
+	  || (ecs->event_thread->prev_pc == breakpoint_pc
+	      && software_breakpoint_inserted_here_p (aspace, breakpoint_pc)))
 	regcache_write_pc (regcache, breakpoint_pc);

       do_cleanups (old_cleanups);
Index: testsuite/gdb.base/pr15520.cc
===================================================================
RCS file: testsuite/gdb.base/pr15520.cc
diff -N testsuite/gdb.base/pr15520.cc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ testsuite/gdb.base/pr15520.cc	17 Sep 2013 07:51:12 -0000
@@ -0,0 +1,34 @@
+/* This testcase is part of GDB, the GNU debugger.
+   Copyright 2012-2013 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see
<http://www.gnu.org/licenses/>.  */
+
+#include <string>
+using namespace std;
+
+void
+fun (string &str1, string &str2)
+{
+  str1 += str2;
+}
+
+int
+main (void)
+{
+  string str1 = "abc";
+  string str2 = "def";
+  fun(str1,str2);
+
+  return 0;
+}
Index: testsuite/gdb.base/pr15520.exp
===================================================================
RCS file: testsuite/gdb.base/pr15520.exp
diff -N testsuite/gdb.base/pr15520.exp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ testsuite/gdb.base/pr15520.exp	17 Sep 2013 07:51:12 -0000
@@ -0,0 +1,36 @@
+# Copyright 2013 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+#
+# test running programs
+#
+standard_testfile .cc
+
+if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
+    return -1
+}
+
+gdb_test_no_output "set target-async on" "set async mode"
+gdb_test_no_output "set non-stop on" "set non-stop mode"
+
+if ![runto_main] {
+    untested non-stop-step
+    return -1
+}
+
+gdb_breakpoint "fun"
+gdb_continue_to_breakpoint "fun"
+gdb_test "step" ".*}.*" "step 1"
+gdb_test "step" ".*main .*$srcfile.*\[\n\r\].*return 0;.*" "step 2"

[-- Attachment #2: diff --]
[-- Type: text/plain, Size: 3508 bytes --]

Index: infrun.c
===================================================================
RCS file: /cvs/src/src/gdb/infrun.c,v
retrieving revision 1.590
diff -u -p -r1.590 infrun.c
--- infrun.c	3 Sep 2013 17:22:45 -0000	1.590
+++ infrun.c	17 Sep 2013 07:51:11 -0000
@@ -3038,7 +3038,8 @@ adjust_pc_after_break (struct execution_
       if (singlestep_breakpoints_inserted_p
 	  || !ptid_equal (ecs->ptid, inferior_ptid)
 	  || !currently_stepping (ecs->event_thread)
-	  || ecs->event_thread->prev_pc == breakpoint_pc)
+	  || (ecs->event_thread->prev_pc == breakpoint_pc
+	      && software_breakpoint_inserted_here_p (aspace, breakpoint_pc)))
 	regcache_write_pc (regcache, breakpoint_pc);
 
       do_cleanups (old_cleanups);
Index: testsuite/gdb.base/pr15520.cc
===================================================================
RCS file: testsuite/gdb.base/pr15520.cc
diff -N testsuite/gdb.base/pr15520.cc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ testsuite/gdb.base/pr15520.cc	17 Sep 2013 07:51:12 -0000
@@ -0,0 +1,34 @@
+/* This testcase is part of GDB, the GNU debugger.
+   Copyright 2012-2013 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#include <string>
+using namespace std;
+
+void
+fun (string &str1, string &str2)
+{
+  str1 += str2;
+}
+
+int
+main (void)
+{
+  string str1 = "abc";
+  string str2 = "def";
+  fun(str1,str2);
+
+  return 0;
+}
Index: testsuite/gdb.base/pr15520.exp
===================================================================
RCS file: testsuite/gdb.base/pr15520.exp
diff -N testsuite/gdb.base/pr15520.exp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ testsuite/gdb.base/pr15520.exp	17 Sep 2013 07:51:12 -0000
@@ -0,0 +1,36 @@
+# Copyright 2013 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+#
+# test running programs
+#
+standard_testfile .cc
+
+if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
+    return -1
+}
+
+gdb_test_no_output "set target-async on" "set async mode"
+gdb_test_no_output "set non-stop on" "set non-stop mode"
+
+if ![runto_main] {
+    untested non-stop-step
+    return -1
+}
+
+gdb_breakpoint "fun"
+gdb_continue_to_breakpoint "fun"
+gdb_test "step" ".*}.*" "step 1"
+gdb_test "step" ".*main .*$srcfile.*\[\n\r\].*return 0;.*" "step 2"

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] PR 15520 - GDB step command crashed on non-stop mode
  2013-09-17  7:59   ` Muhammad Waqas
@ 2013-09-20 12:08     ` Muhammad Waqas
  2013-10-07 11:32       ` Muhammad Waqas
  2013-11-07 15:14     ` Tom Tromey
  1 sibling, 1 reply; 6+ messages in thread
From: Muhammad Waqas @ 2013-09-20 12:08 UTC (permalink / raw)
  To: gdb-patches

On 09/17/2013 12:59 PM, Muhammad Waqas wrote:
> On 09/17/2013 12:19 PM, Agovic, Sanimir wrote:
>> Hello Muhammad,
>>
>> I looked at the test only as I lack knowledge about the stepping/breakpoint algorithm.
>>
>> A single comment below.
>>
> Thanks.
>> Use gdb_test_no_output instead of gdb_test.
> 
> Fixed it.
> 
> Also I updated pr15520.cc. In this unintentionally I used # for
> comments, I correct it as well.
> Find Patch in attachment as well.
> gdb/ChangeLog
> 2013-09-13  Muhammad Waqas  <mwaqas@codesourcery.com>
> 
> 	PR 15520
> 	* infrun.c (adjust_pc_after_break): In non-stop mode
> 	verify software_breakpoint at breakpoint_pc before backup
> 	to breakpoint address.
> 
> gdb.base/ChangeLog
> 2013-09-13  Muhammad Waqas  <mwaqas@codesourcery.com>
> 
> 	PR 15520
> 	*gdb.base/pr15520.cc: New file.
> 	*gdb.base/pr15520.exp: New file.
> 
> Index: infrun.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/infrun.c,v
> retrieving revision 1.590
> diff -u -p -r1.590 infrun.c
> --- infrun.c	3 Sep 2013 17:22:45 -0000	1.590
> +++ infrun.c	17 Sep 2013 07:51:11 -0000
> @@ -3038,7 +3038,8 @@ adjust_pc_after_break (struct execution_
>        if (singlestep_breakpoints_inserted_p
>  	  || !ptid_equal (ecs->ptid, inferior_ptid)
>  	  || !currently_stepping (ecs->event_thread)
> -	  || ecs->event_thread->prev_pc == breakpoint_pc)
> +	  || (ecs->event_thread->prev_pc == breakpoint_pc
> +	      && software_breakpoint_inserted_here_p (aspace, breakpoint_pc)))
>  	regcache_write_pc (regcache, breakpoint_pc);
> 
>        do_cleanups (old_cleanups);
> Index: testsuite/gdb.base/pr15520.cc
> ===================================================================
> RCS file: testsuite/gdb.base/pr15520.cc
> diff -N testsuite/gdb.base/pr15520.cc
> --- /dev/null	1 Jan 1970 00:00:00 -0000
> +++ testsuite/gdb.base/pr15520.cc	17 Sep 2013 07:51:12 -0000
> @@ -0,0 +1,34 @@
> +/* This testcase is part of GDB, the GNU debugger.
> +   Copyright 2012-2013 Free Software Foundation, Inc.
> +
> +   This program is free software; you can redistribute it and/or modify
> +   it under the terms of the GNU General Public License as published by
> +   the Free Software Foundation; either version 3 of the License, or
> +   (at your option) any later version.
> +
> +   This program is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +   GNU General Public License for more details.
> +
> +   You should have received a copy of the GNU General Public License
> +   along with this program.  If not, see
> <http://www.gnu.org/licenses/>.  */
> +
> +#include <string>
> +using namespace std;
> +
> +void
> +fun (string &str1, string &str2)
> +{
> +  str1 += str2;
> +}
> +
> +int
> +main (void)
> +{
> +  string str1 = "abc";
> +  string str2 = "def";
> +  fun(str1,str2);
> +
> +  return 0;
> +}
> Index: testsuite/gdb.base/pr15520.exp
> ===================================================================
> RCS file: testsuite/gdb.base/pr15520.exp
> diff -N testsuite/gdb.base/pr15520.exp
> --- /dev/null	1 Jan 1970 00:00:00 -0000
> +++ testsuite/gdb.base/pr15520.exp	17 Sep 2013 07:51:12 -0000
> @@ -0,0 +1,36 @@
> +# Copyright 2013 Free Software Foundation, Inc.
> +
> +# This program is free software; you can redistribute it and/or modify
> +# it under the terms of the GNU General Public License as published by
> +# the Free Software Foundation; either version 3 of the License, or
> +# (at your option) any later version.
> +#
> +# This program is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program.  If not, see <http://www.gnu.org/licenses/>.
> +
> +#
> +# test running programs
> +#
> +standard_testfile .cc
> +
> +if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
> +    return -1
> +}
> +
> +gdb_test_no_output "set target-async on" "set async mode"
> +gdb_test_no_output "set non-stop on" "set non-stop mode"
> +
> +if ![runto_main] {
> +    untested non-stop-step
> +    return -1
> +}
> +
> +gdb_breakpoint "fun"
> +gdb_continue_to_breakpoint "fun"
> +gdb_test "step" ".*}.*" "step 1"
> +gdb_test "step" ".*main .*$srcfile.*\[\n\r\].*return 0;.*" "step 2"
> 
ping


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] PR 15520 - GDB step command crashed on non-stop mode
  2013-09-20 12:08     ` Muhammad Waqas
@ 2013-10-07 11:32       ` Muhammad Waqas
  0 siblings, 0 replies; 6+ messages in thread
From: Muhammad Waqas @ 2013-10-07 11:32 UTC (permalink / raw)
  To: gdb-patches

ping


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] PR 15520 - GDB step command crashed on non-stop mode
  2013-09-17  7:59   ` Muhammad Waqas
  2013-09-20 12:08     ` Muhammad Waqas
@ 2013-11-07 15:14     ` Tom Tromey
  1 sibling, 0 replies; 6+ messages in thread
From: Tom Tromey @ 2013-11-07 15:14 UTC (permalink / raw)
  To: Muhammad Waqas; +Cc: Agovic, Sanimir, gdb-patches

>>>>> ">" == Muhammad Waqas <mwaqas@codesourcery.com> writes:

>> 2013-09-13  Muhammad Waqas  <mwaqas@codesourcery.com>

>> 	PR 15520

It's more usual to use the component in here as well.
I'm not sure whether the commit script's regex will match the above.
So it would be:

	PR threads/15520

>> 	*gdb.base/pr15520.cc: New file.
>> 	*gdb.base/pr15520.exp: New file.

Two notes here.

First, space after the "*".

Second, we generally don't use the PR number in the test case file names.
Instead we try to use a descriptive name.

I don't fully understand the fix itself.
Maybe you could walk me through it.

Tom


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-11-07 15:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-16  8:11 [PATCH] PR 15520 - GDB step command crashed on non-stop mode Muhammad Waqas
2013-09-17  7:19 ` Agovic, Sanimir
2013-09-17  7:59   ` Muhammad Waqas
2013-09-20 12:08     ` Muhammad Waqas
2013-10-07 11:32       ` Muhammad Waqas
2013-11-07 15:14     ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox