How to use third-party debugging tools?

Everything else that doesn't fall into one of the other PB categories.
nsstudios
Enthusiast
Enthusiast
Posts: 274
Joined: Wed Aug 28, 2019 1:01 pm
Location: Serbia
Contact:

How to use third-party debugging tools?

Post by nsstudios »

Hi,

I've been interested in trying external debugging tools like DRMemory or Valgrind alternatives for Windows.
Does anyone have any pointers how to go about it?
I have tried DrMemory today, it reports:
Dr. Memory version 2.5.0 build 0 built on Oct 18 2021 03:01:22
Windows version: WinVer=105;Rel=2009;Build=19045;Edition=Professional
Dr. Memory results for pid 6760: "drmemtest.exe"
Application cmdline: "drmemtest.exe"
Recorded 124 suppression(s) from default drMemory\bin64\suppress-default.txt
ERROR: Failed to find "main" for limiting memory dump
Dr. Memory Notice: drmemtest.exe(6760)
Application drmemtest.exe (6760). Dr. Memory internal crash at PC 0x000000007107cf00. Please report this at http://drmemory.org/issues along with the results of running '-debug -dr_debug'. Program aborted.
0xc0000005 0x00000000 0x000000007107cf00 0x000000007107cf00 0x0000000000000000 0x0000000000000000
Base: 0x0000000071000000
Registers: eax=0x0000000000000001 ebx=0x0000000000000000 ecx=0x0000000000000000 edx=0x0000000000000000
esi=0x0000000000000000 edi=0x00000001400a52b0 esp=0x00000001400a51f0 ebp=0x00000001400a5360
r8 =0x00000001400a5310 r9 =0x00000000710f4040 r10=0x00000001400a5312 r11=0x000000007111b2e0
r12=0x0000000000000000 r13=0x0000000000000000 r14=0x0000000000000000 r15=0x0000000000000000
eflags=0x0000000000010246
2.5.0-0-(Oct 18 2021 03:01:22) WinVer=105;Rel=2009;Build=19045;Edition=Professional
-no_dynamic_options -disasm_mask 8 -logdir 'drMemory\drmemory\logs\dynamorio' -client_lib 'drMemory\bin64\release\drmemorylib.dll;0;-logdir `drMemory\drmemory\logs` -symcache_dir `drMemory\drmemory\logs\symcache` -lib_
0x00000001400a5360 0x00000000d00dc308
0x00000000d00dc313 0x000a0d0079726f6d
I compiled with
pbcompilerc /debugger drmemtest.pb -o drmemtest.exe
I've also tried compiling without the /debugger flag, but the result is the same.
I don't know why, but I thought we also had the -ds option for adding debug symbols, but I couldn't find anything like that in --help switch, or help file.
Sorry if this has been asked before, I couldn't find much info when searching first.

Thank you.
User avatar
Thunder93
Addict
Addict
Posts: 1788
Joined: Tue Mar 21, 2006 12:31 am
Location: Canada

Re: How to use third-party debugging tools?

Post by Thunder93 »

Also interested.
ʽʽSuccess is almost totally dependent upon drive and persistence. The extra energy required to make another effort or try another approach is the secret of winning.ʾʾ --Dennis Waitley
Fred
Administrator
Administrator
Posts: 16619
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: How to use third-party debugging tools?

Post by Fred »

If you can build your program on Linux, you have the -ds flag and you can use valgrind which is the best tool you can dream. Unfortunately it's not available on windows.
User avatar
Thunder93
Addict
Addict
Posts: 1788
Joined: Tue Mar 21, 2006 12:31 am
Location: Canada

Re: How to use third-party debugging tools?

Post by Thunder93 »

That's what I've figured, Thanks Fred.
ʽʽSuccess is almost totally dependent upon drive and persistence. The extra energy required to make another effort or try another approach is the secret of winning.ʾʾ --Dennis Waitley
Post Reply