[Dwarf-discuss] multiple entries for one line of code in .debug_line ?

Jun Koi junkoi2004
Sat Oct 7 06:27:52 GMT 2006


Hello,

I used dwarfdump to get information on source codes, and saw something
strange: one line of code may make up to 4 entries in debug_line?

For example, please see the below code (from Linux kernel):


asmlinkage ssize_t sys_write(unsigned int fd, const char __user * buf,
size_t count)
{
    struct file *file;
    ssize_t ret = -EBADF;
    int fput_needed;

    file = fget_light(fd, &fput_needed);
    if (file) {
        loff_t pos = file_pos_read(file);
        ret = vfs_write(file, buf, count, &pos);       <==== ? (line 369)
        file_pos_write(file, pos);
        fput_light(file, fput_needed);
    }

    return ret;
}



The line "ret = vfs_write(...)" at line 369 got 4 entries like below
(vfs_write() is a normal function, not a macro):


/home/jun/projects/linux-2.6.16.29/fs/read_write.c:       [369,-1]
   0xc01526c4      // new statement
/home/jun/projects/0928/linux-2.6.16.29/fs/read_write.c:
[369,-1]        0xc01526ca      // new statement
/home/jun/projects/0928/linux-2.6.16.29/fs/read_write.c:
[369,-1]        0xc01526d0      // new statement
/home/jun/projects/0928/linux-2.6.16.29/fs/read_write.c:
[369,-1]        0xc01526ea      // new statement


Is there any reason of that? As I observed, normally a line of code
has only 1 debug_line entry.


Many thanks.
Jun





More information about the Dwarf-discuss mailing list