On Wed, 7 Jan 2009 16:18:57 +0800,
"jidong xiao" <[email protected]> wrote:
>Compared to the old bt code, Keith Owen's new bt algorithm is intended
>to show function parameters even though they are passed in registers
>rather than stack. But the bt result includes too many "invalid"
>there. Here is an example:
>
>[6]kdb> bt
>Stack traceback for pid 4563
>0xffff8102298e4e30 4563 1 1 5 R 0xffff8102298e5178 *atd
>sp ip Function (args)
>0xffff8102215b7e10 0xffffffff80288577 getname (0x7fa31fbc145e)
>0xffff8102215b7e10 0xffffffff8028a132 __user_walk_fd+0x19 (invalid,
>invalid, invalid, 0xffff8102)
>0xffff8102215b7e40 0xffffffff8028366b vfs_stat_fd+0x1b (invalid,
>invalid, 0xffff8102215b7ef8)
>0xffff8102215b7ef0 0xffffffff80283834 sys_newstat+0x19 (invalid,
>0x7fff27bc1630)
>0xffff8102215b7f80 0xffffffff8020bd8b system_call_after_swapgs+0x7b
>(invalid, invalid, invalid, )
>[6]kdb>
>
>Only a few parameters are printed, too many parameters are actually
>"missing", this result in most cases is not really sufficient for
>developers to solve real problem.
>
>In fact I read through the code of this algorithm, I feel the idea to
>trace every block and every instructions is very good, but I wonder
>are there still any possibilities to improve this situation, say,
>capture more parameters and print them out.If we can get/print most of
>the parameters, if not all, that would be really perfect.
Not possible, as long as parameters are passed in registers and gcc is
allowed to stamp on its input parameters. This is not a kdb problem,
it is not even a kernel problem. gdb will report the same thing
("parameter optimized away") for any program where the input
parameters are no longer in their starting registers and have not been
saved somewhere else.
In this case you have to apply your knowledge of the source code. The
first parameter to sys_newstat is the filename, this gets passed down
through vfs_stat_fd and __user_walk_fd to getname, so the argument to
getname (0x7fa31fbc145e) is the address of the filename that was passed
to sys_newstat.
_______________________________________________
kdb mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/kdb