genode/repos/os/run/monitor_gdb.run
2023-07-14 12:06:32 +02:00

38 lines
899 B
Plaintext

source ${genode_dir}/repos/os/run/monitor_gdb.inc
# sequence of GDB commands to execute at startup
set gdb_cmds ""
append gdb_cmds {-ex "target remote localhost:$local_port" }
append gdb_cmds {-ex "set style enabled off" }
# run GDB
eval spawn [gdb] debug/ld.lib.so -n $gdb_cmds
set gdb_id [list $spawn_id $genode_id]
puts ""
puts "----- test: dump memory -----"
puts ""
run_genode_until {\(gdb\)} 60 $gdb_id
send "x/x 0x1003e8b\n"
run_genode_until {\(gdb\)} 20 $gdb_id
if {![regexp {0x1003e8b:\t0x6f636e6f} $output]} {
puts stderr "*** Error: Dumped memory is not as expected"
}
puts ""
puts "----- test: write memory -----"
puts ""
send "set {int} 0x1003e8b = 0x12345678\n"
run_genode_until {\(gdb\)} 20 $gdb_id
send "x/x 0x1003e8b\n"
run_genode_until {\(gdb\)} 20 $gdb_id
if {![regexp {0x1003e8b:\t0x12345678} $output]} {
puts stderr "*** Error: Modified memory is not as expected"
}