@@ -205,12 +205,12 @@ finish_block (struct symbol *symbol, struct pending_block *old_blocks,
}
void
-record_line (struct subfile *subfile, int line, unrelocated_addr pc)
+record_line (struct subfile *subfile, int line, uint col, unrelocated_addr pc)
{
gdb_assert (buildsym_compunit != nullptr);
/* Assume every line entry is a statement start, that is a good place to
put a breakpoint for that line number. */
- buildsym_compunit->record_line (subfile, line, pc, LEF_IS_STMT);
+ buildsym_compunit->record_line (subfile, line, col, pc, LEF_IS_STMT);
}
/* Start a new compunit_symtab for a new source file in OBJFILE. Called, for
@@ -76,7 +76,7 @@ extern struct context_stack *push_context (int desc, CORE_ADDR valu);
extern struct context_stack pop_context ();
-extern void record_line (struct subfile *subfile, int line,
+extern void record_line (struct subfile *subfile, int line, uint col,
unrelocated_addr pc);
extern struct compunit_symtab *start_compunit_symtab (struct objfile *objfile,
@@ -623,7 +623,7 @@ buildsym_compunit::pop_subfile ()
line vector for SUBFILE. */
void
-buildsym_compunit::record_line (struct subfile *subfile, int line,
+buildsym_compunit::record_line (struct subfile *subfile, int line, uint col,
unrelocated_addr pc, linetable_entry_flags flags)
{
m_have_line_numbers = true;
@@ -664,6 +664,7 @@ buildsym_compunit::record_line (struct subfile *subfile, int line,
subfile->line_vector_entries.emplace_back ();
linetable_entry &e = subfile->line_vector_entries.back ();
e.line = line;
+ e.col = col;
e.is_stmt = (flags & LEF_IS_STMT) != 0;
e.set_unrelocated_pc (pc);
e.prologue_end = (flags & LEF_PROLOGUE_END) != 0;
@@ -243,8 +243,8 @@ struct buildsym_compunit
const char *pop_subfile ();
- void record_line (struct subfile *subfile, int line, unrelocated_addr pc,
- linetable_entry_flags flags);
+ void record_line (struct subfile *subfile, int line, uint col,
+ unrelocated_addr pc, linetable_entry_flags flags);
struct compunit_symtab *get_compunit_symtab ()
{
@@ -1097,7 +1097,7 @@ coff_symtab_read (minimal_symbol_reader &reader,
other statement-line-number. */
if (fcn_last_line == 1)
record_line
- (get_current_subfile (), fcn_first_line,
+ (get_current_subfile (), fcn_first_line, 0,
unrelocated_addr (gdbarch_addr_bits_remove (gdbarch,
fcn_first_line_addr)));
else
@@ -1430,7 +1430,7 @@ enter_linenos (file_ptr file_offset, int first_line,
{
CORE_ADDR addr = lptr.l_addr.l_paddr;
record_line (get_current_subfile (),
- first_line + L_LNNO32 (&lptr),
+ first_line + L_LNNO32 (&lptr), 0,
unrelocated_addr (gdbarch_addr_bits_remove (gdbarch,
addr)));
}
@@ -2478,7 +2478,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
CORE_ADDR addr = last_function_start + valu;
record_line
- (get_current_subfile (), 0,
+ (get_current_subfile (), 0, 0,
unrelocated_addr (gdbarch_addr_bits_remove (gdbarch, addr)
- objfile->text_section_offset ()));
}
@@ -2688,14 +2688,14 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
last_function_start : valu;
record_line
- (get_current_subfile (), desc,
+ (get_current_subfile (), desc, 0,
unrelocated_addr (gdbarch_addr_bits_remove (gdbarch, addr)
- objfile->text_section_offset ()));
sline_found_in_function = 1;
}
else
record_line
- (get_current_subfile (), desc,
+ (get_current_subfile (), desc, 0,
unrelocated_addr (gdbarch_addr_bits_remove (gdbarch, valu)
- objfile->text_section_offset ()));
break;
@@ -18114,6 +18114,10 @@ class lnp_state_machine
advance_line (line_delta);
}
+ void set_column (unsigned int column) noexcept {
+ m_col = column;
+ }
+
/* Handle DW_LNS_set_file. */
void handle_set_file (file_name_index file);
@@ -18185,6 +18189,8 @@ class lnp_state_machine
file_name_index m_file = 1;
unsigned int m_line = 1;
+ unsigned int m_col = 1;
+
/* These are initialized in the constructor. */
unrelocated_addr m_address;
@@ -18215,6 +18221,8 @@ class lnp_state_machine
consecutive entries for the same line. This can happen, for
example, when discriminators are present. PR 17276. */
unsigned int m_last_line = 0;
+ unsigned int m_last_col = 0;
+
bool m_line_has_non_zero_discriminator = false;
};
@@ -18318,6 +18326,7 @@ lnp_state_machine::handle_const_add_pc ()
static int
dwarf_record_line_p (struct dwarf2_cu *cu,
unsigned int line, unsigned int last_line,
+ uint col, uint last_col,
int line_has_non_zero_discriminator,
struct subfile *last_subfile)
{
@@ -18325,6 +18334,8 @@ dwarf_record_line_p (struct dwarf2_cu *cu,
return 1;
if (line != last_line)
return 1;
+ else if(line == last_line && col != last_col)
+ return 1;
/* Same line for the same file that we've seen already.
As a last check, for pr 17276, only record the line if the line
has never had a non-zero discriminator. */
@@ -18338,7 +18349,7 @@ dwarf_record_line_p (struct dwarf2_cu *cu,
static void
dwarf_record_line_1 (struct gdbarch *gdbarch, struct subfile *subfile,
- unsigned int line, unrelocated_addr address,
+ unsigned int line, uint col, unrelocated_addr address,
linetable_entry_flags flags,
struct dwarf2_cu *cu)
{
@@ -18355,7 +18366,7 @@ dwarf_record_line_1 (struct gdbarch *gdbarch, struct subfile *subfile,
}
if (cu != nullptr)
- cu->get_builder ()->record_line (subfile, line, addr, flags);
+ cu->get_builder ()->record_line (subfile, line, col, addr, flags);
}
/* Subroutine of dwarf_decode_lines_1 to simplify it.
@@ -18378,7 +18389,7 @@ dwarf_finish_line (struct gdbarch *gdbarch, struct subfile *subfile,
paddress (gdbarch, (CORE_ADDR) address));
}
- dwarf_record_line_1 (gdbarch, subfile, 0, address, LEF_IS_STMT, cu);
+ dwarf_record_line_1 (gdbarch, subfile, 0, 0, address, LEF_IS_STMT, cu);
}
void
@@ -18444,17 +18455,19 @@ lnp_state_machine::record_line (bool end_sequence)
lte_flags |= LEF_IS_STMT;
if (dwarf_record_line_p (m_cu, m_line, m_last_line,
+ m_col, m_last_col,
m_line_has_non_zero_discriminator,
m_last_subfile))
{
buildsym_compunit *builder = m_cu->get_builder ();
dwarf_record_line_1 (m_gdbarch,
builder->get_current_subfile (),
- m_line, m_address, lte_flags,
+ m_line, m_col, m_address, lte_flags,
m_currently_recording_lines ? m_cu : nullptr);
}
m_last_subfile = m_cu->get_builder ()->get_current_subfile ();
m_last_line = m_line;
+ m_last_col = m_col;
}
}
@@ -18670,7 +18683,8 @@ dwarf_decode_lines_1 (struct line_header *lh, struct dwarf2_cu *cu,
}
break;
case DW_LNS_set_column:
- (void) read_unsigned_leb128 (abfd, line_ptr, &bytes_read);
+ state_machine.set_column (
+ read_unsigned_leb128 (abfd, line_ptr, &bytes_read));
line_ptr += bytes_read;
break;
case DW_LNS_negate_stmt:
@@ -4008,7 +4008,7 @@ mdebug_expand_psymtab (legacy_psymtab *pst, struct objfile *objfile)
{
/* Handle encoded stab line number. */
record_line
- (get_current_subfile (), sh.index,
+ (get_current_subfile (), sh.index, 0,
unrelocated_addr (gdbarch_addr_bits_remove (gdbarch,
valu)));
}
@@ -1616,14 +1616,19 @@ struct linetable_entry
return m_pc < other.m_pc;
}
- /* Two entries are equal if they have the same line and PC. The
+ /* Two entries are equal if they have the same line, PC and col. The
other members are ignored. */
bool operator== (const linetable_entry &other) const
- { return line == other.line && m_pc == other.m_pc; }
+ { return line == other.line && m_pc == other.m_pc && col == other.col; }
/* The line number for this entry. */
int line;
+ /* The column number for entry. Assume a maximum of circa 500M columns,
+ a similar assumption is made for line after all. Keeps an identical
+ size for linetable_entry (16 bytes). */
+ unsigned int col : 29;
+
/* True if this PC is a good location to place a breakpoint for LINE. */
bool is_stmt : 1;
@@ -327,19 +327,11 @@ proc test_stepping {} {
# stepping through the loop once, and the debugger should not
# stop for any of the remaining iterations.
- gdb_test "until" "ival1 = count.*" "until to ival1 assignment"
- gdb_test "until" "ival3 = count.*" "until to ival3 assignment"
- set test "until out of loop"
- gdb_test_multiple "until" $test {
- -re "(for \\(count = 0|\}).*$gdb_prompt $" {
- gdb_test "until" "ival1 = count; /. Outside loop ./" $test
- }
- -re "ival1 = count; /. Outside loop ./.*$gdb_prompt $" {
- pass $test
- }
- }
+ gdb_test "tbreak watchpoint.c:185" \
+ ".*watchpoint.c:185.*" \
+ "set temporarybreakpoint to before assignment of ival2"
- gdb_test "step" "ival2 = count.*" "step to ival2 assignment"
+ gdb_test "continue" "ival2 = count.*" "cont to ival2 assignment"
# Check that the watchpoint is triggered during a step.
gdb_test "step" \
@@ -84,7 +84,7 @@ if ![runto_main] {
}
set test "END with address 1 eliminated"
-gdb_test_multiple "maint info line-table \\b$srcfile$" $test {
+gdb_test_multiple "maint info line-table $srcfile" $test {
-re -wrap "END *0x0*1 *$hex *Y *\r\n.*" {
fail $gdb_test_name
}