Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/compiler/ast-node-misc.bas
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ end function
function astNewDBG _
( _
byval op as integer, _
byval ex as integer, _
byval filename As ZString Ptr _
byval ex as integer, _
byval filename As ZString Ptr _
) as ASTNODE ptr

dim as ASTNODE ptr n = any
Expand All @@ -166,14 +166,14 @@ function astNewDBG _

n->dbg.op = op
n->dbg.ex = ex
n->dbg.filename = filename
n->dbg.filename = filename

function = n
end function

function astLoadDBG( byval n as ASTNODE ptr ) as IRVREG ptr
if( ast.doemit ) then
irEmitDBG( n->dbg.op, astGetProc( )->sym, n->dbg.ex, n->dbg.filename )
irEmitDBG( n->dbg.op, astGetProc( )->sym, n->dbg.ex, n->dbg.filename )
end if

function = NULL
Expand Down
12 changes: 6 additions & 6 deletions src/compiler/ast.bi
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,9 @@ type AST_NODE_JMPTB
end type

type AST_NODE_DBG
ex as integer
filename as zstring ptr
op as integer
ex as integer
filename as zstring ptr
op as integer
end type

type AST_NODE_MEM
Expand Down Expand Up @@ -794,9 +794,9 @@ declare function astNewASM( byval asmtokhead as ASTASMTOK ptr ) as ASTNODE ptr

declare function astNewDBG _
( _
byval op as integer, _
byval ex as integer = 0, _
byval filename as zstring ptr = 0 _
byval op as integer, _
byval ex as integer = 0, _
byval filename as zstring ptr = 0 _
) as ASTNODE ptr

declare function astNewMEM _
Expand Down
78 changes: 39 additions & 39 deletions src/compiler/edbg_stab.bas
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,10 @@ sub edbgEmitHeader( byval filename as zstring ptr )

ctx.typecnt = 1
ctx.label = NULL
ctx.incfile = NULL
'' ctx.filename is never used
ctx.filename = *filename
ctx.incfile = NULL

'' ctx.filename is never used
ctx.filename = *filename

'' emit source file name
lname = *symbUniqueLabel( )
Expand Down Expand Up @@ -267,13 +267,13 @@ sub edbgLineBegin _
( _
byval proc as FBSYMBOL ptr, _
byval lnum as integer, _
byval pos_ as integer, _
ByVal filename As zstring ptr _
byval pos_ as integer, _
ByVal filename As zstring ptr _
)

if( env.clopt.debuginfo = FALSE ) then
exit sub
end if
end if

if( ctx.lnum > 0 ) then
ctx.pos = pos_ - ctx.pos
Expand All @@ -283,8 +283,8 @@ sub edbgLineBegin _
end if
end if

edbgInclude( filename )
edbgInclude( filename )

ctx.pos = pos_
ctx.lnum = lnum
if( ctx.isnewline ) then
Expand Down Expand Up @@ -534,7 +534,7 @@ sub edbgEmitProcHeader _

''
ctx.isnewline = TRUE
ctx.lnum = 0
ctx.lnum = 0
ctx.pos = 0
ctx.label = NULL

Expand Down Expand Up @@ -649,7 +649,7 @@ sub edbgEmitProcFooter _

''
ctx.isnewline = TRUE
ctx.lnum = 0
ctx.lnum = 0
ctx.pos = 0
ctx.label = NULL

Expand Down Expand Up @@ -1018,32 +1018,32 @@ end sub

sub edbgInclude( byval incfile as zstring ptr )
dim as string lname
'' NOTE: originally, fbc used STAB_TYPE_BINCL and STAB_TYPE_EINCL
'' to mark the beginning and end of an include file. The purpose
'' for these markers is so the linker (LD) can remove duplicate
'' debug type information from the final EXE. However, because
'' fbc only emits types actually used, the end result is that
'' type information from a header (.BI) is often different from
'' one object module to another is generally not used in the
'' way that BINCL/EINCL/EXCL was intented.

'' incfile is the new include file or main file name

'' coming from _close incfile is null so no real need to change
If( incfile = NULL )Then
Exit Sub
EndIf

'' Already handling the correct name
if( incfile = ctx.incfile ) Then
exit sub
end If
emitSECTION( IR_SECTION_CODE, 0 )
lname = *symbUniqueLabel( )
hEmitSTABS( STAB_TYPE_SOL, incfile, 0, 0, lname )
hLABEL( lname )

ctx.incfile = incfile

