[LLVMbugs] [Bug 12844] New: lib/DebugInfo outputs unprintable characters on windows 7 in llvm-dwarfdump

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed May 16 03:13:52 PDT 2012


http://llvm.org/bugs/show_bug.cgi?id=12844

             Bug #: 12844
           Summary: lib/DebugInfo outputs unprintable characters on
                    windows 7 in llvm-dwarfdump
           Product: libraries
           Version: 3.0
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Support Libraries
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: 6vunkfm7qe at snkmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Running llvm-dwarfdump from LLVM 3.0 built with Visual Studio 2010 (solution
created by cmake) on windows7 results in output containing unprintable
characters in the DWARF TAG lines.
Reproducde by compiling a C program with DWARF debug info and dumping it with
llvm-dwarfdump:

% cat test.c
int x;
% clang -ggdb -O0 -c test.c
% llvm-dwarfdump test.o > out
% vi out
You will see on lines with DW_TAG_... a '^@' (null character)

0x0000000b: DW_TAG_compile_unit [1] ^@

The problem is this line in DWARFDebugInfoEntry.cpp, line 39, function
DWARFDebugInfoEntryMinimal::dump: (diff shows change to code to get it to
work).

39,40c39,42
<         OS << format(" [%u] %c\n", abbrCode,
<                      AbbrevDecl->hasChildren() ? '*' : ' ');
---
>         char hasChildChar = AbbrevDecl->hasChildren() ? '*' : ' ';
>         OS << format(" [%u] ", abbrCode);
>         OS << hasChildChar << "\n";

I was unable to reproduce the problem with format() outside of
DWARFDebugInfoEntryMinimal::dump.   For some reason the context of the
outstream in that function is such that format() with "%c" outputs a null
character instead of the desired character.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list