rainers / cv2pdb

converter of DMD CodeView/DWARF debug information to PDB files
Artistic License 2.0
466 stars 110 forks source link

No locals while debugging with generated pdb #56

Closed nevilad closed 5 years ago

nevilad commented 5 years ago

I'm debugging qemu (the binary is attached to "Invalid entrys in generated pdb" issue) and windbg does not show any locals. For example when debugging bdrv_co_rw_vmstate function, gdb shows as locals "drv" and "ret", and as arguments "bs", "qiov", "pos", "is_read".

rainers commented 5 years ago

Looks like these variables are kept in registers and sometimes even passed through several registers. It's a major effort to support these in the conversion. I suspect you are using an optimized build. If feasible you should disable that.

nevilad commented 5 years ago

I built the exe without optimizations, the locals are generated and I'm able to see them in windbg. But cvdump writes several warnings: WARNING: UDT mismatch for lconv <<<<<< 0x101b : Length = 26, Leaf = 0x1505 LF_STRUCTURE

members = 18, field list type 0x101a,

Derivation list type 0x0000, VT shape type 0x0000
Size = 88, class name = lconv, UDT(0x000010b2)

0x10b2 : Length = 26, Leaf = 0x1505 LF_STRUCTURE

members = 0, field list type 0x1022,

Derivation list type 0x0000, VT shape type 0x0000
Size = 0, class name = lconv, UDT(0x000010b2)

and

<<<< WARNING >>>> 1 line/addr pairs are out of bounds!

.\debian\tmp\usr\x86_64-w64-mingw32\include\psdk_inc\intrin-impl.h (None), 0001:0055B820-0055B82A, line/addr pairs = 1

1120 0055B820

.\mingw-w64-crt\misc\invalid_parameter_handler.c (None), 0001:0055B82A-0055B82B, line/addr pairs = 1

 10 0055B82A

.\mingw-w64-crt\misc\output_format.c (None), 0001:0055B830-0055B840, line/addr pairs = 2 Is this important? qemu-system-i386_dbg.zip

rainers commented 5 years ago

WARNING: UDT mismatch for lconv

These appear because there are multiple definitions of the same struct in the DWARF info, too, probably from different compilation units. Most of them shouldn't be a problem, but anonymous ones that are all called __noname.

<<<< WARNING >>>> 1 line/addr pairs are out of bounds! Is this important?

Very unlikely, these are 2 empty sections from inlined code in the C runtime that you will probably not hit.