public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* Inaccurate function parameter location in debug info with gcc 3.x and 4.0
@ 2006-05-11  0:56 Yi Feng
  0 siblings, 0 replies; only message in thread
From: Yi Feng @ 2006-05-11  0:56 UTC (permalink / raw)
  To: systemtap

Hi,

I have encountered a problem with the DWARF debug info when compiling
the kernel with gcc 3.x and 4.0 with optimization flags of either -O1
or -O2. When looking at the parameter locations of, for example,
sys_read, the debug info says they are all in EAX while these
parameters are in fact only read into EAX temporarily in the function
body. Using this inaccurate information, SystemTap looks at EAX at the
function entry when it's told to instrument the function parameters.
Obviously the returned value is bogus.

I'm wondering if people have noticed this problem before. Using gcc
3.x/4.0 with -Os or gcc 4.1 (with either -O2 or -Os) would generate
accurate debug info which gives the correct stack locations of the
parameters. Therefore SystemTap works correctly to get the parameter
value.

This happens with all the 2.6.1x kernels I've tested. Thanks very much
for any information you may have.


Yi Feng

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-05-11  0:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-11  0:56 Inaccurate function parameter location in debug info with gcc 3.x and 4.0 Yi Feng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).