summaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorCarl Love <cel@us.ibm.com>2024-01-02 17:45:55 -0500
committerCarl Love <cel@linux.ibm.com>2024-01-02 17:45:55 -0500
commit29deb4221d07d2c497183853e6023acb51d49be9 (patch)
treea182db1d5821150d9579ec3cde327166f81bda52 /gdb
parent528b729be1a293a21f44149351f3eba5b4e2d870 (diff)
Add gdb_compile options column-info and no-column-info
This patch adds two new options to gdb_compile to specify if the compile should or should not generate the line table information. The options are supported on clang and gcc version 7 and newer. Patch has been tested on PowerPC with both gcc and clang.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/testsuite/lib/gdb.exp34
1 files changed, 34 insertions, 0 deletions
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index eb8f6998b1e..9ac707be696 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -5150,6 +5150,8 @@ proc quote_for_host { args } {
# debug information
# - text_segment=addr: Tell the linker to place the text segment at ADDR.
# - build-id: Ensure the final binary includes a build-id.
+# - column-info/no-column-info: Enable/Disable generation of column table
+# information.
#
# And here are some of the not too obscure options understood by DejaGnu that
# influence the compilation:
@@ -5359,6 +5361,38 @@ proc gdb_compile {source dest type options} {
} else {
error "Don't know how to handle text_segment option."
}
+ } elseif { $opt == "column-info" } {
+ # If GCC or clang does not support column-info, compilation
+ # will fail and the usupported column-info option will be
+ # reported as such.
+ if {[test_compiler_info {gcc-*}]} {
+ lappend new_options "additional_flags=-gcolumn-info"
+
+ } elseif {[test_compiler_info {clang-*}]} {
+ lappend new_options "additional_flags=-gcolumn-info"
+
+ } else {
+ error "Option gcolumn-info not supported by compiler."
+ }
+
+ } elseif { $opt == "no-column-info" } {
+ if {[test_compiler_info {gcc-*}]} {
+ if {[test_compiler_info {gcc-[1-6]-*}]} {
+ # In this case, don't add the compile line option and
+ # the result will be the same as using no-column-info
+ # on a version that supports the option.
+ warning "gdb_compile option no-column-info not supported, ignoring."
+ } else {
+ lappend new_options "additional_flags=-gno-column-info"
+ }
+
+ } elseif {[test_compiler_info {clang-*}]} {
+ lappend new_options "additional_flags=-gno-column-info"
+
+ } else {
+ error "Option gno-column-info not supported by compiler."
+ }
+
} else {
lappend new_options $opt
}