Author Topic: x64dbg - pdb source file not loaded  (Read 3392 times)

LiaoMi

  • Member
  • ****
  • Posts: 697
x64dbg - pdb source file not loaded
« on: September 29, 2018, 09:54:11 PM »
Hi,

I noticed that the source code through assembly in UASM is not defined correctly in the pdb file, perhaps this bug has another reason, maybe it's a debugger flaw, in any case, when compiling through a macroassembler, the source code is loaded, when compiling through uasm, the source code is not visible, I attach to the message two test cases, if someone wants to look.

Does anyone have experience in debugging through windbg? Very curious, if it recognizes the source code  :icon_rolleyes:

habran

  • Member
  • *****
  • Posts: 1225
    • uasm
Re: x64dbg - pdb source file not loaded
« Reply #1 on: September 29, 2018, 10:29:50 PM »
It is not easy to work with WinDbg
You need to lead exe to the location where is the PDB file
You need to manually do that.
Play a bit around until you get it
It is much easier to use MSVC than WinDbg
There is nothing wrong with UASM.
It produces a proper debug info, otherwise Visual Studio wouldn't  work either.
Cod-Father

fearless

  • Member
  • ***
  • Posts: 476
    • LetTheLightIn
Re: x64dbg - pdb source file not loaded
« Reply #2 on: September 29, 2018, 10:47:47 PM »
The /ASSEMBLYDEBUG flag in one of the batch files for the linker is for managed stuff (.net like C# etc), although I dont know if it is effecting the linking and pdb creation.
fearless

CM690II Case, HX1000 PSU, Asus Z97, Intel i7-4790K, Seidon 120v Cooler, 16GB DDR3, MSI GTX 980TI

My Github  Twitter

LiaoMi

  • Member
  • ****
  • Posts: 697
Re: x64dbg - pdb source file not loaded
« Reply #3 on: September 29, 2018, 11:45:13 PM »
It is not easy to work with WinDbg
You need to lead exe to the location where is the PDB file
You need to manually do that.
Play a bit around until you get it
It is much easier to use MSVC than WinDbg
There is nothing wrong with UASM.
It produces a proper debug info, otherwise Visual Studio wouldn't  work either.

Hi habran, fearless,

I mean, we are talking about x64dbg, I mentioned Windbg just for comparison  :idea: If MS visual studio perfectly loads the source, in this case, the problem is in x64dbg ...

Quote
The /ASSEMBLYDEBUG flag in one of the batch files for the linker is for managed stuff (.net like C# etc), although I dont know if it is effecting the linking and pdb creation.

That's right, I just experimented and did not remove this flag.

fearless

  • Member
  • ***
  • Posts: 476
    • LetTheLightIn
Re: x64dbg - pdb source file not loaded
« Reply #4 on: September 30, 2018, 12:55:07 AM »
I know that the debug source asm view in x64dbg is still awaiting to be properly re-implemented. Older versions work as they used dbghelp as the main library to handle this. Newer snapshots are using msdia for pdb symbol loading, but the debug source asm view part is still being worked on and doesnt load at the moment.
fearless

CM690II Case, HX1000 PSU, Asus Z97, Intel i7-4790K, Seidon 120v Cooler, 16GB DDR3, MSI GTX 980TI

My Github  Twitter

jj2007

  • Member
  • *****
  • Posts: 10442
  • Assembler is fun ;-)
    • MasmBasic
Re: x64dbg - pdb source file not loaded
« Reply #5 on: September 30, 2018, 01:11:06 AM »
It's a feature that I used only once or twice for experimenting. My code is often macro-heavy, and then the debugger (Olly or X64Dbg) has no idea what the source means. If there are no macros, the disassembly is only slightly different from the source, mainly because the .if ... .else ... .endif and loop constructs.

LiaoMi

  • Member
  • ****
  • Posts: 697
Re: x64dbg - pdb source file not loaded
« Reply #6 on: September 30, 2018, 02:09:12 AM »
I know that the debug source asm view in x64dbg is still awaiting to be properly re-implemented. Older versions work as they used dbghelp as the main library to handle this. Newer snapshots are using msdia for pdb symbol loading, but the debug source asm view part is still being worked on and doesnt load at the moment.

Got it, thanks!  :t

Quote
It's a feature that I used only once or twice for experimenting. My code is often macro-heavy, and then the debugger (Olly or X64Dbg) has no idea what the source means. If there are no macros, the disassembly is only slightly different from the source, mainly because the .if ... .else ... .endif and loop constructs.

Indeed with macros and high-level code it’s harder to see something, but if the code is linear, it uses many constants, repeating blocks of permutations or working with matrices, in this approach it is very convenient to debug the code  :eusa_dance:

fearless

  • Member
  • ***
  • Posts: 476
    • LetTheLightIn
Re: x64dbg - pdb source file not loaded
« Reply #7 on: April 18, 2019, 09:21:20 PM »
The latest snapshot has re-implemented the debug source view capability. Highlight a line that has a source line number in the comments, right click, open source view




fearless

CM690II Case, HX1000 PSU, Asus Z97, Intel i7-4790K, Seidon 120v Cooler, 16GB DDR3, MSI GTX 980TI

My Github  Twitter

nidud

  • Member
  • *****
  • Posts: 1972
    • https://github.com/nidud/asmc
Re: x64dbg - pdb source file not loaded
« Reply #8 on: April 19, 2019, 10:41:56 PM »
Added -Zi and a full path for the 64-bit build of LIBC and this enables source view of library modules as well. No source-stepping yet but this looks good  :t

fearless

  • Member
  • ***
  • Posts: 476
    • LetTheLightIn
Re: x64dbg - pdb source file not loaded
« Reply #9 on: April 20, 2019, 04:13:05 AM »
F8 to step source
fearless

CM690II Case, HX1000 PSU, Asus Z97, Intel i7-4790K, Seidon 120v Cooler, 16GB DDR3, MSI GTX 980TI

My Github  Twitter

LiaoMi

  • Member
  • ****
  • Posts: 697
Re: x64dbg - pdb source file not loaded
« Reply #10 on: April 20, 2019, 07:57:17 PM »
Thanks for the news! There is no syntax highlighting  :icon_rolleyes:, but everything works as it should :P.