set argv ""
gdb_test_multiple "frame" "frame without styling" {
- -re -wrap "main \\(argc=.*, (argv=$hex)\\).*style\\.c:\[0-9\].*" {
+ -re -wrap "main \\(argc=.*, (argv=$hex.*)\\).*style\\.c:\[0-9\].*" {
set argv $expect_out(1,string)
pass $gdb_test_name
}
set file_expr "$base_file_expr:\[0-9\]+"
set arg_expr [limited_style "arg." variable]
+ # On some embedded targets that don't fully support argc/argv,
+ # argv may print as "0x0" or as an address with a symbol name
+ # following, so use a regexp general enough to match that and
+ # do not make assumptions about how long the address string is.
gdb_test "frame" \
[multi_line \
- "#0\\s+$main_expr\\s+\\($arg_expr=$decimal,\\s+$arg_expr=$hex\\)\\s+at\\s+$file_expr" \
+ "#0\\s+$main_expr\\s+\\($arg_expr=$decimal,\\s+$arg_expr=$hex.*\\)\\s+at\\s+$file_expr" \
"\[0-9\]+\\s+.*return.* break here .*"]
gdb_test "info breakpoints" "$main_expr at $file_expr.*"
# the line listing; this is why the words from the source
# code are spelled out in the final result line of the
# test.
+ set re0_styled \
+ [multi_line \
+ "#0\\s+$main_expr\\s+\\($arg_expr=$decimal,\\s+$arg_expr=$hex\\)" \
+ "\\s+at\\s+$file_expr" \
+ "\[0-9\]+\\s+.*return.* break here .*"]
set re1_styled \
[multi_line \
"#0\\s+$main_expr\\s+\\($arg_expr=$decimal,\\s+" \
- "\\s+$arg_expr=$hex\\)" \
+ "\\s+$arg_expr=$hex.*\\)" \
"\\s+at\\s+$file_expr" \
"\[0-9\]+\\s+.*return.* break here .*"]
set re2_styled \
[multi_line \
"#0\\s+$main_expr\\s+\\($arg_expr=.*" \
- "\\s+$arg_expr=$hex\\)\\s+at\\s+$file_expr" \
+ "\\s+$arg_expr=$hex.*\\)\\s+at\\s+$file_expr" \
"\[0-9\]+\\s+.*return.* break here .*"]
# The length of the line containing argv containing:
# - closing parenthesis
set line_len [expr 4 + $argv_len + 1]
- if { $line_len > $width } {
+ if { $argv == "argv=0x0" && $width >= 27 } {
+ # Embedded target with no argv support.
+ # #0 main (argc=0, argv=0x0)
+ set re_styled $re0_styled
+ } elseif { $line_len > $width } {
# At on the next line.
set re_styled $re1_styled
} else {