]> gitweb.factorcode.org Git - factor.git/commitdiff
debugger.unix: Get the signal name from a signal object too.
authorDoug Coleman <doug.coleman@gmail.com>
Fri, 1 Feb 2013 19:35:05 +0000 (11:35 -0800)
committerDoug Coleman <doug.coleman@gmail.com>
Fri, 1 Feb 2013 19:36:18 +0000 (11:36 -0800)
basis/debugger/unix/unix.factor

index 1eb916487cce6b223bcc21465a958ee441d0f750..c82c45d7f3744f20d0d8d53a0c12a21f48335c18 100644 (file)
@@ -1,6 +1,7 @@
 ! Copyright (C) 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: debugger io kernel math prettyprint sequences system ;
+USING: debugger io kernel math prettyprint sequences system
+io.launcher.unix accessors strings ;
 IN: debugger.unix
 
 CONSTANT: signal-names
@@ -13,7 +14,11 @@ CONSTANT: signal-names
     "SIGUSR1" "SIGUSR2"
 }
 
-: signal-name ( n -- str/f ) 1 - signal-names ?nth ;
+GENERIC: signal-name ( obj -- str/f )
+
+M: signal signal-name n>> signal-name ;
+
+M: integer signal-name ( n -- str/f ) 1 - signal-names ?nth ;
 
 : signal-name. ( n -- )
     signal-name [ " (" ")" surround write ] when* ;