This is the mail archive of the gdb@sources.redhat.com 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]

What is gdb.base/structs2.exp actually testing?


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.


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