Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
2ad521c1
Commit
2ad521c1
authored
Oct 07, 2010
by
Luuk van Dijk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[568]a: precise linenumbers for statements.
R=rsc, ken2, r, rsc1 CC=golang-dev
https://golang.org/cl/2297042
parent
cc5c2ee0
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
54 additions
and
34 deletions
+54
-34
src/cmd/5a/a.h
src/cmd/5a/a.h
+3
-2
src/cmd/5a/a.y
src/cmd/5a/a.y
+6
-2
src/cmd/5a/lex.c
src/cmd/5a/lex.c
+5
-5
src/cmd/6a/a.h
src/cmd/6a/a.h
+5
-4
src/cmd/6a/a.y
src/cmd/6a/a.y
+6
-2
src/cmd/6a/lex.c
src/cmd/6a/lex.c
+5
-5
src/cmd/8a/a.h
src/cmd/8a/a.h
+5
-4
src/cmd/8a/a.y
src/cmd/8a/a.y
+6
-2
src/cmd/8a/lex.c
src/cmd/8a/lex.c
+5
-5
src/cmd/ld/dwarf.c
src/cmd/ld/dwarf.c
+8
-3
No files found.
src/cmd/5a/a.h
View file @
2ad521c1
// Inferno utils/5a/a.h
// Inferno utils/5a/a.h
// http://code.google.com/p/inferno-os/source/browse/utils/5a/a.h
// http://code.google.com/p/inferno-os/source/browse/utils/5a/a.h
//
//
// Copyright © 1994-1999 Lucent Technologies Inc.
All rights reserved.
// Copyright © 1994-1999 Lucent Technologies Inc.
All rights reserved.
// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net)
// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net)
// Portions Copyright © 1997-1999 Vita Nuova Limited
// Portions Copyright © 1997-1999 Vita Nuova Limited
// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com)
// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com)
...
@@ -148,6 +148,7 @@ EXTERN int pass;
...
@@ -148,6 +148,7 @@ EXTERN int pass;
EXTERN
char
*
pathname
;
EXTERN
char
*
pathname
;
EXTERN
int32
pc
;
EXTERN
int32
pc
;
EXTERN
int
peekc
;
EXTERN
int
peekc
;
EXTERN
int32
stmtline
;
EXTERN
int
sym
;
EXTERN
int
sym
;
EXTERN
char
*
symb
;
EXTERN
char
*
symb
;
EXTERN
int
thechar
;
EXTERN
int
thechar
;
...
@@ -157,7 +158,7 @@ EXTERN Biobuf obuf;
...
@@ -157,7 +158,7 @@ EXTERN Biobuf obuf;
void
*
alloc
(
int32
);
void
*
alloc
(
int32
);
void
*
allocn
(
void
*
,
int32
,
int32
);
void
*
allocn
(
void
*
,
int32
,
int32
);
void
ensuresymb
(
int32
);
void
ensuresymb
(
int32
);
void
errorexit
(
void
);
void
errorexit
(
void
);
void
pushio
(
void
);
void
pushio
(
void
);
void
newio
(
void
);
void
newio
(
void
);
...
...
src/cmd/5a/a.y
View file @
2ad521c1
// Inferno utils/5a/a.y
// Inferno utils/5a/a.y
// http://code.google.com/p/inferno-os/source/browse/utils/5a/a.y
// http://code.google.com/p/inferno-os/source/browse/utils/5a/a.y
//
//
// Copyright © 1994-1999 Lucent Technologies Inc.
All rights reserved.
// Copyright © 1994-1999 Lucent Technologies Inc.
All rights reserved.
// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net)
// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net)
// Portions Copyright © 1997-1999 Vita Nuova Limited
// Portions Copyright © 1997-1999 Vita Nuova Limited
// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com)
// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com)
...
@@ -63,7 +63,11 @@
...
@@ -63,7 +63,11 @@
%type <gen> imm ximm name oreg ireg nireg ioreg imsr
%type <gen> imm ximm name oreg ireg nireg ioreg imsr
%%
%%
prog:
prog:
| prog line
| prog
{
stmtline = lineno;
}
line
line:
line:
LLAB ':'
LLAB ':'
...
...
src/cmd/5a/lex.c
View file @
2ad521c1
// Inferno utils/5a/lex.c
// Inferno utils/5a/lex.c
// http://code.google.com/p/inferno-os/source/browse/utils/5a/lex.c
// http://code.google.com/p/inferno-os/source/browse/utils/5a/lex.c
//
//
// Copyright © 1994-1999 Lucent Technologies Inc.
All rights reserved.
// Copyright © 1994-1999 Lucent Technologies Inc.
All rights reserved.
// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net)
// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net)
// Portions Copyright © 1997-1999 Vita Nuova Limited
// Portions Copyright © 1997-1999 Vita Nuova Limited
// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com)
// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com)
...
@@ -658,10 +658,10 @@ jackpot:
...
@@ -658,10 +658,10 @@ jackpot:
Bputc
(
&
obuf
,
a
);
Bputc
(
&
obuf
,
a
);
Bputc
(
&
obuf
,
scond
);
Bputc
(
&
obuf
,
scond
);
Bputc
(
&
obuf
,
reg
);
Bputc
(
&
obuf
,
reg
);
Bputc
(
&
obuf
,
lineno
);
Bputc
(
&
obuf
,
stmtline
);
Bputc
(
&
obuf
,
lineno
>>
8
);
Bputc
(
&
obuf
,
stmtline
>>
8
);
Bputc
(
&
obuf
,
lineno
>>
16
);
Bputc
(
&
obuf
,
stmtline
>>
16
);
Bputc
(
&
obuf
,
lineno
>>
24
);
Bputc
(
&
obuf
,
stmtline
>>
24
);
zaddr
(
g1
,
sf
);
zaddr
(
g1
,
sf
);
zaddr
(
g2
,
st
);
zaddr
(
g2
,
st
);
...
...
src/cmd/6a/a.h
View file @
2ad521c1
// Inferno utils/6a/a.h
// Inferno utils/6a/a.h
// http://code.google.com/p/inferno-os/source/browse/utils/6a/a.h
// http://code.google.com/p/inferno-os/source/browse/utils/6a/a.h
//
//
// Copyright © 1994-1999 Lucent Technologies Inc.
All rights reserved.
// Copyright © 1994-1999 Lucent Technologies Inc.
All rights reserved.
// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net)
// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net)
// Portions Copyright © 1997-1999 Vita Nuova Limited
// Portions Copyright © 1997-1999 Vita Nuova Limited
// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com)
// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com)
...
@@ -50,7 +50,7 @@ typedef struct Ref Ref;
...
@@ -50,7 +50,7 @@ typedef struct Ref Ref;
typedef
struct
Gen
Gen
;
typedef
struct
Gen
Gen
;
typedef
struct
Io
Io
;
typedef
struct
Io
Io
;
typedef
struct
Hist
Hist
;
typedef
struct
Hist
Hist
;
typedef
struct
Gen2
Gen2
;
typedef
struct
Gen2
Gen2
;
#define MAXALIGN 7
#define MAXALIGN 7
#define FPCHIP 1
#define FPCHIP 1
...
@@ -161,6 +161,7 @@ EXTERN int pass;
...
@@ -161,6 +161,7 @@ EXTERN int pass;
EXTERN
char
*
pathname
;
EXTERN
char
*
pathname
;
EXTERN
int32
pc
;
EXTERN
int32
pc
;
EXTERN
int
peekc
;
EXTERN
int
peekc
;
EXTERN
int32
stmtline
;
EXTERN
int
sym
;
EXTERN
int
sym
;
EXTERN
char
*
symb
;
EXTERN
char
*
symb
;
EXTERN
int
thechar
;
EXTERN
int
thechar
;
...
@@ -168,9 +169,9 @@ EXTERN char* thestring;
...
@@ -168,9 +169,9 @@ EXTERN char* thestring;
EXTERN
int32
thunk
;
EXTERN
int32
thunk
;
EXTERN
Biobuf
obuf
;
EXTERN
Biobuf
obuf
;
void
*
alloc
(
int32
);
void
*
alloc
(
int32
);
void
*
allocn
(
void
*
,
int32
,
int32
);
void
*
allocn
(
void
*
,
int32
,
int32
);
void
ensuresymb
(
int32
);
void
ensuresymb
(
int32
);
void
errorexit
(
void
);
void
errorexit
(
void
);
void
pushio
(
void
);
void
pushio
(
void
);
void
newio
(
void
);
void
newio
(
void
);
...
...
src/cmd/6a/a.y
View file @
2ad521c1
// Inferno utils/6a/a.y
// Inferno utils/6a/a.y
// http://code.google.com/p/inferno-os/source/browse/utils/6a/a.y
// http://code.google.com/p/inferno-os/source/browse/utils/6a/a.y
//
//
// Copyright © 1994-1999 Lucent Technologies Inc.
All rights reserved.
// Copyright © 1994-1999 Lucent Technologies Inc.
All rights reserved.
// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net)
// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net)
// Portions Copyright © 1997-1999 Vita Nuova Limited
// Portions Copyright © 1997-1999 Vita Nuova Limited
// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com)
// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com)
...
@@ -60,7 +60,11 @@
...
@@ -60,7 +60,11 @@
%type <gen2> spec1 spec2 spec3 spec4 spec5 spec6 spec7 spec8 spec9
%type <gen2> spec1 spec2 spec3 spec4 spec5 spec6 spec7 spec8 spec9
%%
%%
prog:
prog:
| prog line
| prog
{
stmtline = lineno;
}
line
line:
line:
LLAB ':'
LLAB ':'
...
...
src/cmd/6a/lex.c
View file @
2ad521c1
// Inferno utils/6a/lex.c
// Inferno utils/6a/lex.c
// http://code.google.com/p/inferno-os/source/browse/utils/6a/lex.c
// http://code.google.com/p/inferno-os/source/browse/utils/6a/lex.c
//
//
// Copyright © 1994-1999 Lucent Technologies Inc.
All rights reserved.
// Copyright © 1994-1999 Lucent Technologies Inc.
All rights reserved.
// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net)
// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net)
// Portions Copyright © 1997-1999 Vita Nuova Limited
// Portions Copyright © 1997-1999 Vita Nuova Limited
// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com)
// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com)
...
@@ -1260,10 +1260,10 @@ jackpot:
...
@@ -1260,10 +1260,10 @@ jackpot:
}
}
Bputc
(
&
obuf
,
a
);
Bputc
(
&
obuf
,
a
);
Bputc
(
&
obuf
,
a
>>
8
);
Bputc
(
&
obuf
,
a
>>
8
);
Bputc
(
&
obuf
,
lineno
);
Bputc
(
&
obuf
,
stmtline
);
Bputc
(
&
obuf
,
lineno
>>
8
);
Bputc
(
&
obuf
,
stmtline
>>
8
);
Bputc
(
&
obuf
,
lineno
>>
16
);
Bputc
(
&
obuf
,
stmtline
>>
16
);
Bputc
(
&
obuf
,
lineno
>>
24
);
Bputc
(
&
obuf
,
stmtline
>>
24
);
zaddr
(
&
g2
->
from
,
sf
);
zaddr
(
&
g2
->
from
,
sf
);
zaddr
(
&
g2
->
to
,
st
);
zaddr
(
&
g2
->
to
,
st
);
...
...
src/cmd/8a/a.h
View file @
2ad521c1
// Inferno utils/8a/a.h
// Inferno utils/8a/a.h
// http://code.google.com/p/inferno-os/source/browse/utils/8a/a.h
// http://code.google.com/p/inferno-os/source/browse/utils/8a/a.h
//
//
// Copyright © 1994-1999 Lucent Technologies Inc.
All rights reserved.
// Copyright © 1994-1999 Lucent Technologies Inc.
All rights reserved.
// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net)
// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net)
// Portions Copyright © 1997-1999 Vita Nuova Limited
// Portions Copyright © 1997-1999 Vita Nuova Limited
// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com)
// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com)
...
@@ -50,7 +50,7 @@ typedef struct Ref Ref;
...
@@ -50,7 +50,7 @@ typedef struct Ref Ref;
typedef
struct
Gen
Gen
;
typedef
struct
Gen
Gen
;
typedef
struct
Io
Io
;
typedef
struct
Io
Io
;
typedef
struct
Hist
Hist
;
typedef
struct
Hist
Hist
;
typedef
struct
Gen2
Gen2
;
typedef
struct
Gen2
Gen2
;
#define MAXALIGN 7
#define MAXALIGN 7
#define FPCHIP 1
#define FPCHIP 1
...
@@ -162,6 +162,7 @@ EXTERN int pass;
...
@@ -162,6 +162,7 @@ EXTERN int pass;
EXTERN
char
*
pathname
;
EXTERN
char
*
pathname
;
EXTERN
int32
pc
;
EXTERN
int32
pc
;
EXTERN
int
peekc
;
EXTERN
int
peekc
;
EXTERN
int32
stmtline
;
EXTERN
int
sym
;
EXTERN
int
sym
;
EXTERN
char
*
symb
;
EXTERN
char
*
symb
;
EXTERN
int
thechar
;
EXTERN
int
thechar
;
...
@@ -169,9 +170,9 @@ EXTERN char* thestring;
...
@@ -169,9 +170,9 @@ EXTERN char* thestring;
EXTERN
int32
thunk
;
EXTERN
int32
thunk
;
EXTERN
Biobuf
obuf
;
EXTERN
Biobuf
obuf
;
void
*
alloc
(
int32
);
void
*
alloc
(
int32
);
void
*
allocn
(
void
*
,
int32
,
int32
);
void
*
allocn
(
void
*
,
int32
,
int32
);
void
ensuresymb
(
int32
);
void
ensuresymb
(
int32
);
void
errorexit
(
void
);
void
errorexit
(
void
);
void
pushio
(
void
);
void
pushio
(
void
);
void
newio
(
void
);
void
newio
(
void
);
...
...
src/cmd/8a/a.y
View file @
2ad521c1
// Inferno utils/8a/a.y
// Inferno utils/8a/a.y
// http://code.google.com/p/inferno-os/source/browse/utils/8a/a.y
// http://code.google.com/p/inferno-os/source/browse/utils/8a/a.y
//
//
// Copyright © 1994-1999 Lucent Technologies Inc.
All rights reserved.
// Copyright © 1994-1999 Lucent Technologies Inc.
All rights reserved.
// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net)
// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net)
// Portions Copyright © 1997-1999 Vita Nuova Limited
// Portions Copyright © 1997-1999 Vita Nuova Limited
// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com)
// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com)
...
@@ -64,7 +64,11 @@
...
@@ -64,7 +64,11 @@
%type <gen2> spec1 spec2 spec3 spec4 spec5 spec6 spec7 spec8
%type <gen2> spec1 spec2 spec3 spec4 spec5 spec6 spec7 spec8
%%
%%
prog:
prog:
| prog line
| prog
{
stmtline = lineno;
}
line
line:
line:
LLAB ':'
LLAB ':'
...
...
src/cmd/8a/lex.c
View file @
2ad521c1
// Inferno utils/8a/lex.c
// Inferno utils/8a/lex.c
// http://code.google.com/p/inferno-os/source/browse/utils/8a/lex.c
// http://code.google.com/p/inferno-os/source/browse/utils/8a/lex.c
//
//
// Copyright © 1994-1999 Lucent Technologies Inc.
All rights reserved.
// Copyright © 1994-1999 Lucent Technologies Inc.
All rights reserved.
// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net)
// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net)
// Portions Copyright © 1997-1999 Vita Nuova Limited
// Portions Copyright © 1997-1999 Vita Nuova Limited
// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com)
// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com)
...
@@ -925,10 +925,10 @@ jackpot:
...
@@ -925,10 +925,10 @@ jackpot:
}
}
Bputc
(
&
obuf
,
a
);
Bputc
(
&
obuf
,
a
);
Bputc
(
&
obuf
,
a
>>
8
);
Bputc
(
&
obuf
,
a
>>
8
);
Bputc
(
&
obuf
,
lineno
);
Bputc
(
&
obuf
,
stmtline
);
Bputc
(
&
obuf
,
lineno
>>
8
);
Bputc
(
&
obuf
,
stmtline
>>
8
);
Bputc
(
&
obuf
,
lineno
>>
16
);
Bputc
(
&
obuf
,
stmtline
>>
16
);
Bputc
(
&
obuf
,
lineno
>>
24
);
Bputc
(
&
obuf
,
stmtline
>>
24
);
zaddr
(
&
g2
->
from
,
sf
);
zaddr
(
&
g2
->
from
,
sf
);
zaddr
(
&
g2
->
to
,
st
);
zaddr
(
&
g2
->
to
,
st
);
...
...
src/cmd/ld/dwarf.c
View file @
2ad521c1
...
@@ -436,7 +436,7 @@ decodez(char *s)
...
@@ -436,7 +436,7 @@ decodez(char *s)
* The line history itself
* The line history itself
*/
*/
static
char
**
histfile
;
// [0] holds
the empty string
.
static
char
**
histfile
;
// [0] holds
"<eof>", DW_LNS_set_file arguments must be > 0
.
static
int
histfilesize
;
static
int
histfilesize
;
static
int
histfilecap
;
static
int
histfilecap
;
...
@@ -445,7 +445,7 @@ clearhistfile(void)
...
@@ -445,7 +445,7 @@ clearhistfile(void)
{
{
int
i
;
int
i
;
// [0] holds
the empty string.
// [0] holds
"<eof>"
for
(
i
=
1
;
i
<
histfilesize
;
i
++
)
for
(
i
=
1
;
i
<
histfilesize
;
i
++
)
free
(
histfile
[
i
]);
free
(
histfile
[
i
]);
histfilesize
=
0
;
histfilesize
=
0
;
...
@@ -756,12 +756,17 @@ writelines(void)
...
@@ -756,12 +756,17 @@ writelines(void)
newattr
(
dwinfo
->
child
,
DW_AT_low_pc
,
DW_CLS_ADDRESS
,
p
->
pc
,
0
);
newattr
(
dwinfo
->
child
,
DW_AT_low_pc
,
DW_CLS_ADDRESS
,
p
->
pc
,
0
);
for
(
q
=
p
;
q
!=
P
&&
(
q
==
p
||
q
->
as
!=
ATEXT
);
q
=
q
->
link
)
{
for
(
q
=
p
;
q
!=
P
&&
(
q
==
p
||
q
->
as
!=
ATEXT
);
q
=
q
->
link
)
{
epc
=
q
->
pc
;
epc
=
q
->
pc
;
lh
=
searchhist
(
q
->
line
);
lh
=
searchhist
(
q
->
line
);
if
(
lh
==
nil
)
{
if
(
lh
==
nil
)
{
diag
(
"corrupt history or bad absolute line: %P"
,
q
);
diag
(
"corrupt history or bad absolute line: %P"
,
q
);
continue
;
continue
;
}
}
if
(
lh
->
file
<
1
)
{
// 0 is the past-EOF entry.
diag
(
"instruction with linenumber past EOF in %s: %P"
,
unitname
,
q
);
continue
;
}
lline
=
lh
->
line
+
q
->
line
-
lh
->
absline
;
lline
=
lh
->
line
+
q
->
line
-
lh
->
absline
;
if
(
debug
[
'v'
]
>
1
)
if
(
debug
[
'v'
]
>
1
)
print
(
"%6llux %s[%lld] %P
\n
"
,
q
->
pc
,
histfile
[
lh
->
file
],
lline
,
q
);
print
(
"%6llux %s[%lld] %P
\n
"
,
q
->
pc
,
histfile
[
lh
->
file
],
lline
,
q
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment