[Dwarf-discuss] multiple entries for one line of code in .debug_line ?
Jun Koi
junkoi2004
Sun Oct 8 00:21:24 GMT 2006
Hi Sebastian,
On 10/7/06, Sebastian Krawczuk <syk at ocsystems.com> wrote:
> Jun,
>
> All is fine. Anything that your compiler emitted in rage 0xc01526c4
> and 0xc01526ea is in reference to your 'return' statement at line
> 369. Maybe the compiler broken it into atomic operations and had to
> produce such source line table. I don't know. I would not worry too
> much and just aggregate data from such entries and interpret is as one
> line entry and range 0xc01526c4-0xc01526ea.
>
What an excellent explanation. Thank you.
> Good luck!
> Sebastian.
>
> PS. It looks like we do your homework here ;)
It .. is ... not! Because I am not a student!
This is my personal project, for hobby only :-)
Best,
Jun
> > 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
> >
> > _______________________________________________
> > Dwarf-discuss mailing list
> > Dwarf-discuss at lists.freestandards.org
> > http://lists.freestandards.org/mailman/listinfo/dwarf-discuss
> >
>
>
More information about the Dwarf-discuss
mailing list