Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[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


Back to the top