Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [python][obv] Make result in testsuite/gdb.python/py-breakpoints.c  global
@ 2010-04-12  9:58 Phil Muldoon
  2010-04-12 10:14 ` Phil Muldoon
  0 siblings, 1 reply; 2+ messages in thread
From: Phil Muldoon @ 2010-04-12  9:58 UTC (permalink / raw)
  To: gdb-patches ml

Pedro Alves noticed and brought to my attention on irc that one of the Python breakpoints test fails locally for him.  When I tested it locally, it worked ok for me.  So we investigated. Subsequently it was found (by Pedro, (thanks!) that the test was bogus.  The test was running to main and setting the watchpoint on 'result'. But 'result' was not initialized in the (main) code at this point.  So if 'result' happened to 0 the test would work (as it did for me); however as the inferior is at the main () line, equally 'result' could be any uninitialized value, and the test would fail. I fixed this by making 'result' global in the testcase. This ensures that 'result' is always at the expected value '0' at main.

I'm checking this in under the obvious rule.

Cheers,

Phil

--

2010-04-12  Phil Muldoon  <pmuldoon@redhat.com>

	* gdb.python/py-breakpoint.c: Make result global.

--

Index: testsuite/gdb.python/py-breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.python/py-breakpoint.c,v
retrieving revision 1.1
diff -r1.1 py-breakpoint.c
19a20
+ int result = 0;
36d36
-   int result = 0;


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

* Re: [python][obv] Make result in testsuite/gdb.python/py-breakpoints.c   global
  2010-04-12  9:58 [python][obv] Make result in testsuite/gdb.python/py-breakpoints.c global Phil Muldoon
@ 2010-04-12 10:14 ` Phil Muldoon
  0 siblings, 0 replies; 2+ messages in thread
From: Phil Muldoon @ 2010-04-12 10:14 UTC (permalink / raw)
  To: gdb-patches ml

On 04/12/2010 10:58 AM, Phil Muldoon wrote:
> 
> 2010-04-12  Phil Muldoon  <pmuldoon@redhat.com>
> 
> 	* gdb.python/py-breakpoint.c: Make result global.
>

This time with a proper patch attached!

--

Index: testsuite/gdb.python/py-breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.python/py-breakpoint.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- testsuite/gdb.python/py-breakpoint.c	9 Apr 2010 09:41:43 -0000	1.1
+++ testsuite/gdb.python/py-breakpoint.c	12 Apr 2010 09:49:35 -0000	1.2
@@ -17,6 +17,7 @@
 */
 
 
+int result = 0;
 
 int multiply (int i)
 {
@@ -33,7 +34,6 @@
 {
   int foo = 5;
   int bar = 42;
-  int result = 0;
   int i;
 
   for (i = 0; i < 10; i++)


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

end of thread, other threads:[~2010-04-12 10:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-12  9:58 [python][obv] Make result in testsuite/gdb.python/py-breakpoints.c global Phil Muldoon
2010-04-12 10:14 ` Phil Muldoon

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