Skip to content

Commit

Permalink
fbc: '-eunwind' command line option to enable stack unwind informatio…
Browse files Browse the repository at this point in the history
…n, implied by '-e', '-ex', '-exx'

- enables "-funwind-tables" link time option on '-gen gcc' 32-bit
- "-funwind-tables" always enabled on 64-bit targets
  • Loading branch information
jayrm committed May 20, 2022
1 parent 92d42b0 commit acdc604
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion changelog.txt
Expand Up @@ -20,7 +20,7 @@ Version 1.10.0
[added]
- gas64: '.cif_sections' and '.cif_' directives for stack unwinding (adeyblue)
- gas64: '.seh_' directives for stack unwinding (adeyblue)
- fbc: '-eunwind' command line option to enable stack unwind information
- fbc: '-eunwind' command line option to enable stack unwind information, implied by '-e', '-ex', '-exx'
- fbc: set bit value '__FB_ERR__' = &h200 if '-eunwind' is enabled
- gas64 : stack overflow check (total of all local variables) at compile time --> warning - stack size for linux = 8MB, for Windows = default or defined by user (SARG)
- gas64 : stack overflow check at run time if -exx is used - stack size for linux = 8MB, for Windows = default or defined by user (SARG)
Expand Down
4 changes: 3 additions & 1 deletion src/compiler/fbc.bas
Expand Up @@ -1866,6 +1866,7 @@ private sub handleOpt _
case OPT_EX
fbSetOption( FB_COMPOPT_ERRORCHECK, TRUE )
fbSetOption( FB_COMPOPT_RESUMEERROR, TRUE )
fbSetOption( FB_COMPOPT_UNWINDINFO, TRUE )

case OPT_EXX
fbSetOption( FB_COMPOPT_ERRORCHECK, TRUE )
Expand All @@ -1874,6 +1875,7 @@ private sub handleOpt _
fbSetOption( FB_COMPOPT_ERRLOCATION, TRUE )
fbSetOption( FB_COMPOPT_ARRAYBOUNDCHECK, TRUE )
fbSetOption( FB_COMPOPT_NULLPTRCHECK, TRUE )
fbSetOption( FB_COMPOPT_UNWINDINFO, TRUE )

case OPT_EXPORT
fbSetOption( FB_COMPOPT_EXPORT, TRUE )
Expand Down Expand Up @@ -3355,7 +3357,7 @@ private function hCompileStage2Module( byval module as FBCIOFILE ptr ) as intege

'' But enable unwind-tables on x64, these GREATLY increase the accuracy of
'' debuggers and crash tools across platforms for minimal overhead
if ( ism64Target ) then
if( (ism64Target = TRUE) or (fbGetOption( FB_COMPOPT_UNWINDINFO ) = TRUE) ) then
ln += "-funwind-tables "
else
ln += "-fno-unwind-tables "
Expand Down

0 comments on commit acdc604

Please sign in to comment.