help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: debugging failure


From: John W. Eaton
Subject: Re: debugging failure
Date: Tue, 27 Nov 2007 16:32:58 -0500

On 26-Nov-2007, David Bateman wrote:

| Ólafur Jens Sigurðsson wrote:
| > On Sun, Nov 25, 2007 at 09:06:08PM -0500, John Swensen wrote:
| >   
| >> On Nov 25, 2007, at 6:05 PM, Ólafur Jens Sigurðsson wrote:
| >>
| >>     
| >>> On Sun, Nov 25, 2007 at 10:32:09PM +0100, David Bateman wrote:
| >>>       
| >>>> I think you want "dbstop('pkg',1)" instead
| >>>>         
| >>> If I do that then I get the following:
| >>>
| >>> octave:36> dbstop('pkg',1)
| >>> ans =  179
| >>> octave:37> pkg('install', 'physicalconstants-0.1.2.tar.gz')
| >>> octave:38> dbwhere
| >>> error: dbwhere: must be inside of a user function to use dbwhere
| >>>
| >>> so it doesn't stop on the breakpoint.
| >>>
| >>> Any idea why that is?
| >>>
| >>> Oli
| >>> _______________________________________________
| >>> Help-octave mailing list
| >>> address@hidden
| >>> https://www.cae.wisc.edu/mailman/listinfo/help-octave
| >>>       
| >> If you call dbstop and the line number specified is not a 'executable' 
| >> line, then it will set the breakpoint at the next executable line.  If you 
| >> opened up the pkg.m file, I would suspect that the first executable line 
is 
| >> 179.  And to find a list of the breakpoints, you should use dbstatus.  
| >> dbwhere is used when in debug mode to find out where you are at.
| >>     
| >
| > Ok, so what I did should have stopped on line 179 in the pkg.m file
| > but didn't by some reason. Any idea what might have happend there?
| >
| > Oli
| >
| >   
| line 179 of pkg is a persistent command, then is not executed except for
| the first time pkg is loaded, which is also why dbstop('pkg',1) didn't
| work.. You need to place the brakpoint on an executable line for example
| dbstop('pkg', 185);

Please try the following patch.

Also, please report bugs to the address@hidden list.

Thanks,

jwe


src/ChangeLog:

2007-11-27  John W. Eaton  <address@hidden>

        * pt-bp.cc (tree_breakpoint::visit_decl_command): Also check line
        number of cmd.
        * pt-decl.cc (tree_global_command::eval, tree_static_command::eval):
        Insert MAYBE_DO_BREAKPOINT here.
 

Index: src/pt-bp.cc
===================================================================
RCS file: /cvs/octave/src/pt-bp.cc,v
retrieving revision 1.25
diff -u -u -r1.25 pt-bp.cc
--- src/pt-bp.cc        12 Oct 2007 21:27:33 -0000      1.25
+++ src/pt-bp.cc        27 Nov 2007 21:31:07 -0000
@@ -186,6 +186,9 @@
   if (found)
     return;
 
+  if (cmd.line () >= line)
+    take_action (cmd);
+
   tree_decl_init_list *init_list = cmd.initializer_list ();
 
   if (init_list)
Index: src/pt-decl.cc
===================================================================
RCS file: /cvs/octave/src/pt-decl.cc,v
retrieving revision 1.26
diff -u -u -r1.26 pt-decl.cc
--- src/pt-decl.cc      12 Oct 2007 21:27:33 -0000      1.26
+++ src/pt-decl.cc      27 Nov 2007 21:31:07 -0000
@@ -30,6 +30,7 @@
 #include "pt-cmd.h"
 #include "ov.h"
 #include "oct-lvalue.h"
+#include "pt-bp.h"
 #include "pt-decl.h"
 #include "pt-exp.h"
 #include "pt-id.h"
@@ -165,6 +166,8 @@
 void
 tree_global_command::eval (void)
 {
+  MAYBE_DO_BREAKPOINT;
+
   if (init_list)
     {
       init_list->eval (do_init);
@@ -216,6 +219,8 @@
 void
 tree_static_command::eval (void)
 {
+  MAYBE_DO_BREAKPOINT;
+
   // Static variables only need to be marked and initialized once.
 
   if (init_list && ! initialized)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]