Home | History | Annotate | Line # | Download | only in gdb.objc
      1  1.11  christos # Copyright 2003-2024 Free Software Foundation, Inc.
      2   1.1  christos 
      3   1.1  christos # This program is free software; you can redistribute it and/or modify
      4   1.1  christos # it under the terms of the GNU General Public License as published by
      5   1.1  christos # the Free Software Foundation; either version 3 of the License, or
      6   1.1  christos # (at your option) any later version.
      7   1.1  christos #
      8   1.1  christos # This program is distributed in the hope that it will be useful,
      9   1.1  christos # but WITHOUT ANY WARRANTY; without even the implied warranty of
     10   1.1  christos # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     11   1.1  christos # GNU General Public License for more details.
     12   1.1  christos #
     13   1.1  christos # You should have received a copy of the GNU General Public License
     14   1.1  christos # along with this program.  If not, see <http://www.gnu.org/licenses/>.
     15   1.1  christos 
     16   1.1  christos # This file tests decoding non-debuggable Objective-C symbols
     17   1.1  christos 
     18   1.1  christos # This file was written by Adam Fedor (fedor (at) gnu.org)
     19   1.1  christos 
     20   1.1  christos standard_testfile .m
     21   1.1  christos 
     22   1.1  christos #
     23   1.1  christos # Objective-C program compilation isn't standard. We need to figure out
     24   1.1  christos # which libraries to link in. Most of the time it uses pthread
     25   1.1  christos #
     26   1.1  christos if {[gdb_compile_objc "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list ] ] != "" } {
     27   1.1  christos   return -1
     28   1.1  christos }
     29   1.1  christos 
     30   1.1  christos proc do_objc_tests {} {
     31   1.1  christos     global binfile
     32  1.11  christos     clean_restart $binfile
     33   1.1  christos }
     34   1.1  christos 
     35   1.1  christos do_objc_tests
     36   1.1  christos 
     37   1.1  christos # Disable pending breakpoint query to avoid timeouts
     38   1.1  christos # if Obj-C symbols cannot be found
     39   1.1  christos gdb_test "set breakpoint pending off" "" "set breakpoint pending"
     40   1.1  christos 
     41   1.1  christos #
     42   1.1  christos # Break on multiply defined non-debuggable symbol (PR objc/1236)
     43   1.1  christos #
     44   1.1  christos set name "break on non-debuggable method"
     45   1.1  christos gdb_test_multiple "break someMethod" $name \
     46   1.1  christos {
     47   1.1  christos     -re "\\\[0\\\] cancel\r\n\\\[1\\\] all\r\n\\\[2\\\]\[ \]+-.NonDebug someMethod.*\\\[3\\\]\[ \]+-.NonDebug2 someMethod.*" {
     48   1.1  christos 	send_gdb "2\n"
     49   1.1  christos 	exp_continue
     50   1.1  christos     }
     51   1.1  christos     -re "\\\[0\\\] cancel\r\n\\\[1\\\] all\r\n> " {
     52   1.1  christos 	gdb_test "0" "" ""
     53   1.1  christos 	kfail "gdb/1236" $name
     54   1.1  christos     }
     55   1.1  christos     -re "Breakpoint \[0-9\]+ at 0x\[0-9a-f\]+.*$gdb_prompt $" { pass $name }
     56   1.1  christos     -re ".*$gdb_prompt $"   { kfail "gdb/1236" $name }
     57   1.1  christos }
     58   1.1  christos 
     59