@@ -13,7 +13,9 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Test reading/writing variables with non-trivial DWARF locations.
+# Test reading/writing variables with non-trivial DWARF locations. In
+# particular the test uses register- and memory locations as well as
+# composite locations with register- and memory pieces.
load_lib dwarf.exp
@@ -51,8 +53,6 @@ Dwarf::assemble $asm_file {
global srcdir subdir srcfile
global dwarf_regnum regname
- set main_func \
- [function_range main [list ${srcdir}/${subdir}/$srcfile]]
set buf_var [gdb_target_symbol buf]
cu {} {
@@ -112,10 +112,8 @@ Dwarf::assemble $asm_file {
}
DW_TAG_subprogram {
- {name "main"}
+ {MACRO_AT_func { main ${srcdir}/${subdir}/${srcfile} }}
{DW_AT_external 1 flag}
- {low_pc [lindex $main_func 0] DW_FORM_addr}
- {high_pc [lindex $main_func 1] DW_FORM_udata}
} {
# Simple memory location.
DW_TAG_variable {
@@ -125,7 +123,8 @@ Dwarf::assemble $asm_file {
addr $buf_var
} SPECIAL_expr}
}
- # Memory pieces.
+ # Memory pieces: two bytes from &buf[2], and two bytes
+ # from &buf[0].
DW_TAG_variable {
{name "s1"}
{type :$struct_s_label}
@@ -137,7 +136,8 @@ Dwarf::assemble $asm_file {
piece 2
} SPECIAL_expr}
}
- # Register- and memory pieces.
+ # Register- and memory pieces: one byte each from r0,
+ # &buf[4], r1, and &buf[5].
DW_TAG_variable {
{name "s2"}
{type :$struct_s_label}