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]

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


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


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