LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   mdb debugger(solaris) equivalent in linux (https://www.linuxquestions.org/questions/linux-kernel-70/mdb-debugger-solaris-equivalent-in-linux-4175576727/)

subburaj47 04-05-2016 08:25 AM

mdb debugger(solaris) equivalent in linux
 
Hi All,

Could anyone suggest me any debugger equivalent to mdb in solaris?? I am using the libumem port for linux.


Regards,
Subbu

TB0ne 04-05-2016 08:54 AM

Quote:

Originally Posted by subburaj47 (Post 5526529)
Hi All,
Could anyone suggest me any debugger equivalent to mdb in solaris?? I am using the libumem port for linux.

GDB is extensible, just like MDB is...GDB has it's own scripting language, and can be extended to do whatever you'd like, much like the "M" (MODULAR) in MDB can (with "modules"). The better question is, what particular feature are you missing???

subburaj47 04-07-2016 07:11 AM

I would like to debug the memory leaks in my code with a debugger. The tool should mainly be capable of reading the core dumps to detect the leaks. And much important is, the need is in Linux.
More short and crisp --> I am searching for a tool in linux which could give the mdb::findleaks functionality.

TB0ne 04-07-2016 08:27 AM

Quote:

Originally Posted by subburaj47 (Post 5527560)
I would like to debug the memory leaks in my code with a debugger. The tool should mainly be capable of reading the core dumps to detect the leaks. And much important is, the need is in Linux. More short and crisp --> I am searching for a tool in linux which could give the mdb::findleaks functionality.

Right...so use GDB, as you were told in the first reply, "short and crisp".

AGAIN GDB is extensible, as is MDB...you can easily use it with valgrind, and have been able to do so for years. There is ample documentation and thousands of hits in Google for using GDB to do this...did you try to look any of them up???

Activate gdb:
Code:

valgrind --vgdb-error=0 ....<whatever program>
Then in another window, connect a gdb to valgrind, and put a break point at whatever location, and use the gdb command till the break point is reached. Then do a leak search from gdb.
Code:

monitor leak_check full reachable any
By looking up documentation GDB, you can find out more about what it can do. You can list the address(es) of the reachable blocks of the relevant loss:
Code:

monitor block_list <loss_record_nr>


All times are GMT -5. The time now is 06:42 AM.