Monday 12 October 2009

Debug, dump and Symbol on windows and UNIx-like OS

First, lets distinguished these 2 words, dump and debug.

Dump is for dump the memory or stack to a file to be debug-ed by a special software.

In unix, you can just run kill -3 program.exe to dump all the stack of a running process.
After that, if this is java, it will create heapdump file.
Which you can debug/analyze using heap analyzer tool - free.

For other process other than java, you can use gdb -gnu debugger- either to debug running process or to debug a "will be running" process.

Here is the link : http://www.ibm.com/developerworks/linux/library/l-debug/


In windows, you can run adplus -hang for running process or -crash for "will be running" process, and then debug it using windbg. Adplus basically based on cdb (commandline debugger), meanwhile windbg is GUI, and kd is kernel debugger. They are all in same installation packages,

Windbg can also be used to debug/analyze kernel dump, which if you set it before, then you can get kernel dump when you experience the blue screen. It also can be used for dump running process/service or a "will be running" service.

Here is the link : http://support.microsoft.com/kb/824344

Here is the link for example debugging .NET:
http://blogs.msdn.com/tess/archive/2006/01/11/511773.aspx

Here is the link about kd : http://windowsitpro.com/article/articleid/21217/using-the-windbg-debugging-tool.html

Note : In every thing you do make sure you are aware the switch of the command, sometime it is needed when you just want to get the stack and don't want to stop the process.


Now about Symbol, it is used to humanizer the binary code of exe or dll that you debug.
Some programming symbol are different with each other.
For windows, you can make this url as symbol source http://msdl.microsoft.com/download/symbols.

In unix, symbol can be mean the source code (the one that were compiled to get the binary file). Core means the dump file.
You can use : gdb sourcefilename corefile : to analyze the core file.
In unix the source code usually can be found in internet or request to the developer, because it is open source :)

Here is the link : http://support.microsoft.com/kb/311503



>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Pertama, mari kita membedakan 2 kata ini, dump dan debug.

Dump adalah untuk membuang memori atau tumpukan ke sebuah file yang akan debug-ed oleh software khusus.

Pada unix, Anda bisa jalankan membunuh -3 program.exe untuk membuang semua tumpukan proses yang berjalan.
Setelah itu, jika hal ini java, itu akan menciptakan file heapdump.
Anda dapat debug / menganalisis dengan menggunakan alat analisa tumpukan - gratis.

Di jendela, Anda dapat menjalankan adplus-menggantung untuk itu, dan kemudian men-debug dengan menggunakan WinDbg.
WinDbg juga dapat digunakan untuk debug / menganalisis kernel dump, yang jika Anda mengatur hal ini sebelumnya, maka anda bisa mendapatkan kernel dump bila Anda mengalami layar biru.

No comments:

Post a Comment