diff options
Diffstat (limited to 'gdb/testsuite/gdb.mi/mi-file.exp')
-rw-r--r-- | gdb/testsuite/gdb.mi/mi-file.exp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/gdb/testsuite/gdb.mi/mi-file.exp b/gdb/testsuite/gdb.mi/mi-file.exp index 6107496..0ce4fd6 100644 --- a/gdb/testsuite/gdb.mi/mi-file.exp +++ b/gdb/testsuite/gdb.mi/mi-file.exp @@ -14,9 +14,6 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# Please email any bugs, comments, and/or additions to this file to: -# bug-gdb@prep.ai.mit.edu - # # Test essential Machine interface (MI) operations # @@ -54,8 +51,19 @@ proc test_file_list_exec_source_file {} { set srcfilepath [string_to_regexp ${srcdir}/${subdir}/${srcfile}] # get the path and absolute path to the current executable + # + # In gdb 6.2 (at least), the default line number is set by + # select_source_symtab to the first line of "main" minus + # the value of "lines_to_list" (which defaults to 10) plus one. + # --chastain 2004-08-13 + + set line_main_head [gdb_get_line_number "main ("] + set line_main_body [expr $line_main_head + 2] + set gdb_lines_to_list 10 + set line_default [expr $line_main_body - $gdb_lines_to_list + 1] + mi_gdb_test "111-file-list-exec-source-file" \ - "111\\\^done,line=\"23\",file=\"${srcfilepath}\",fullname=\"/.*/${srcfile}\"" \ + "111\\\^done,line=\"$line_default\",file=\"${srcfilepath}\",fullname=\"/.*/${srcfile}\"" \ "request path info of current source file (${srcfile})" } |