Patchwork [1/2] gdb/testsuite: Allow DWARF assembler to create multiple line tables

login
register
mail settings
Submitter Andrew Burgess
Date Dec. 6, 2019, 11:46 p.m.
Message ID <c1c4fa05d20aa2da52a48f123e6e2eeea4f422b8.1575675862.git.andrew.burgess@embecosm.com>
Download mbox | patch
Permalink /patch/36580/
State New
Headers show

Comments

Andrew Burgess - Dec. 6, 2019, 11:46 p.m.
Fixes a bug in the DWARF assembler that prevents multiple line tables
from being created in a test.  We currently don't initialise a couple
of flags, as a result we will only ever generate one end of file list,
and one end of header, in the first line table.  Any additional line
tables will be missing these parts, and will therefore be corrupt.

This fix will be required for a later commit.  There should be no
change in the testsuite after this commit.

gdb/testsuite/ChangeLog:

	* lib/dwarf.exp (Dwarf::lines): Reset _line_saw_program and
	_line_saw_file.

Change-Id: Id7123f217a036f26ee32d608db3064dd43164596
---
 gdb/testsuite/ChangeLog     | 5 +++++
 gdb/testsuite/lib/dwarf.exp | 2 ++
 2 files changed, 7 insertions(+)
Kevin Buettner - Jan. 13, 2020, 4:29 a.m.
On Fri,  6 Dec 2019 23:46:40 +0000
Andrew Burgess <andrew.burgess@embecosm.com> wrote:

> Fixes a bug in the DWARF assembler that prevents multiple line tables
> from being created in a test.  We currently don't initialise a couple
> of flags, as a result we will only ever generate one end of file list,
> and one end of header, in the first line table.  Any additional line
> tables will be missing these parts, and will therefore be corrupt.
> 
> This fix will be required for a later commit.  There should be no
> change in the testsuite after this commit.
> 
> gdb/testsuite/ChangeLog:
> 
> 	* lib/dwarf.exp (Dwarf::lines): Reset _line_saw_program and
> 	_line_saw_file.

LGTM.

Kevin

Patch

diff --git a/gdb/testsuite/lib/dwarf.exp b/gdb/testsuite/lib/dwarf.exp
index 75d19abf802..c7f7cee722d 100644
--- a/gdb/testsuite/lib/dwarf.exp
+++ b/gdb/testsuite/lib/dwarf.exp
@@ -1309,6 +1309,8 @@  namespace eval Dwarf {
 	set is_64 0
 	set _unit_version 4
 	set _unit_addr_size default
+	set _line_saw_program 0
+	set _line_saw_file 0
 
 	foreach { name value } $options {
 	    switch -exact -- $name {