GDB prompts for input when breakpoint not found

"Jon Beniston" <[email protected]>
Newsgroups gmane.comp.sysutils.dejagnu.bugs
Message-ID <[email protected]>
Hi,

It appears there is a slight bug in gdb-comm.exp:gdb_comm_add_breakpoint()
for some versions of GDB.

When GDB returns "Function.*not defined", it appears that in some cases, GDB
prompts for input. E.g:

Function "abort" not defined.
Make breakpoint pending on future shared library load? (y or [n])

This is not handled by gdb_comm_add_breakpoint().

Changing the function to this, might fix it:

proc gdb_comm_add_breakpoint { function } {
    global gdb_prompt

    remote_send host "break $function\n"
    remote_expect host 60 {
	-re "Breakpoint.*$gdb_prompt $" { return "" }
	-re "Function.*not defined.*Make breakpoint pending on future shared
library load.*$" { 
            remote_send host "n\n" 
            remote_expect host 60 {
                -re "*$gdb_prompt $" { return "undef" }
                default { return "untested" }
            }
        }
	-re "Function.*not defined.*$gdb_prompt $" { return "undef" }
	-re "No symbol table.*$gdb_prompt $" { return "undef" }
	default {
	    return "untested"
	}
    }
}

Cheers,
Jon
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.