Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tcf-dev] line numbers / unit_line_to_address

Hi Samuel,

This looks like a bug. You are, probably, first one having line info with columns in TCF. I suggest creating a Bugzilla bug report with such ELF file attached as test case.

Thanks,
Eugene

-----Original Message-----
From: tcf-dev-bounces@xxxxxxxxxxx [mailto:tcf-dev-bounces@xxxxxxxxxxx] On Behalf Of Samuel Ghinet
Sent: Wednesday, October 07, 2015 7:52 AM
To: tcf-dev@xxxxxxxxxxx
Subject: [tcf-dev] line numbers / unit_line_to_address

Hello,

I am working on a debugger using tcf. I have ran into a problem with the
line to address functionality when the compiler that build the
executable provides the column numbers.

The tcf agent has checks like this (as seen in linenumbers_elf.c,
function "unit_line_to_address"):

 > else if (state->mFile > file || state->mLine > line || (state->mLine
== line && state->mColumn > column)) {
...
 > if (next_line < line || (next_line == line && next_column <= column)) {
...
 > if (next_line > line || (next_line == line && next_column > column)) {
...
if (state->mColumn > column) break;


In the source code for my file, line 40, I have the column 5 (the
beginning of the c++ instruction at that line).
However, when I am trying to add a breakpoint from Eclipse to that line,
Eclipse requests line 40 and column 0. This results in the fact that tcf
checks line 40 and sees that the column of that line (from
LineNumbersState) is 5 while the requested column is 0, and so it
considers that line 40 is not what I want - when I asked for line 40.

I have read from a dwarf document (says the same in both version 2 and
version 4 I looked in), describing "column":
 > An unsigned integer indicating a column number within a source line.
Columns are numbered beginning at 1. The value 0 is reserved to indicate
that a statement begins at the “left edge” of the line.

I am not sure how to understand "left edge" of the line, but it appears
that the first column for a c++ statement sitting on the very left of
the page(so that there is no space / tab before that statement) is 1. I
am assuming that, when Eclipse asks for "column 0", it actually says "I
don't care what column is, I'm only interested in the line"

What should I do to make the line information be retrieved correctly,
when the request comes from Eclipse, and the compiler I build the
project with gives me the column numbers?

Could you please help me?

Thanks,
Samuel Ghinet
_______________________________________________
tcf-dev mailing list
tcf-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/tcf-dev


This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.


Back to the top