-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This option is used to generate extra debug information. i.e DWARFv4 `flang -gdwarf-4 -gpubnames test.c` will generate `.debug_pubnames` and `.debug_pubtypes` in the executable. DWARFv5 `flang -gdwarf-5 -gpubnames test.c` will generate `.debug_names` in the executable. Prior to this change these sections were getting generated by default. These sections were extra and may or maynot be used by the debugger. Hence generation of these sections are bind to this `-gpubnames` option. This behavior is analogous to `clang`, `gcc`, gfortran.
- Loading branch information
Showing
5 changed files
with
55 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
!RUN: %flang %s -gdwarf-5 -c -o - | llvm-readelf -S - | FileCheck %s --check-prefix=NONAMESECTION | ||
!RUN: %flang %s -g -c -o - | llvm-readelf -S - | FileCheck %s --check-prefix=NOPUBNAMESECTION | ||
|
||
!RUN: %flang %s -gdwarf-5 -gpubnames -c -o - | llvm-readelf -S - | FileCheck %s --check-prefix=NAMESECTION | ||
!RUN: %flang %s -g -gpubnames -c -o - | llvm-readelf -S - | FileCheck %s --check-prefix=PUBNAMESECTION | ||
|
||
!Ensure that `.debug_names` or `.debug_pubnames` are NOT present by default. | ||
!NONAMESECTION-NOT: .debug_names | ||
!NOPUBNAMESECTION-NOT: .debug_pubnames | ||
!Ensure that `.debug_names` or `.debug_pubnames` are present when `-gpubnames` is specified. | ||
!NAMESECTION: .debug_names | ||
!PUBNAMESECTION: .debug_pubnames | ||
|
||
PROGRAM main | ||
END PROGRAM main | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters