rev 315 - in trunk: . include/prothon src
SVN User <[email protected]>
| Newsgroups | gmane.comp.lang.prothon.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: mark
Date: 2004-04-10 01:14:24 -0400 (Sat, 10 Apr 2004)
New Revision: 315
Modified:
trunk/STATUS.txt
trunk/include/prothon/prothon.h
trunk/src/builtins-thread.c
trunk/src/interp.c
trunk/src/lock.c
trunk/src/main.c
trunk/src/thread.h
Log:
using -i option (interactive console) after running file
leaves globals and locals viewable now
Modified: trunk/STATUS.txt
===================================================================
--- trunk/STATUS.txt 2004-04-10 01:49:41 UTC (rev 314)
+++ trunk/STATUS.txt 2004-04-10 05:14:24 UTC (rev 315)
@@ -11,7 +11,6 @@
--- -d -m -l cmd-line options missing
--- memory bounds -> mem-mgr priorities
---- -i interactive console needs globals and locals from main1 module
--- flesh out dlls, list.sort!(), dict stuff, string %
Modified: trunk/include/prothon/prothon.h
===================================================================
--- trunk/include/prothon/prothon.h 2004-04-10 01:49:41 UTC (rev 314)
+++ trunk/include/prothon/prothon.h 2004-04-10 05:14:24 UTC (rev 315)
@@ -209,6 +209,7 @@
int running;
isp ist;
frame_p frame;
+ int save_frame;
} pr_thread_t;
typedef pr_thread_t* pr_thread_p;
Modified: trunk/src/builtins-thread.c
===================================================================
--- trunk/src/builtins-thread.c 2004-04-10 01:49:41 UTC (rev 314)
+++ trunk/src/builtins-thread.c 2004-04-10 05:14:24 UTC (rev 315)
@@ -190,8 +190,8 @@
return new_string_obj(ist, name);
}
-DEF(Thread, __objlist__, NULL) {
- return OBJ(NONE);
+DEF(Thread, __objlist__, FORM_RPARAM) {
+ return parms[1];
}
MAIN_MODULE_INIT(Thread) {
Modified: trunk/src/interp.c
===================================================================
--- trunk/src/interp.c 2004-04-10 01:49:41 UTC (rev 314)
+++ trunk/src/interp.c 2004-04-10 05:14:24 UTC (rev 315)
@@ -1400,8 +1400,10 @@
if (frame) ist->frame->next_frame = new_frame;
new_frame->prev_frame = ist->frame;
ist->frame = new_frame;
- if (module && (thread = get_attr(ist, module, sym(ist, "thread"))))
+ if (module && (thread = get_attr(ist, module, sym(ist, "thread"))) && thread_saveframe(thread)) {
+ new_frame->do_not_free = TRUE;
thread_frame(thread) = new_frame;
+ }
if_exc_return FALSE;
exec_loop(ist); if_exc_return FALSE;
if (dest_module){
Modified: trunk/src/lock.c
===================================================================
--- trunk/src/lock.c 2004-04-10 01:49:41 UTC (rev 314)
+++ trunk/src/lock.c 2004-04-10 05:14:24 UTC (rev 315)
@@ -71,7 +71,6 @@
int obj_wrlock_waiting;
-
//********************************* get_wrlock ********************************
void get_wrlock(obj_p obj, int force_wait) {
if (!force_wait && lock((obj)->wrlock)) return;
Modified: trunk/src/main.c
===================================================================
--- trunk/src/main.c 2004-04-10 01:49:41 UTC (rev 314)
+++ trunk/src/main.c 2004-04-10 05:14:24 UTC (rev 315)
@@ -140,6 +140,8 @@
if (main_argv_obj && list_len(ist, main_argv_obj)) {
main1_thread_obj = new_thread_obj(ist, (apr_thread_start_t)main_thread, main_argv_obj);
main1_thread_ptr = main1_thread_obj->data.ptr;
+ if (cmd_line_option_i_flg)
+ main1_thread_ptr->save_frame = TRUE;
}
threads = get_attr(ist, sys_argv_obj, sym(ist, "threads"));
Modified: trunk/src/thread.h
===================================================================
--- trunk/src/thread.h 2004-04-10 01:49:41 UTC (rev 314)
+++ trunk/src/thread.h 2004-04-10 05:14:24 UTC (rev 315)
@@ -63,7 +63,8 @@
//extern DECLARE_PR_LOCK(thread_registry_lock);
extern pr_lock_t thread_registry_lock;
-#define thread_frame(thread_obj) (((pr_thread_p)((thread_obj)->data.ptr))->frame)
+#define thread_saveframe(thread_obj) (((pr_thread_p)((thread_obj)->data.ptr))->save_frame)
+#define thread_frame(thread_obj) (((pr_thread_p)((thread_obj)->data.ptr))->frame)
obj_p register_thread(isp ist, apr_thread_t *this_thread);
obj_p new_thread_obj(isp ist, apr_thread_start_t thread_func, void *thread_data);