Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [patch] callfuncs.exp: set unwindonsignal on
@ 2012-09-14 22:34 dje
  2012-09-15  7:40 ` Yao Qi
  0 siblings, 1 reply; 3+ messages in thread
From: dje @ 2012-09-14 22:34 UTC (permalink / raw)
  To: gdb-patches

Hi.

Testing cvs head with i686 binaries and 64-bit gdb has this failure:
FAIL: gdb.base/callfuncs.exp: gdb function calls preserve register contents
[I'm guessing the same failure will be seen with 32-bit native.]

The problem is that these tests segv (and are marked KFAIL),
but the stack isn't unwound.

	setup_kfail_for_target gdb/12783 "i?86-*-*"
	setup_kfail_for_target gdb/12796 "x86_64-*-*"
	gdb_test "p t_structs_dc(struct_val1)" ".*= 4 \\+ 4 \\* I" \
	    "call inferior func with struct - returns double _Complex"

	setup_kfail_for_target gdb/12783 "i?86-*-*"
	setup_kfail_for_target gdb/12796 "x86_64-*-*"
	gdb_test "p t_structs_ldc(struct_val1)" "= 5 \\+ 5 \\* I" \
	    "call inferior func with struct - returns long double _Complex"

I don't see a problem with setting unwindonsignal - failure to produce
the expected result will still be caught.
And if any test modifies the original register values, that'll still be
caught too.

I'll check this in in a few days if there are no objections.

2012-09-14  Doug Evans  <dje@google.com>

	* gdb.base/callfuncs.exp (do_function_calls): Set unwindonsignal to on
	while running the tests.

Index: callfuncs.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/callfuncs.exp,v
retrieving revision 1.52
diff -u -p -r1.52 callfuncs.exp
--- callfuncs.exp	9 Jul 2012 14:20:52 -0000	1.52
+++ callfuncs.exp	14 Sep 2012 22:29:09 -0000
@@ -65,6 +65,10 @@ proc do_function_calls {} {
     # We need to up this because this can be really slow on some boards.
     set timeout 60;
 
+    # If any of these calls segv we don't want to affect subsequent tests.
+    # E.g., we want to ensure register values are restored.
+    gdb_test_no_output "set unwindonsignal on"
+
     gdb_test "p t_char_values(0,0)" " = 0"
     gdb_test "p t_char_values('a','b')" " = 1"
     gdb_test "p t_char_values(char_val1,char_val2)" " = 1"
@@ -259,6 +263,9 @@ proc do_function_calls {} {
 
     gdb_test "p t_structs_a(struct_val1)" "= (.unsigned char .. )?<buf.*> \"foo\"" \
     	"call inferior func with struct - returns char *"
+
+    # Restore default value.
+    gdb_test_no_output "set unwindonsignal off"
 }
 
 # Procedure to get current content of all registers.


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

* Re: [patch] callfuncs.exp: set unwindonsignal on
  2012-09-14 22:34 [patch] callfuncs.exp: set unwindonsignal on dje
@ 2012-09-15  7:40 ` Yao Qi
  2012-09-20 14:55   ` Doug Evans
  0 siblings, 1 reply; 3+ messages in thread
From: Yao Qi @ 2012-09-15  7:40 UTC (permalink / raw)
  To: dje; +Cc: gdb-patches

On 09/15/2012 06:34 AM, dje@google.com wrote:
> Hi.
>
> Testing cvs head with i686 binaries and 64-bit gdb has this failure:
> FAIL: gdb.base/callfuncs.exp: gdb function calls preserve register contents
> [I'm guessing the same failure will be seen with 32-bit native.]
>

This fail was introduced by my patch (sorry),

   [_Complex test 4/4] _Complex tests in callfuncs.exp
   http://sourceware.org/ml/gdb-patches/2011-05/msg00421.html

and it exists on 32-bit native.

>
> Index: callfuncs.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.base/callfuncs.exp,v
> retrieving revision 1.52
> diff -u -p -r1.52 callfuncs.exp
> --- callfuncs.exp	9 Jul 2012 14:20:52 -0000	1.52
> +++ callfuncs.exp	14 Sep 2012 22:29:09 -0000
> @@ -65,6 +65,10 @@ proc do_function_calls {} {
>       # We need to up this because this can be really slow on some boards.
>       set timeout 60;
>
> +    # If any of these calls segv we don't want to affect subsequent tests.
> +    # E.g., we want to ensure register values are restored.
> +    gdb_test_no_output "set unwindonsignal on"
> +
>       gdb_test "p t_char_values(0,0)" " = 0"
>       gdb_test "p t_char_values('a','b')" " = 1"
>       gdb_test "p t_char_values(char_val1,char_val2)" " = 1"
> @@ -259,6 +263,9 @@ proc do_function_calls {} {
>
>       gdb_test "p t_structs_a(struct_val1)" "= (.unsigned char .. )?<buf.*> \"foo\"" \
>       	"call inferior func with struct - returns char *"
> +
> +    # Restore default value.
> +    gdb_test_no_output "set unwindonsignal off"

The patch looks right to me.  Nitpicking, do we store the original value 
of 'unwindonsignal', and restore it here?  I am wondering people may run 
testsuite with 'unwindonsignal' on in default?

>   }
>
>   # Procedure to get current content of all registers.
>


-- 
Yao


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

* Re: [patch] callfuncs.exp: set unwindonsignal on
  2012-09-15  7:40 ` Yao Qi
