Various fixes

db4
Slava Pestov 2008-07-30 04:12:17 -05:00
parent 75c077ebd5
commit 279aeddeb3
7 changed files with 45 additions and 39 deletions

View File

@ -4,3 +4,4 @@ IN: bootstrap.threads
USE: io.thread
USE: threads
USE: debugger.threads

View File

@ -4,7 +4,7 @@ IN: concurrency.mailboxes
USING: dlists dequeues threads sequences continuations
destructors namespaces random math quotations words kernel
arrays assocs init system concurrency.conditions accessors
debugger ;
debugger debugger.threads ;
TUPLE: mailbox threads data disposed ;

View File

@ -5,10 +5,10 @@ kernel math namespaces prettyprint prettyprint.config sequences
assocs sequences.private strings io.styles io.files vectors
words system splitting math.parser classes.tuple continuations
continuations.private combinators generic.math classes.builtin
classes compiler.units generic.standard vocabs threads
threads.private init kernel.private libc io.encodings accessors
math.order destructors source-files parser classes.tuple.parser
effects.parser lexer compiler.errors dlists generic.parser
classes compiler.units generic.standard vocabs init
kernel.private io.encodings accessors math.order
destructors source-files parser classes.tuple.parser
effects.parser lexer compiler.errors generic.parser
strings.parser ;
IN: debugger
@ -245,33 +245,6 @@ M: no-compilation-unit error.
M: no-vocab summary
drop "Vocabulary does not exist" ;
M: bad-ptr summary
drop "Memory allocation failed" ;
M: double-free summary
drop "Free failed since memory is not allocated" ;
M: realloc-error summary
drop "Memory reallocation failed" ;
: error-in-thread. ( thread -- )
"Error in thread " write
[
dup thread-id #
" (" % dup thread-name %
", " % dup thread-quot unparse-short % ")" %
] "" make swap write-object ":" print nl ;
! Hooks
M: thread error-in-thread ( error thread -- )
initial-thread get-global eq? [
die drop
] [
global [
error-thread get-global error-in-thread. print-error flush
] bind
] if ;
M: encode-error summary drop "Character encoding error" ;
M: decode-error summary drop "Character decoding error" ;
@ -348,9 +321,6 @@ M: object compiler-error. ( error word -- )
nl
print-error ;
M: empty-dlist summary ( dlist -- )
drop "Empty dlist" ;
M: bad-effect summary
drop "Bad stack effect declaration" ;

View File

@ -0,0 +1,22 @@
! Copyright (C) 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors debugger continuations threads threads.private
io io.styles prettyprint kernel math.parser namespaces ;
IN: debugger.threads
: error-in-thread. ( thread -- )
"Error in thread " write
[
dup id>> #
" (" % dup name>> %
", " % dup quot>> unparse-short % ")" %
] "" make swap write-object ":" print nl ;
M: thread error-in-thread ( error thread -- )
initial-thread get-global eq? [
die drop
] [
global [
error-thread get-global error-in-thread. print-error flush
] bind
] if ;

View File

@ -1,7 +1,8 @@
! Copyright (C) 2007, 2008 Mackenzie Straight, Doug Coleman,
! Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: combinators kernel math sequences accessors dequeues ;
USING: combinators kernel math sequences accessors dequeues
summary ;
IN: dlists
TUPLE: dlist front back length ;
@ -80,6 +81,9 @@ M: dlist push-back* ( obj dlist -- dlist-node )
ERROR: empty-dlist ;
M: empty-dlist summary ( dlist -- )
drop "Empty dlist" ;
M: dlist peek-front ( dlist -- obj )
front>> [ obj>> ] [ empty-dlist ] if* ;

View File

@ -3,7 +3,7 @@
! Copyright (C) 2007, 2008 Doug Coleman
! See http://factorcode.org/license.txt for BSD license.
USING: alien assocs continuations destructors kernel
namespaces accessors sets ;
namespaces accessors sets summary ;
IN: libc
<PRIVATE
@ -34,13 +34,22 @@ PRIVATE>
ERROR: bad-ptr ;
M: bad-ptr summary
drop "Memory allocation failed" ;
: check-ptr ( c-ptr -- c-ptr )
[ bad-ptr ] unless* ;
ERROR: double-free ;
M: double-free summary
drop "Free failed since memory is not allocated" ;
ERROR: realloc-error ptr size ;
M: realloc-error summary
drop "Memory reallocation failed" ;
<PRIVATE
: add-malloc ( alien -- )

View File

@ -26,7 +26,7 @@ namespaces continuations layouts accessors ;
[ t ] [ 1300000 small-enough? ] unit-test
[ "staging.math-compiler-ui-strip.image" ] [
[ "staging.threads-math-compiler-ui-strip.image" ] [
"hello-ui" deploy-config
[ bootstrap-profile staging-image-name file-name ] bind
] unit-test
@ -79,7 +79,7 @@ M: quit-responder call-responder*
[
<dispatcher>
add-quot-responder
"resource:basis/http/test" <static> >>default
"resource:extra/http/test" <static> >>default
main-responder set
test-httpd