mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-25 00:11:07 +00:00
02209e5455
Fixes #4947
38 lines
899 B
Plaintext
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"
|
|
}
|