Debug just a function in .dll or .so

30 views
Skip to first unread message

Juaneme

unread,
May 4, 2020, 9:13:57 AM5/4/20
to Dr. Memory Users
I want to debug a c++ .dll using dr memory (memory leak), just for a specific function in dll

I found in the doc that we can use fuzz arguments to debug .dll or .so

void func(int a, int b)
{
int *tab = new int[5];
}

int main()
{
f();
func(1,2);
DrMemory a;
float res = a.sum(5,4.3,6);
std::cout << res;
return 0;
}
I wand just debug function "func(int a, int b)"

The cmd : drmemory -fuzz module Dr_Memory.exe -fuzz_function func debug all the program
Any suggestions,

Derek Bruening

unread,
May 4, 2020, 12:10:52 PM5/4/20
to drmemor...@googlegroups.com
The fuzzing control is for running a function over and over again: I don't think it is what you are looking for.  Probably what you want is to only report leaks with your function in the callstack.  The closest might be to limit to the file containing that function with the -src_whitelist runtime option (https://dynamorio.org/drmemory_docs/page_running.html#sec_potential_errorshttps://dynamorio.org/drmemory_docs/page_options.html).

--

---
You received this message because you are subscribed to the Google Groups "Dr. Memory Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drmemory-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/drmemory-users/22ce5490-5b55-4214-9a21-3efc9d97bc10%40googlegroups.com.

Juaneme

unread,
May 4, 2020, 2:50:43 PM5/4/20
to Dr. Memory Users

Yes, " Probably what you want is to only report leaks with your function in the callstack" That is what I want

How can I specify a function from whole program ??

drmemory -src_whitelist func -- Dr_Memory.exe ??

Thanks,


On Monday, May 4, 2020 at 5:10:52 PM UTC+1, Derek Bruening wrote:
The fuzzing control is for running a function over and over again: I don't think it is what you are looking for.  Probably what you want is to only report leaks with your function in the callstack.  The closest might be to limit to the file containing that function with the -src_whitelist runtime option (https://dynamorio.org/drmemory_docs/page_running.html#sec_potential_errorshttps://dynamorio.org/drmemory_docs/page_options.html).

On Mon, May 4, 2020 at 9:13 AM Juaneme <contact....@gmail.com> wrote:
I want to debug a c++ .dll using dr memory (memory leak), just for a specific function in dll

I found in the doc that we can use fuzz arguments to debug .dll or .so

void func(int a, int b)
{
    int *tab = new int[5];
}

int main()
{
    f();
    func(1,2);
    DrMemory a;
    float res = a.sum(5,4.3,6);
    std::cout << res;
    return 0;
}
I wand just debug function "func(int a, int b)"

The cmd : drmemory -fuzz module Dr_Memory.exe -fuzz_function func debug all the program
Any suggestions,

--

---
You received this message because you are subscribed to the Google Groups "Dr. Memory Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drmemor...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages