|
From: Emre C. S. <ec...@nc...> - 2005-11-29 17:43:29
|
I am using Dullard to capture memory writes to some variables I want to
monitor. At the time of detection I also print out the stack.
void func (int *ptr)
{
int a;
...
memcpy (&a, ptr, 1);
...
}
int main (...)
{
int var;
...
func (&var);
...
}
When I dump the stack I see:
memcpy
main
whereas if I use another libc function (sscanf) instead of memcpy I see:
_IO_vfscanf
vsscanf
sscanf
func
main
Why can't I see func in the stack dump when I use memcpy? I compile my
code using -gstabs -O0 flags.
|
|
From: Josef W. <Jos...@gm...> - 2005-11-30 11:07:07
|
On Tuesday 29 November 2005 18:43, Emre Can Sezer wrote: > When I dump the stack I see: > memcpy > main What do you use to dump the stack? Perhaps "memcpy" is always a gcc builtin, and thus, kind of "inlined". Perhaps the stack dumper is buggy and it should print "func" instead of "memcpy" here (as with a builtin/inlined code, there is no separate stack frame for the memcpy). You could check the code generated by the compiler with objdump: objdump -S <your binary> | less and search for "func". Or the debug info generated by the compiler in this case is buggy. Josef |