'' NOTE: originally, fbc used STAB_TYPE_BINCL and STAB_TYPE_EINCL
'' to mark the beginning and end of an include file. The purpose
'' for these markers is so the linker (LD) can remove duplicate
'' debug type information from the final EXE. However, because
'' fbc only emits types actually used, the end result is that
'' type information from a header (.BI) is often different from
'' one object module to another is generally not used in the
'' way that BINCL/EINCL/EXCL was intented.

'' incfile is the new include file or main file name

'' coming from _close incfile is null so no real need to change
If( incfile = NULL )Then
Exit Sub
EndIf

'' Already handling the correct name
if( incfile = ctx.incfile ) Then
exit sub
end If

emitSECTION( IR_SECTION_CODE, 0 )
lname = *symbUniqueLabel( )
hEmitSTABS( STAB_TYPE_SOL, incfile, 0, 0, lname )
hLABEL( lname )

ctx.incfile = incfile
end sub
16 changes: 8 additions & 8 deletions src/compiler/emit.bas
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ sub emitFlush( )
case EMIT_NODECLASS_DBG
cast( EMIT_DBGCB, emit.opFnTb[n->dbg.op] )( n->dbg.sym, _
n->dbg.lnum, _
n->dbg.pos, _
n->dbg.filename )
n->dbg.pos, _
n->dbg.filename )

end select

Expand Down Expand Up @@ -457,8 +457,8 @@ private function hNewDBG _
byval op as integer, _
byval sym as FBSYMBOL ptr, _
byval lnum as integer = 0, _
byval pos_ as integer = 0, _
byval filename As zstring ptr = 0 _
byval pos_ as integer = 0, _
byval filename As zstring ptr = 0 _
) as EMIT_NODE ptr static

dim as EMIT_NODE ptr n
Expand All @@ -468,7 +468,7 @@ private function hNewDBG _
n->dbg.op = op
n->dbg.sym = sym
n->dbg.lnum = lnum
n->dbg.filename = filename
n->dbg.filename = filename
n->dbg.pos = pos_

function = n
Expand Down Expand Up @@ -1635,11 +1635,11 @@ end function
function emitDBGLineBegin _
( _
byval proc as FBSYMBOL ptr, _
byval lnum as integer, _
byval filename As zstring ptr _
byval lnum as integer, _
byval filename As zstring ptr _
) as EMIT_NODE ptr

function = hNewDBG( EMIT_OP_LINEINI, proc, lnum, emit.pos, filename )
function = hNewDBG( EMIT_OP_LINEINI, proc, lnum, emit.pos, filename )

end function

Expand Down
10 changes: 5 additions & 5 deletions src/compiler/emit.bi
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ type EMIT_DBGNODE
op as integer
sym as FBSYMBOL ptr
lnum as integer
filename as zstring ptr
filename as zstring ptr
pos as integer
end type

Expand Down Expand Up @@ -262,8 +262,8 @@ type EMIT_MEMCB as sub( byval dvreg as IRVREG ptr, _

type EMIT_DBGCB as sub( byval sym as FBSYMBOL ptr, _
byval lnum as integer, _
byval pos as Integer, _
ByVal filename As ZString Ptr =0 )
byval pos as Integer, _
ByVal filename As ZString Ptr =0 )

'' if changed, update the _vtbl symbols at emit_*.bas::*_ctor
type EMIT_VTBL
Expand Down Expand Up @@ -792,8 +792,8 @@ declare function emitSTKCLEAR _
declare function emitDBGLineBegin _
( _
byval proc as FBSYMBOL ptr, _
byval ex as Integer, _
ByVal filename As ZString Ptr _
byval ex as Integer, _
ByVal filename As ZString Ptr _
) as EMIT_NODE ptr

declare function emitDBGLineEnd _
Expand Down
6 changes: 3 additions & 3 deletions src/compiler/emit_x86.bas
Original file line number Diff line number Diff line change
Expand Up @@ -6049,11 +6049,11 @@ private sub _emitLINEINI _
( _
byval proc as FBSYMBOL ptr, _
byval lnum as integer, _
byval pos_ as integer, _
byval filename As zstring ptr _
byval pos_ as integer, _
byval filename As zstring ptr _
)

edbgLineBegin( proc, lnum, pos_, filename )
edbgLineBegin( proc, lnum, pos_, filename )

end sub

