aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.dwarf2/dw2-opt-structptr.exp
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.dwarf2/dw2-opt-structptr.exp')
-rw-r--r--gdb/testsuite/gdb.dwarf2/dw2-opt-structptr.exp116
1 files changed, 58 insertions, 58 deletions
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-opt-structptr.exp b/gdb/testsuite/gdb.dwarf2/dw2-opt-structptr.exp
index 486a4e8..76b9591 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-opt-structptr.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-opt-structptr.exp
@@ -44,82 +44,82 @@ proc build_test_program {} {
# Creating a CU with 4-byte addresses lets this test link on
# both 32- and 64-bit machines.
cu { addr_size 4 } {
-
+
DW_TAG_compile_unit {
- {DW_AT_language @DW_LANG_C99}
- {DW_AT_name $srcfile}
- {DW_AT_comp_dir /tmp}
+ DW_AT_language @DW_LANG_C99
+ DW_AT_name $srcfile
+ DW_AT_comp_dir /tmp
} {
declare_labels int_label struct_label pointer_label \
array_label
int_label: DW_TAG_base_type {
- {DW_AT_byte_size 4 DW_FORM_sdata}
- {DW_AT_encoding @DW_ATE_signed}
- {DW_AT_name integer}
+ DW_AT_byte_size 4 DW_FORM_sdata
+ DW_AT_encoding @DW_ATE_signed
+ DW_AT_name integer
}
-
+
array_label: DW_TAG_array_type {
- {DW_AT_name foo__array_type}
- {DW_AT_type :$int_label}
+ DW_AT_name foo__array_type
+ DW_AT_type :$int_label
} {
DW_TAG_subrange_type {
- {DW_AT_type :$int_label}
- {DW_AT_lower_bound 0 DW_FORM_data1}
- {DW_AT_upper_bound 127 DW_FORM_data1}
- }
+ DW_AT_type :$int_label
+ DW_AT_lower_bound 0 DW_FORM_data1
+ DW_AT_upper_bound 127 DW_FORM_data1
+ }
}
-
+
struct_label: DW_TAG_structure_type {
- {DW_AT_name "foo"}
- {DW_AT_byte_size 12 DW_FORM_sdata}
+ DW_AT_name "foo"
+ DW_AT_byte_size 12 DW_FORM_sdata
} {
member {
- {name a}
- {type :$int_label}
- {data_member_location 0 data1}
+ DW_AT_name a
+ DW_AT_type :$int_label
+ DW_AT_data_member_location 0 data1
}
member {
- {name x}
- {type :$array_label}
- {data_member_location 4 data1}
+ DW_AT_name x
+ DW_AT_type :$array_label
+ DW_AT_data_member_location 4 data1
}
member {
- {name y}
- {type :$pointer_label}
- {data_member_location 8 data1}
+ DW_AT_name y
+ DW_AT_type :$pointer_label
+ DW_AT_data_member_location 8 data1
}
}
-
+
pointer_label: DW_TAG_pointer_type {
- {DW_AT_byte_size 4 DW_FORM_sdata}
- {DW_AT_type :$struct_label}
+ DW_AT_byte_size 4 DW_FORM_sdata
+ DW_AT_type :$struct_label
}
-
+
DW_TAG_subprogram {
- {DW_AT_name func01}
- {DW_AT_type :$int_label}
- {external 1 flag}
- {MACRO_AT_func {func01}}
+ DW_AT_name func01
+ DW_AT_type :$int_label
+ DW_AT_external 1 flag
+ MACRO_AT_func {func01}
} {
DW_TAG_variable {
- {DW_AT_name ptr}
- {DW_AT_type :$pointer_label}
- {DW_AT_location {} DW_FORM_block1}
+ DW_AT_name ptr
+ DW_AT_type :$pointer_label
+ DW_AT_location {} DW_FORM_block1
}
}
-
+
DW_TAG_subprogram {
- {DW_AT_name main}
- {DW_AT_type :$int_label}
- {external 1 flag}
- {MACRO_AT_func {main}}
+ DW_AT_name main
+ DW_AT_type :$int_label
+ DW_AT_external 1 flag
+ MACRO_AT_func {main}
} {
}
}
}
}
-
+
set sources "$srcfile $asm_file"
if {[build_executable "failed to compile" $testfile $sources {nodebug}]} {
return -1
@@ -134,7 +134,7 @@ set re_address_class "@\[^\r\n\]+"
proc do_console_test {} {
global binfile
- clean_restart $binfile
+ clean_restart $::testfile
with_test_prefix "console" {
gdb_test_no_output "set print object on"
@@ -146,17 +146,17 @@ proc do_console_test {} {
if {![runto func01]} {
return -1
}
-
+
gdb_test "info addr ptr" "Symbol \"ptr\" is optimized out."
-
+
gdb_test "print ptr" "<optimized out>"
-
+
gdb_test "print *ptr" "value has been optimized out"
-
+
gdb_test "print ptr->a" "value has been optimized out"
-
+
gdb_test "print ptr->x" "value has been optimized out"
-
+
gdb_test "print ptr->y" "value has been optimized out"
}
}
@@ -171,19 +171,19 @@ proc do_mi_test {} {
global mi_gdb_prompt
global binfile
-
+
with_test_prefix "mi" {
- if {[mi_clean_restart $binfile]} {
+ if {[mi_clean_restart $::testfile]} {
return
}
-
+
# This causes GDB to dereference a pointer-to-structure when doing
# -var-create.
mi_gdb_test "-gdb-set print object on" ".*" "set print object on"
-
+
mi_gdb_test "-break-insert main" ".*" "insert breakpoint main"
mi_gdb_test "-break-insert func01" ".*" "insert breakpoint func01"
-
+
# Run to main. Use an explicit expect here since the limited
# debug info will result in output that isn't handled by the
# MI test utilities.
@@ -197,7 +197,7 @@ proc do_mi_test {} {
fail "$test (timeout)"
}
}
-
+
# Run to func01. Use an explicit expect here as above.
set test "continue to func01"
mi_send_resuming_command "exec-continue" "$test"
@@ -209,14 +209,14 @@ proc do_mi_test {} {
fail "$test (timeout)"
}
}
-
+
# Test that -var-create for 'ptr' is successful.
mi_create_varobj "var1" "ptr" "create varobj for ptr"
set struct_foo_ptr \
[string cat \
[string_to_regexp "struct foo *"] "( $::re_address_class)?"]
-
+
# Test that -var-list-children of 'ptr' is successful.
mi_list_varobj_children "var1" \
[list \