Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [patch, testsuite] Set language after reaching to main function
@ 2011-08-04  3:11 Yao Qi
  2011-08-04  9:32 ` Pedro Alves
  0 siblings, 1 reply; 3+ messages in thread
From: Yao Qi @ 2011-08-04  3:11 UTC (permalink / raw)
  To: gdb-patches

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

I find some similar failures below when I examine gdb test result,

  FAIL: gdb.cp/cplusfuncs.exp: set language c++
  FAIL: gdb.cp/inherit.exp: set language c++
  FAIL: gdb.base/callfuncs.exp: set language c

They are all caused by warning emitted by gdb "Warning: the current
language does not match this frame.".  I examined the frame like this:

(gdb) info frame
Stack level 0, frame at 0x40017780:
 pc = 0x40000000 in _reset_ram
    (reset-ram.S:24);
    saved pc 0x40000a5c
 source language asm.
 Arglist at 0x40017780, args:
 Locals at 0x40017780, Previous frame's sp is 0x40017780

My gdb is working with bare-mental board, and start up code is written
in assembly.  That is the reason why gdb emit such warning when we set
language while pc is still within assembly code.

This patch is to address this problem by moving "set language" after
program hits breakpoint on main.

OK?

-- 
Yao (齐尧)

[-- Attachment #2: set_lang_after_main.patch --]
[-- Type: text/x-patch, Size: 1777 bytes --]

2011-08-04  Yao Qi  <yao@codesourcery.com>

	gdb/testsuite/
	* gdb.base/callfuncs.exp: Set language after main.
	* gdb.cp/cplusfuncs.exp: Likewise.
	* gdb.cp/inherit.exp: Likewise.

diff --git a/gdb/testsuite/gdb.base/callfuncs.exp b/gdb/testsuite/gdb.base/callfuncs.exp
index 27ebd1e..a12feb8 100644
--- a/gdb/testsuite/gdb.base/callfuncs.exp
+++ b/gdb/testsuite/gdb.base/callfuncs.exp
@@ -299,10 +299,10 @@ if { $hp_aCC_compiler } {
 
     gdb_test_no_output "set overload-resolution 0"
 } else {
-    gdb_test_no_output "set language c"
     if { ![runto_main] } {
 	gdb_suppress_tests;
     }
+    gdb_test_no_output "set language c"
 }
 
 get_debug_format
diff --git a/gdb/testsuite/gdb.cp/cplusfuncs.exp b/gdb/testsuite/gdb.cp/cplusfuncs.exp
index 10e4dac..721a178 100644
--- a/gdb/testsuite/gdb.cp/cplusfuncs.exp
+++ b/gdb/testsuite/gdb.cp/cplusfuncs.exp
@@ -603,11 +603,11 @@ proc do_tests {} {
     gdb_reinitialize_dir $srcdir/$subdir
     gdb_load $binfile
 
-    gdb_test_no_output "set language c++"
     gdb_test_no_output "set width 0"
 
     runto_main
 
+    gdb_test_no_output "set language c++"
     probe_demangler
     test_paddr_overloaded_functions
     test_paddr_operator_functions
diff --git a/gdb/testsuite/gdb.cp/inherit.exp b/gdb/testsuite/gdb.cp/inherit.exp
index c353394..add7536 100644
--- a/gdb/testsuite/gdb.cp/inherit.exp
+++ b/gdb/testsuite/gdb.cp/inherit.exp
@@ -728,7 +728,6 @@ proc do_tests { } {
     gdb_reinitialize_dir $srcdir/$subdir
     gdb_load $binfile
 
-    gdb_test_no_output "set language c++"
     gdb_test_no_output "set width 0"
 
     if { ![runto_main] } then {
@@ -736,6 +735,7 @@ proc do_tests { } {
 	return
     }
 
+    gdb_test_no_output "set language c++"
     test_ptype_si
     test_ptype_mi
     test_ptype_vi

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

* Re: [patch, testsuite] Set language after reaching to main function
  2011-08-04  3:11 [patch, testsuite] Set language after reaching to main function Yao Qi
@ 2011-08-04  9:32 ` Pedro Alves
  2011-08-05  9:45   ` [committed] " Yao Qi
  0 siblings, 1 reply; 3+ messages in thread
From: Pedro Alves @ 2011-08-04  9:32 UTC (permalink / raw)
  To: gdb-patches; +Cc: Yao Qi

On Thursday 04 August 2011 04:10:35, Yao Qi wrote:
> I find some similar failures below when I examine gdb test result,
> 
>   FAIL: gdb.cp/cplusfuncs.exp: set language c++
>   FAIL: gdb.cp/inherit.exp: set language c++
>   FAIL: gdb.base/callfuncs.exp: set language c
> 
> They are all caused by warning emitted by gdb "Warning: the current
> language does not match this frame.".  I examined the frame like this:
> 
> (gdb) info frame
> Stack level 0, frame at 0x40017780:
>  pc = 0x40000000 in _reset_ram
>     (reset-ram.S:24);
>     saved pc 0x40000a5c
>  source language asm.
>  Arglist at 0x40017780, args:
>  Locals at 0x40017780, Previous frame's sp is 0x40017780
> 
> My gdb is working with bare-mental board, and start up code is written
> in assembly.  That is the reason why gdb emit such warning when we set
> language while pc is still within assembly code.
> 
> This patch is to address this problem by moving "set language" after
> program hits breakpoint on main.
> 
> OK?

Makes sense to me.  Okay.

-- 
Pedro Alves


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

* [committed] [patch, testsuite] Set language after reaching to main function
  2011-08-04  9:32 ` Pedro Alves
@ 2011-08-05  9:45   ` Yao Qi
  0 siblings, 0 replies; 3+ messages in thread
From: Yao Qi @ 2011-08-05  9:45 UTC (permalink / raw)
  To: gdb-patches

On 08/04/2011 05:32 PM, Pedro Alves wrote:
> On Thursday 04 August 2011 04:10:35, Yao Qi wrote:
>> I find some similar failures below when I examine gdb test result,
>>
>>   FAIL: gdb.cp/cplusfuncs.exp: set language c++
>>   FAIL: gdb.cp/inherit.exp: set language c++
>>   FAIL: gdb.base/callfuncs.exp: set language c
>>
>> They are all caused by warning emitted by gdb "Warning: the current
>> language does not match this frame.".  I examined the frame like this:
>>
>> (gdb) info frame
>> Stack level 0, frame at 0x40017780:
>>  pc = 0x40000000 in _reset_ram
>>     (reset-ram.S:24);
>>     saved pc 0x40000a5c
>>  source language asm.
>>  Arglist at 0x40017780, args:
>>  Locals at 0x40017780, Previous frame's sp is 0x40017780
>>
>> My gdb is working with bare-mental board, and start up code is written
>> in assembly.  That is the reason why gdb emit such warning when we set
>> language while pc is still within assembly code.
>>
>> This patch is to address this problem by moving "set language" after
>> program hits breakpoint on main.
>>
>> OK?
> 
> Makes sense to me.  Okay.
> 

Thanks for the review.  Committed.
http://sourceware.org/ml/gdb-cvs/2011-08/msg00028.html

-- 
Yao (齐尧)


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

end of thread, other threads:[~2011-08-05  9:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-04  3:11 [patch, testsuite] Set language after reaching to main function Yao Qi
2011-08-04  9:32 ` Pedro Alves
2011-08-05  9:45   ` [committed] " Yao Qi

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