473,396 Members | 1,814 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

setting a breakpoint in the module

Hi,

I have two modules: a.py and b.py. In a.py, I have a function called
aFunc(). I'm calling aFunc() from b.py (of course I import module a first).
The question is how to directly set a breakpoint in aFunc().

The way I'm doing now is to set a breakpoint in b.py at the line to call
aFunc(), 'c' to it, then 's' to step in, then set the breakpoint inside
aFunc() by 'b lineNumber'. It's too cumbersome.

Thanks.
Jason

Aug 23 '06 #1
6 1932
Jason Jiang wrote:
Hi,

I have two modules: a.py and b.py. In a.py, I have a function called
aFunc(). I'm calling aFunc() from b.py (of course I import module a first).
The question is how to directly set a breakpoint in aFunc().

The way I'm doing now is to set a breakpoint in b.py at the line to call
aFunc(), 'c' to it, then 's' to step in, then set the breakpoint inside
aFunc() by 'b lineNumber'. It's too cumbersome.

Thanks.
Jason
What debugger are you using?

Aug 23 '06 #2
I'm using Python pdb module pdb.py.

"Simon Forman" <ro*********@yahoo.comwrote in message
news:11**********************@74g2000cwt.googlegro ups.com...
Jason Jiang wrote:
>Hi,

I have two modules: a.py and b.py. In a.py, I have a function called
aFunc(). I'm calling aFunc() from b.py (of course I import module a
first).
The question is how to directly set a breakpoint in aFunc().

The way I'm doing now is to set a breakpoint in b.py at the line to call
aFunc(), 'c' to it, then 's' to step in, then set the breakpoint inside
aFunc() by 'b lineNumber'. It's too cumbersome.

Thanks.
Jason

What debugger are you using?

--
http://mail.python.org/mailman/listinfo/python-list


Aug 23 '06 #3
Jason Jiang wrote:
"Simon Forman" <ro*********@yahoo.comwrote in message
news:11**********************@74g2000cwt.googlegro ups.com...
Jason Jiang wrote:
Hi,

I have two modules: a.py and b.py. In a.py, I have a function called
aFunc(). I'm calling aFunc() from b.py (of course I import module a
first).
The question is how to directly set a breakpoint in aFunc().

The way I'm doing now is to set a breakpoint in b.py at the line to call
aFunc(), 'c' to it, then 's' to step in, then set the breakpoint inside
aFunc() by 'b lineNumber'. It's too cumbersome.

Thanks.
Jason
What debugger are you using?

I'm using Python pdb module pdb.py.
So, can't you just issue the command:

(Pdb) b a.py:aFunc

or

(Pdb) b a.py:lineNumber

where "lineNumber" is a line number in a.py within aFunc()?
http://docs.python.org/lib/debugger-commands.html

Peace,
~Simon

Aug 23 '06 #4
Great! It's working now. Thank you so much.

Jason

"Simon Forman" <ro*********@yahoo.comwrote in message
news:11*********************@m73g2000cwd.googlegro ups.com...
Jason Jiang wrote:
>"Simon Forman" <ro*********@yahoo.comwrote in message
news:11**********************@74g2000cwt.googlegr oups.com...
Jason Jiang wrote:
Hi,

I have two modules: a.py and b.py. In a.py, I have a function called
aFunc(). I'm calling aFunc() from b.py (of course I import module a
first).
The question is how to directly set a breakpoint in aFunc().

The way I'm doing now is to set a breakpoint in b.py at the line to
call
aFunc(), 'c' to it, then 's' to step in, then set the breakpoint
inside
aFunc() by 'b lineNumber'. It's too cumbersome.

Thanks.
Jason

What debugger are you using?

I'm using Python pdb module pdb.py.

So, can't you just issue the command:

(Pdb) b a.py:aFunc

or

(Pdb) b a.py:lineNumber

where "lineNumber" is a line number in a.py within aFunc()?
http://docs.python.org/lib/debugger-commands.html

Peace,
~Simon

--
http://mail.python.org/mailman/listinfo/python-list


Aug 23 '06 #5
"Jason Jiang" <ji********@gmail.comwrites:
Hi,

I have two modules: a.py and b.py. In a.py, I have a function called
aFunc(). I'm calling aFunc() from b.py (of course I import module a first).
The question is how to directly set a breakpoint in aFunc().

The way I'm doing now is to set a breakpoint in b.py at the line to call
aFunc(), 'c' to it, then 's' to step in, then set the breakpoint inside
aFunc() by 'b lineNumber'. It's too cumbersome.
You can also add in your source

import pdb; pdb.set_trace()

at the point you want the debugger to stop. Useful if you want to
break after some failing condition, for instance.

--
|>|\/|<
/--------------------------------------------------------------------------\
|David M. Cooke
|cookedm(at)physics(dot)mcmaster(dot)ca
Aug 23 '06 #6
Jason Jiang wrote:
Great! It's working now. Thank you so much.

Jason
You're welcome, it's a pleasure! :-D

~Simon

Aug 23 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: chris | last post by:
hello I have a project with two imported dll's. I try to put a breakpoint in the main project in one of the modules of the DLL ... Some breakpoints are hit but in one module no breakpoints are...
8
by: Hazz | last post by:
What is the triggering action that raises the event which causes my breakpoint to be reached, repeatedly, but does not allow my form to ever remain visible. I set a breakpoint on the line...
13
by: Brett Baisley | last post by:
At school, we do all of our coding in emacs, but I am trying to get the example apps working at home using Visual C++.net. In the example, there are 4 .cpp files (canvas.cpp, main.cpp,...
10
by: johndoe | last post by:
While creating a shopping cart application I noticed a strange bug which resulted in the Constructor and everything being called twice. I was using Inherited classes ClassShowProducts inherited...
4
by: Rodger Dusatko | last post by:
In VB .NET I am having problems setting breaks. I want the break to be independant of any single function: for example: err.number or global variables When I try to set a break with the 'Data'...
0
by: Jason Jiang | last post by:
Hi, I have two modules: a.py and b.py. In a.py, I have a function called aFunc(). I'm calling aFunc() from b.py (of course I import module a first). The question is how to directly set a...
5
by: Jerry Spence1 | last post by:
In VB6 you could set a breakpoint when a variable had changed value. I can't find this in VB2005. Is it there somewhere? -Jerry
27
by: geniet | last post by:
Hello all of you, I have some problem in setting cells values (or fromat or...) in my Excel spreadsheet using a VB statement like within my Module: Range("C1").Value = 20 I have this in a...
6
by: ARC | last post by:
This is strange... I set a break point on a form's code module, and then after a bit, shut down the main program file. Now whenever I click the button for the form, it opens the code module, with a...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.