guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] GNU Guile branch, master, updated. release_1-9-12-60-gfb


From: Andy Wingo
Subject: [Guile-commits] GNU Guile branch, master, updated. release_1-9-12-60-gfb5c4dc
Date: Thu, 23 Sep 2010 15:46:42 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

http://git.savannah.gnu.org/cgit/guile.git/commit/?id=fb5c4dc52337603e7526a1f944533ce8217a9e29

The branch, master has been updated
       via  fb5c4dc52337603e7526a1f944533ce8217a9e29 (commit)
      from  3db15dce0012c5f384fa9b1628b35913aa0b62ba (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit fb5c4dc52337603e7526a1f944533ce8217a9e29
Author: Andy Wingo <address@hidden>
Date:   Thu Sep 23 17:49:55 2010 +0200

    add ,break-at-source
    
    * module/system/vm/trap-state.scm (add-trap-at-source-location!): New
      proc.
    * module/system/repl/command.scm (break-at-source): New repl
      meta-command. Doesn't work as well as it could now because it doesn't
      know about nested functions, but that's coming.

-----------------------------------------------------------------------

Summary of changes:
 module/system/repl/command.scm  |   13 ++++++++++++-
 module/system/vm/trap-state.scm |   14 +++++++++++++-
 2 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/module/system/repl/command.scm b/module/system/repl/command.scm
index a052b93..54cd34d 100644
--- a/module/system/repl/command.scm
+++ b/module/system/repl/command.scm
@@ -57,7 +57,8 @@
     (profile  (time t) (profile pr) (trace tr))
     (debug    (backtrace bt) (up) (down) (frame fr)
               (procedure proc) (locals) (error-message error)
-              (break br bp) (tracepoint tp)
+              (break br bp) (break-at-source break-at bs)
+              (tracepoint tp)
               (traps) (delete del) (disable) (enable))
     (inspect  (inspect i) (pretty-print pp))
     (system   (gc) (statistics stat) (option o)
@@ -580,6 +581,16 @@ Starts a recursive prompt when PROCEDURE is called."
         (let ((idx (add-trap-at-procedure-call! proc)))
           (format #t "Trap ~a: ~a.~%" idx (trap-name idx))))))
 
+(define-meta-command (break-at-source repl file line)
+  "break-at-source FILE LINE
+Break when control reaches the given source location.
+
+Starts a recursive prompt when control reaches line LINE of file FILE.
+Note that the given source location must be inside a procedure."
+  (let ((file (if (symbol? file) (symbol->string file) file)))
+    (let ((idx (add-trap-at-source-location! file line)))
+      (format #t "Trap ~a: ~a.~%" idx (trap-name idx)))))
+
 (define-meta-command (tracepoint repl (form))
   "tracepoint PROCEDURE
 Add a tracepoint to PROCEDURE.
diff --git a/module/system/vm/trap-state.scm b/module/system/vm/trap-state.scm
index ca6bb3e..42033b2 100644
--- a/module/system/vm/trap-state.scm
+++ b/module/system/vm/trap-state.scm
@@ -37,7 +37,8 @@
             install-trap-handler!
 
             add-trap-at-procedure-call!
-            add-trace-at-procedure-call!))
+            add-trace-at-procedure-call!
+            add-trap-at-source-location!))
 
 (define %default-trap-handler (make-fluid))
 
@@ -208,6 +209,17 @@
       idx #t trap
       (format #f "Tracepoint at ~a" proc)))))
 
+(define* (add-trap-at-source-location! file line
+                                       #:optional (trap-state 
(the-trap-state)))
+  (let* ((idx (next-index! trap-state))
+         (trap (trap-at-source-location file line
+                                        (handler-for-index trap-state idx))))
+    (add-trap-wrapper!
+     trap-state
+     (make-trap-wrapper
+      idx #t trap
+      (format #f "Breakpoint at ~a:~a" file line)))))
+
 (define* (add-trap! trap name #:optional (trap-state (the-trap-state)))
   (let* ((idx (next-index! trap-state)))
     (add-trap-wrapper!


hooks/post-receive
-- 
GNU Guile



reply via email to

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