@ 2012-09-20 14:55   ` Doug Evans
  0 siblings, 0 replies; 3+ messages in thread
From: Doug Evans @ 2012-09-20 14:55 UTC (permalink / raw)
  To: Yao Qi; +Cc: gdb-patches

On Sat, Sep 15, 2012 at 12:39 AM, Yao Qi <yao@codesourcery.com> wrote:
> On 09/15/2012 06:34 AM, dje@google.com wrote:
>>
>> Hi.
>>
>> Testing cvs head with i686 binaries and 64-bit gdb has this failure:
>> FAIL: gdb.base/callfuncs.exp: gdb function calls preserve register
>> contents
>> [I'm guessing the same failure will be seen with 32-bit native.]
>>
>
> This fail was introduced by my patch (sorry),
>
>   [_Complex test 4/4] _Complex tests in callfuncs.exp
>   http://sourceware.org/ml/gdb-patches/2011-05/msg00421.html
>
> and it exists on 32-bit native.

No worries.

>>
>> Index: callfuncs.exp
>> ===================================================================
>> RCS file: /cvs/src/src/gdb/testsuite/gdb.base/callfuncs.exp,v
>> retrieving revision 1.52
>> diff -u -p -r1.52 callfuncs.exp
>> --- callfuncs.exp       9 Jul 2012 14:20:52 -0000       1.52
>> +++ callfuncs.exp       14 Sep 2012 22:29:09 -0000
>> @@ -65,6 +65,10 @@ proc do_function_calls {} {
>>       # We need to up this because this can be really slow on some boards.
>>       set timeout 60;
>>
>> +    # If any of these calls segv we don't want to affect subsequent
>> tests.
>> +    # E.g., we want to ensure register values are restored.
>> +    gdb_test_no_output "set unwindonsignal on"
>> +
>>       gdb_test "p t_char_values(0,0)" " = 0"
>>       gdb_test "p t_char_values('a','b')" " = 1"
>>       gdb_test "p t_char_values(char_val1,char_val2)" " = 1"
>> @@ -259,6 +263,9 @@ proc do_function_calls {} {
>>
>>       gdb_test "p t_structs_a(struct_val1)" "= (.unsigned char ..
>> )?<buf.*> \"foo\"" \
>>         "call inferior func with struct - returns char *"
>> +
>> +    # Restore default value.
>> +    gdb_test_no_output "set unwindonsignal off"
>
>
> The patch looks right to me.  Nitpicking, do we store the original value of
> 'unwindonsignal', and restore it here?  I am wondering people may run
> testsuite with 'unwindonsignal' on in default?

Thanks, committed.

Changing of settings only applies for the duration of each .exp file
as gdb is restarted for each one.
Here I think it's ok, at least for the test as is - if someone extends
the test and it starts to matter then saving/restoring can be
addressed then.  Plus I think the test is expecting the initial value
of unwindonsignal to be off - we could add more code to the test to
enforce that.


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

end of thread, other threads:[~2012-09-20 14:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-14 22:34 [patch] callfuncs.exp: set unwindonsignal on dje
2012-09-15  7:40 ` Yao Qi
2012-09-20 14:55   ` Doug Evans

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