This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch, testsuite] further robustify gdb.base/bp-permanent.exp


On 07/30/2015 05:05 AM, Sandra Loosemore wrote:
> When I was testing the Nios II R2 patch I posted earlier today, I saw a 
> lot of failures from gdb.base/bp-permanent.exp.  Upon investigation, I 
> realized that this was a due to a quirk of the simulator we have 
> available.  Apparently, its execution engine maintains its own view of 
> the .text section and breakpoints set through the debug interface are 
> not visible to the running program.  This means that the setup function 
> in the program is stashing away a copy of the original NOP instruction 
> at the breakpoint location, rather than the breakpoint instruction 
> inserted by GDB, and when the .exp file thinks it is writing a permanent 
> breakpoint in fact it is just telling the target to write a NOP to a 
> location that already contains one.  :-S
> 
> Anyway, it is clear that if the program runs to termination instead of 
> stopping where GDB expects, none of the remaining tests are going to do 
> anything useful, so we might just as well report that the test is 
> unsupported and return.
> 
> OK to commit?

> +	set test "permanent breakpoint causes random signal"
> +	gdb_test_multiple "continue" $test {
> +	    -re "exited normally.*$gdb_prompt $" {
> +	        unsupported "failed to stop at permanent breakpoint"
> +		return
> +	    }
> +	    -re "Program received signal SIGTRAP.*" {

This needs to end with "$gdb_prompt $" too.

OK with that change.

> +	    	pass $test
> +	    }
> +	}
>  
>  	# Now set a breakpoint on top, thus creating a permanent breakpoint.
>  	gdb_breakpoint "$line_bp"
> 


Thanks,
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]