Re: Debuggers



TheSaint <fc14301589@xxxxxxxxxxx> writes:

On 19:21, venerdì 13 giugno 2008 R. Bernstein wrote:

I'm not completely sure what you mean, but I gather that in
post-mortem debugging you'd like to inspect local variables defined at the
place of error.

Yes, exactly. This can be seen with pdb, but not pydb.
If I'm testing a piece of code and it breaks, then I'd like to see the
variables and find which of them doesn't go as expected.

Python as a language is a little different than say Ruby. In Python
the handler for the exception is called *after* the stack is unwound

I'm not doing comparison with other languages. I'm simply curious to know why
pydb don't keep variables like pdb.

If you are simply curious, then a guess is that the frame from the
traceback (t) isn't set by pydb's post_mortem method in calling the
Pdb interaction() method, whereas it does get set in the corresponding
pdb post_mortem code.

It's possible this is a bug -- it's all in the details. But if it is a
bug or a feature improvement, probably a better place to to request a
change would be in the tracker for the pydb project:

http://sourceforge.net/tracker/?group_id=61395

Should you go this route, I'd suggest giving the smallest program and
scenario that exhibits the problem but also has a different behavior
in pdb. There are programming interfaces to post-mortem debugging in
pdb and pydb, namely post_mortem() and pm(); so best is a short self
contained program that when run sets up as much of this as possible.

And if the bug is accepted and fixed such a short-self contained
program would get turned into a test case and incluide to the set
regression tests normally run.


Final, I agreed the idea to restart the debugger when an exception is trow.
It could be feasible to let reload the file and restart. Some time I can
re-run the program , as the error is fixed, but sometime pdb doesn't
recognize the corrections applied.

The restart that I submitted as a patch to pdb two and a half years
ago is what I call a "warm" restart: no Python code is actually
reloaded. The reason ti was done way is that is a simple way to
maintain the debugger settings such as breakpoints; also it requires
saving less knowledge about how the program was initially run so it
might be applicable in more contexts.

The down side though, in addition to what you've noticed with regards
to files which have changed, is that global state may be different
going into the program when it is restarted.

In the last pydb release, 1.23 a "save" command was added to so that
breakpoints and other debugger state could be saved across debug
sessions which includes a "cold" or "exec" restart.

I mean that after a post-mortem event, the debugger should forget all
variables and reload the program, which meanwhile could be debugged.

--
Mailsweeper Home : http://it.geocities.com/call_me_not_now/index.html
.



Relevant Pages

  • RE: pdb files for assemblies in GAC?
    ... the .pdb file to the same file folder in the gac. ... debugger, I saw that it loaded the symbols from the gac location. ... put the symbol files there. ... Microsoft Online Community Support ...
    (microsoft.public.dotnet.framework)
  • RE: pdb files for assemblies in GAC?
    ... The debugger needs a way to find the pdb ... If all the pdb files are placed in the installation ... assume the pdb files are in the same folder as the assembly. ... Microsoft Online Community Support ...
    (microsoft.public.dotnet.framework)
  • Re: pdb bug and questions
    ... Subject: pdb bug and questions ... I'm trying to embed a debugger into an editor. ... (pdb, pydb, rpdb2, smart debugger, extended debugger? ... This looks like a bug to me. ...
    (comp.lang.python)
  • Debuggers
    ... while testing my program I found some strange happening with pdb and pydb. ... some case pdb doesn't recognize a fix after a post-mortem restart. ... program within Ipython itself. ...
    (comp.lang.python)
  • Re: Debugging question
    ... The Visual Studio debugger uses the project.PDB file created by the ... If the debugger cannot find the PDB file at that location or ... Path specified in the solution's Property Pages (Common Properties ... Are you sure the PDB matches the version of the DLL you're loading? ...
    (microsoft.public.dotnet.framework.compactframework)