summaryrefslogtreecommitdiff
path: root/debian/patches/0005-fix-off-by-one-error-generatred-line-numbers-are-off.patch
blob: 280d392983a06858ae3d71c451a797338a0df4bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
From 0784556690a1f33ea44a03d20312ef439ae5cc32 Mon Sep 17 00:00:00 2001
From: Manoj Srivastava <srivasta@golden-gryphon.com>
Date: Tue, 6 May 2014 23:50:05 -0700
Subject: [PATCH 5/5] [fix-off-by-one-error]: generatred line numbers are off
 by one

The code that is generated by flex has an off-by-one error in the
generated #line pragmas that occur after the second %% line in the
source file (that is, the one that is used after the token patterns). As
a result, gdb will think we're, e.g., on line 46 when in reality we're
on line 45.

Marcus Rausch  supplied the patch in this commit

Signed-off-by: Manoj Srivastava <srivasta@golden-gryphon.com>
---
 gen.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gen.c b/gen.c
index 8261951..1594dcf 100644
--- a/gen.c
+++ b/gen.c
@@ -1084,7 +1084,7 @@ void gentabs ()
 		out_str_dec (long_align ? get_int32_decl () :
 			     get_int16_decl (), "yy_acclist", MAX (numas,
 								   1) + 1);
-        
+
         buf_prints (&yydmap_buf,
                 "\t{YYTD_ID_ACCLIST, (void**)&yy_acclist, sizeof(%s)},\n",
                 long_align ? "flex_int32_t" : "flex_int16_t");
@@ -1092,7 +1092,7 @@ void gentabs ()
         yyacclist_tbl = (struct yytbl_data*)calloc(1,sizeof(struct yytbl_data));
         yytbl_data_init (yyacclist_tbl, YYTD_ID_ACCLIST);
         yyacclist_tbl->td_lolen  = MAX(numas,1) + 1;
-        yyacclist_tbl->td_data = yyacclist_data = 
+        yyacclist_tbl->td_data = yyacclist_data =
             (flex_int32_t *) calloc (yyacclist_tbl->td_lolen, sizeof (flex_int32_t));
         yyacclist_curr = 1;
 
@@ -2158,7 +2158,7 @@ void make_tables ()
 	skelout ();
 
 	/* Copy remainder of input to output. */
-
+        linenum--;
 	line_directive_out (stdout, 1);
 
 	if (sectnum == 3) {
-- 
2.0.0.rc0