This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
What is gdb.base/structs2.exp actually testing?
- From: Corinna Vinschen <vinschen at redhat dot com>
- To: gdb at sources dot redhat dot com
- Date: Mon, 8 Mar 2004 15:41:54 +0100
- Subject: What is gdb.base/structs2.exp actually testing?
- Reply-to: gdb at sources dot redhat dot com
Hi,
the subject already contains the question. What is the structs2 test
good for? It's really not clear to me. There's a PR 13536 mentioned
in the first line of structs2.c but this is a PRMS number and searching
the gdb-patches archive didn't give me any useful hint. Is PRMS still
accessible somewhere?
The problem with this test is that it is based on the assumption, that
GCC would not optimize away unused variables. The register arguments
to param_reg are not reallyused, instead they only get values assigned.
GCC is able to recognize this and to optimize away these assignments
entirely, even in the non-optimize case! This happens for example on
the SH target.
The consequence of this fact is that the binary doesn't contain any
debug information for the given register variables, so GDB doesn't know
about them. In turn the testcase has two fails:
FAIL: gdb.base/structs2.exp: structs2 continue1 (PRMS 13536)
FAIL: gdb.base/structs2.exp: structs2 continue2 (PRMS 13536)
due to the fact that the arguments are not printed, when the breakpoint
is hit:
Breakpoint 2, param_reg () at ...
Are these tests really useful or shouldn't they either be dropped or
modified to accomodate the above case?
Any hints welcome,
Corinna
--
Corinna Vinschen
Cygwin Developer
Red Hat, Inc.