mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-21 22:47:50 +00:00
gdb: adapt gdb_monitor run scripts
Adjustment are required due to changes of the new run tool and the new shared library implementation. Issue #1192
This commit is contained in:
parent
322be1b4fb
commit
57c4678aa1
@ -22,8 +22,8 @@ proc gdb_main_breakpoint_cmds { target_binary_name } {
|
||||
# load the symbols of ld.lib.so
|
||||
append gdb_cmds {-ex "symbol-file bin/ld.lib.so" }
|
||||
|
||||
# set a breakpoint in the 'call_program_main()' function
|
||||
append gdb_cmds {-ex "b call_program_main" }
|
||||
# set a breakpoint in the 'Linker::Binary::call_entry_point' function
|
||||
append gdb_cmds {-ex "b Linker::Binary::call_entry_point" }
|
||||
|
||||
# continue execution until the breakpoint triggers
|
||||
append gdb_cmds {-ex "c" }
|
||||
@ -37,6 +37,9 @@ proc gdb_main_breakpoint_cmds { target_binary_name } {
|
||||
# set a breakpoint in the application's 'main()' function
|
||||
append gdb_cmds {-ex "b main()" }
|
||||
|
||||
# set search path for "sharedlibrary" to bin
|
||||
append gdb_cmds {-ex "set solib-search-path bin" }
|
||||
|
||||
# load the symbols of loaded shared libraries
|
||||
append gdb_cmds {-ex "sharedlibrary" }
|
||||
|
||||
|
@ -114,6 +114,7 @@ append qemu_args " -serial chardev:uart "
|
||||
append qemu_args " -chardev socket,id=uart,port=$local_port,host=localhost,server,nowait "
|
||||
|
||||
run_genode_until {.*Remote debugging using /dev/terminal.*} 30
|
||||
set genode_id [output_spawn_id]
|
||||
|
||||
puts "GDB monitor is up, starting GDB"
|
||||
|
||||
@ -168,9 +169,11 @@ append gdb_cmds {-ex "q" }
|
||||
|
||||
# run GDB and redirect stderr to stdio to get the relevant output into the expect buffer
|
||||
eval spawn [gdb] bin/$gdb_target_binary -n -batch $gdb_cmds 2&>1
|
||||
set gdb_id $spawn_id
|
||||
|
||||
set timeout 120
|
||||
expect {
|
||||
-i [list $genode_id $gdb_id]
|
||||
timeout { puts stderr "Error: Test execution timed out"; exit -2 }
|
||||
}
|
||||
|
||||
@ -185,7 +188,7 @@ if {![regexp {Breakpoint 2, main ()} $gdb_output]} {
|
||||
exit -1
|
||||
}
|
||||
|
||||
if {![regexp {Breakpoint 3, puts ()} $gdb_output]} {
|
||||
if {![regexp {Breakpoint 3, puts (.*)} $gdb_output]} {
|
||||
puts "Error: Breakpoint in shared library did not trigger"
|
||||
exit -1
|
||||
}
|
||||
|
@ -123,6 +123,6 @@ puts "command: [gdb] bin/$gdb_target_binary $gdb_cmds"
|
||||
|
||||
exec [terminal] -e "[gdb] bin/test-gdb_monitor $gdb_cmds" &
|
||||
|
||||
interact
|
||||
interact -i [output_spawn_id]
|
||||
|
||||
# vi: set ft=tcl :
|
||||
|
Loading…
Reference in New Issue
Block a user