@@ -1337,7 +1337,7 @@ def do_commands(self, arg):
13371337 complete_commands = _complete_bpnumber
13381338
13391339 def do_break (self , arg , temporary = False ):
1340- """b(reak) [ ( [filename:]lineno | function) [, condition] ]
1340+ """b(reak) [ [filename:]( lineno | function) [, condition] ]
13411341
13421342 Without argument, list all breaks.
13431343
@@ -1347,9 +1347,9 @@ def do_break(self, arg, temporary=False):
13471347 present, it is a string specifying an expression which must
13481348 evaluate to true before the breakpoint is honored.
13491349
1350- The line number may be prefixed with a filename and a colon,
1351- to specify a breakpoint in another file (probably one that
1352- hasn't been loaded yet). The file is searched for on
1350+ The line number and function may be prefixed with a filename and
1351+ a colon, to specify a breakpoint in another file (probably one
1352+ that hasn't been loaded yet). The file is searched for on
13531353 sys.path; the .py suffix may be omitted.
13541354 """
13551355 if not arg :
@@ -1388,8 +1388,13 @@ def do_break(self, arg, temporary=False):
13881388 try :
13891389 lineno = int (arg )
13901390 except ValueError :
1391- self .error ('Bad lineno: %s' % arg )
1392- return
1391+ func = arg
1392+ ok , filename , ln = find_function (func , self .canonic (filename ))
1393+ if not ok :
1394+ self .error ('Bad lineno or function name: %s' % arg )
1395+ return
1396+ funcname = ok
1397+ lineno = int (ln )
13931398 else :
13941399 # no colon; can be lineno or function
13951400 try :
0 commit comments