aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/lib/dwarf.exp
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/lib/dwarf.exp')
-rw-r--r--gdb/testsuite/lib/dwarf.exp36
1 files changed, 30 insertions, 6 deletions
diff --git a/gdb/testsuite/lib/dwarf.exp b/gdb/testsuite/lib/dwarf.exp
index b347437..3a182c2 100644
--- a/gdb/testsuite/lib/dwarf.exp
+++ b/gdb/testsuite/lib/dwarf.exp
@@ -1072,7 +1072,10 @@ namespace eval Dwarf {
}
proc _section {name {flags ""} {type ""}} {
- if {$flags == "" && $type == ""} {
+ if {$name == ".debug_str"} {
+ # Hard-code this because it's always desirable.
+ _emit " .section $name, \"MS\", %progbits, 1"
+ } elseif {$flags == "" && $type == ""} {
_emit " .section $name"
} elseif {$type == ""} {
_emit " .section $name, \"$flags\""
@@ -3398,9 +3401,24 @@ namespace eval Dwarf {
# Add the strings in ARGS to the .debug_str section, and create a
# .debug_str_offsets section pointing to those strings.
- # BASE_OFFSET is the label for DW_AT_str_offsets_base.
- proc debug_str_offsets { base_offset args } {
- _section .debug_str
+ # Current options are:
+ # dwo 0|1 - boolean indicating if the sections have the dwo suffix.
+ # default = 0 (no .dwo suffix)
+ # base_offset label
+ # - generate label, to be used in DW_AT_str_offsets_base.
+ # default = "" (don't generate a label).
+ proc debug_str_offsets { options args } {
+ parse_options {
+ { dwo 0 }
+ { base_offset "" }
+ }
+
+ if { $dwo } {
+ _section .debug_str.dwo
+ } else {
+ _section .debug_str
+ }
+
set num 0
foreach arg $args {
set str_label [_compute_label "str_${num}"]
@@ -3412,12 +3430,18 @@ namespace eval Dwarf {
declare_labels debug_str_offsets_start debug_str_offsets_end
set initial_length "$debug_str_offsets_end - $debug_str_offsets_start"
- _section .debug_str_offsets
+ if { $dwo } {
+ _section .debug_str_offsets.dwo
+ } else {
+ _section .debug_str_offsets
+ }
_op .4byte $initial_length "Initial_length"
debug_str_offsets_start:
_op .2byte 0x5 "version"
_op .2byte 0x0 "padding"
- $base_offset:
+ if { $base_offset != "" } {
+ $base_offset:
+ }
set num 0
foreach arg $args {
set str_label [_compute_label "str_${num}"]