mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-20 09:58:19 +08:00
[gdb/testsuite] Factor out dump_info in gdb.testsuite/dump-system-info.exp
Factor out new proc dump_info in test-case gdb.testsuite/dump-system-info.exp, and in the process: - fix a few typos - remove unnecessary "test -r /proc/cpuinfo" Tested on x86_64-linux. Co-Authored-By: Pedro Alves <pedro@palves.net>
This commit is contained in:
@ -15,34 +15,24 @@
|
|||||||
# The purpose of this test-case is to dump /proc/cpuinfo and similar system
|
# The purpose of this test-case is to dump /proc/cpuinfo and similar system
|
||||||
# info into gdb.log.
|
# info into gdb.log.
|
||||||
|
|
||||||
# Check if /proc/cpuinfo is available.
|
|
||||||
set res [remote_exec target "test -r /proc/cpuinfo"]
|
|
||||||
set status [lindex $res 0]
|
|
||||||
set output [lindex $res 1]
|
|
||||||
|
|
||||||
if { $status == 0 && $output == "" } {
|
proc dump_info {cmd {what ""}} {
|
||||||
verbose -log "Cpuinfo available, dumping:"
|
|
||||||
remote_exec target "cat /proc/cpuinfo"
|
if {$what == ""} {
|
||||||
} else {
|
set what $cmd
|
||||||
verbose -log "Cpuinfo not available"
|
}
|
||||||
|
|
||||||
|
set res [remote_exec target $cmd]
|
||||||
|
set status [lindex $res 0]
|
||||||
|
set output [lindex $res 1]
|
||||||
|
|
||||||
|
if { $status == 0 } {
|
||||||
|
verbose -log "$what available, dumping:\n$output"
|
||||||
|
} else {
|
||||||
|
verbose -log "$what not available"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
set res [remote_exec target "lsb_release -a"]
|
dump_info "cat /proc/cpuinfo" "Cpuinfo"
|
||||||
set status [lindex $res 0]
|
dump_info "uname -a"
|
||||||
set output [lindex $res 1]
|
dump_info "lsb_release -a"
|
||||||
|
|
||||||
if { $status == 0 } {
|
|
||||||
verbose -log "lsb_release -a availabe, dumping:\n$output"
|
|
||||||
} else {
|
|
||||||
verbose -log "lsb_release -a not available"
|
|
||||||
}
|
|
||||||
|
|
||||||
set res [remote_exec target "uname -a"]
|
|
||||||
set status [lindex $res 0]
|
|
||||||
set output [lindex $res 1]
|
|
||||||
|
|
||||||
if { $status == 0 } {
|
|
||||||
verbose -log "uname -a availabe, dumping:\n$output"
|
|
||||||
} else {
|
|
||||||
verbose -log "uname -a not available"
|
|
||||||
}
|
|
||||||
|
Reference in New Issue
Block a user