[LLVMdev] Column information for the CodeView debug info format

38 views
Skip to first unread message

David Majnemer

unread,
Jul 7, 2015, 1:00:59 AM7/7/15
to llv...@cs.uiuc.edu, jrad...@microsoft.com
Hello,

LLVM currently supports emission of CodeView's line table subsection.  However, we'd like to increase the fidelity of this debug info with column information.  I was wondering if anybody had any pointers as to how CodeView represents such information.

Thanks!

-- 
David Majnemer

Dave Bartolomeo

unread,
Jul 8, 2015, 1:57:46 PM7/8/15
to David Majnemer, llv...@cs.uiuc.edu, Jim Radigan

The line number section you already emit looks like:

 

(0..3) SECREL relocation to function

(4..5) Section index of function

(6..7) Padding

(8..11) Code Size

 

The “Padding” field is actually a flags field, with one flag defined: bit 0 of that field should be set if there is column info in this line number subsection.

 

The actual column info is emitted as part of the same chunks that contain the line numbers for a given file name. Each chunk looks like:

(0..3) Offset of file in the file name table

(4..7) Count of line numbers (n)

(8..11) Size of chunk

(12..12+8*n) Line number records

(12+8*n..12+8*n+4*n) Column records (if column info flag was set)

 

Each column info record looks like:

(0..1) Start Column

(2..3) End Column

 

Note that the chunk includes all of the line number records before any of the column records.

 

-Dave

David Majnemer

unread,
Jul 10, 2015, 8:07:05 PM7/10/15
to Dave Bartolomeo, Jim Radigan, llv...@cs.uiuc.edu
On Wed, Jul 8, 2015 at 10:54 AM, Dave Bartolomeo <Dave.Ba...@microsoft.com> wrote:

The line number section you already emit looks like:

 

(0..3) SECREL relocation to function

(4..5) Section index of function

(6..7) Padding

(8..11) Code Size

 

The “Padding” field is actually a flags field, with one flag defined: bit 0 of that field should be set if there is column info in this line number subsection.

 

The actual column info is emitted as part of the same chunks that contain the line numbers for a given file name. Each chunk looks like:

(0..3) Offset of file in the file name table

(4..7) Count of line numbers (n)

(8..11) Size of chunk

(12..12+8*n) Line number records

(12+8*n..12+8*n+4*n) Column records (if column info flag was set)

 

Each column info record looks like:

(0..1) Start Column

(2..3) End Column

 

Note that the chunk includes all of the line number records before any of the column records.


Thanks! Should be implemented in r241764.
Reply all
Reply to author
Forward
0 new messages