Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Re: What is gdb.base/structs2.exp actually testing?
@ 2004-03-08 16:32 Michael Elizabeth Chastain
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Elizabeth Chastain @ 2004-03-08 16:32 UTC (permalink / raw)
  To: drow, gdb

drow> Personally, that seems like a very dubious optimization for GCC to be
drow> making at -O0... we can't change the calling convention at -O0, so the
drow> arguments are there, so GCC ought to emit enough information for us to
drow> find them.  You didn't mention what compiler version you're testing
drow> with...

Right.  At gcc -O0, all the variables should exist whether the program
uses them or not.  From the gcc manual:

  Without `-O', the compiler's goal is to reduce the cost of compilation
  and to make debugging produce the expected results.  Statements are
  independent: if you stop the program with a breakpoint between
  statements, you can then assign a new value to any variable or change
  the program counter to any other statement in the function and get
  exactly the results you would expect from the source code.

I think that recent versions of gcc have been cavalier about this.
I think it would help to have a pow-wow with gcc people and work
out more specific requirements for gcc in this area.  If gcc can't
perform as the manual says, then we have to change the manual.

Michael C


^ permalink raw reply	[flat|nested] 6+ messages in thread
* RE: What is gdb.base/structs2.exp actually testing?
@ 2004-03-08 15:11 Bloch, Jack
  0 siblings, 0 replies; 6+ messages in thread
From: Bloch, Jack @ 2004-03-08 15:11 UTC (permalink / raw)
  To: 'gdb@sources.redhat.com'

I am trying to set a breakpoint in a shared library used by my executable. I
have the following two problesm. I try to set the path to the directory
where the source of my shared library is via the directory command. I do not
get an error back, but when I try to open this source file I get a file not
found (the file exists) error. Secondly, I saw some documentation about set
breakpoint pending on. I am not able to do this from my version of GDB. I am
running 5.2.1 on a SuSE 2.4.19 kernel.

What am I doing wrong?

Jack Bloch 
Siemens ICN
phone                (561) 923-6550
e-mail                jack.bloch@icn.siemens.com



^ permalink raw reply	[flat|nested] 6+ messages in thread
* What is gdb.base/structs2.exp actually testing?
@ 2004-03-08 14:42 Corinna Vinschen
  2004-03-08 14:54 ` Daniel Jacobowitz
  2004-03-08 16:20 ` Andrew Cagney
  0 siblings, 2 replies; 6+ messages in thread
From: Corinna Vinschen @ 2004-03-08 14:42 UTC (permalink / raw)
  To: gdb

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.


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

end of thread, other threads:[~2004-03-08 16:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-08 16:32 What is gdb.base/structs2.exp actually testing? Michael Elizabeth Chastain
  -- strict thread matches above, loose matches on Subject: below --
2004-03-08 15:11 Bloch, Jack
2004-03-08 14:42 Corinna Vinschen
2004-03-08 14:54 ` Daniel Jacobowitz
2004-03-08 15:07   ` Corinna Vinschen
2004-03-08 16:20 ` Andrew Cagney

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