Expand Down
4 changes: 2 additions & 2 deletions src/compiler/emitdbg.bi
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ declare sub edbgLineBegin _
( _
byval proc as FBSYMBOL ptr, _
byval lnum as integer, _
byval pos as integer, _
byval filename as zstring ptr _
byval pos as integer, _
byval filename as zstring ptr _
)

declare sub edbgLineEnd _
Expand Down
24 changes: 12 additions & 12 deletions src/compiler/ir-llvm.bas
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ declare sub _emitDBG _
( _
byval op as integer, _
byval proc as FBSYMBOL ptr, _
byval lnum as integer, _
ByVal filename As zstring ptr = 0 _
byval lnum as integer, _
ByVal filename As zstring ptr = 0 _
)
declare function hVregToStr( byval vreg as IRVREG ptr ) as string
declare sub hEmitConvert( byval v1 as IRVREG ptr, byval v2 as IRVREG ptr )
Expand Down Expand Up @@ -2081,18 +2081,18 @@ private sub _emitDBG _
( _
byval op as integer, _
byval proc as FBSYMBOL ptr, _
byval lnum as integer, _
ByVal filename As zstring ptr _
byval lnum as integer, _
ByVal filename As zstring ptr _
)

if( op = AST_OP_DBG_LINEINI ) Then
if( filename <> NULL ) then
hWriteLine( "#line " & lnum & " """ & hReplace( filename, "\", $"\\" ) & """" )
else
hWriteLine( "#line " & lnum & " """ & hReplace( env.inf.name, "\", $"\\" ) & """" )
end if
ctx.linenum = lnum
end If
if( op = AST_OP_DBG_LINEINI ) Then
if( filename <> NULL ) then
hWriteLine( "#line " & lnum & " """ & hReplace( filename, "\", $"\\" ) & """" )
else
hWriteLine( "#line " & lnum & " """ & hReplace( env.inf.name, "\", $"\\" ) & """" )
end if
ctx.linenum = lnum
end If

end sub

Expand Down
26 changes: 13 additions & 13 deletions src/compiler/ir-tac.bas
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ declare sub hFlushDBG _
( _
byval op as integer, _
byval proc as FBSYMBOL ptr, _
byval ex as integer, _
ByVal filename As zstring ptr _
byval ex as integer, _
ByVal filename As zstring ptr _
)

declare sub hFlushLIT( byval op as integer, byval text as zstring ptr )
Expand Down Expand Up @@ -295,8 +295,8 @@ private sub _emit _
byval v2 as IRVREG ptr, _
byval vr as IRVREG ptr, _
byval ex1 as FBSYMBOL ptr = NULL, _
byval ex2 as integer = 0, _
byval ex3 as zstring ptr = 0 _
byval ex2 as integer = 0, _
byval ex3 as zstring ptr = 0 _
) static

dim as IRTAC ptr t
Expand All @@ -319,8 +319,8 @@ private sub _emit _

t->ex1 = ex1
t->ex2 = ex2
t->ex3 = ex3
t->ex3 = ex3

ctx.taccnt += 1

end sub
Expand Down Expand Up @@ -682,11 +682,11 @@ private sub _emitDBG _
( _
byval op as integer, _
byval proc as FBSYMBOL ptr, _
byval ex as integer, _
byval filename as zstring ptr _
byval ex as integer, _
byval filename as zstring ptr _
)

_emit( op, NULL, NULL, NULL, proc, ex, filename )
_emit( op, NULL, NULL, NULL, proc, ex, filename )

end sub

Expand Down Expand Up @@ -1365,7 +1365,7 @@ private sub _flush static
hFlushMEM( op, v1, v2, t->ex2, t->ex1 )

case AST_NODECLASS_DBG
hFlushDBG( op, t->ex1, t->ex2, t->ex3 )
hFlushDBG( op, t->ex1, t->ex2, t->ex3 )

case AST_NODECLASS_LIT
hFlushLIT( op, cast( any ptr, t->ex1 ) )
Expand Down Expand Up @@ -2401,13 +2401,13 @@ private sub hFlushDBG _
( _
byval op as integer, _
byval proc as FBSYMBOL ptr, _
byval ex as integer, _
ByVal filename As zstring ptr _
byval ex as integer, _
ByVal filename As zstring ptr _
)

select case as const op
case AST_OP_DBG_LINEINI
emitDBGLineBegin( proc, ex, filename )
emitDBGLineBegin( proc, ex, filename )

case AST_OP_DBG_LINEEND
emitDBGLineEnd( proc, ex )
Expand Down
Loading