[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Class Objects Usage
From: |
John W. Eaton |
Subject: |
Re: Class Objects Usage |
Date: |
Wed, 09 Jul 2008 16:18:55 -0400 |
On 9-Jul-2008, Fred Schuld wrote:
| I added the "call stack changes" from JWE changeset on 2008-07-08 in case
| there was a relationship between Class Objects not working and the latest
| changeset:
|
| src/ChangeLog
| src/debug.cc
| src/ls-mat5.cc
| src/mex.cc
| src/ov-fcn-handle.cc
| src/ov-usr-fcn.cc
| src/parse.y
| src/symtab.cc
| src/symtab.h
| src/toplev.cc
| src/toplev.h
|
| And did a make with these new source files, followed with a make install.
Did you only apply this one changeset? I'd recommend updating to the
current sources, not just applying a single patch, which might depend
on others.
| Now an exception occurs when starting octave.exe
|
| I traced it with the MSVC debugger from the initialize_version_info();
| method in octave.cc to where it descends to load_path in load-path.cc:
|
| load_path::do_set (const std::string& p, bool warn)
| {
| do_clear ();
|
| std::list<std::string> elts = split_path (p);
|
| // Temporarily disable add hook.
|
| unwind_protect_fptr (add_hook);
|
| add_hook = 0;
|
| for (std::list<std::string>:: const_iterator i = elts.begin ();
| i != elts.end ();
| i++)
| do_append (*i, warn);
|
| // Restore add hook and execute for all newly added directories.
|
| unwind_protect::run ();
|
| for (dir_info_list_iterator i = dir_info_list.begin ();
| i != dir_info_list.end ();
| i++)
| {
| if (add_hook)
| add_hook (i->dir_name);
| }
| }
|
|
| Generates an exception at add_hook(i->dir_name). It seems to make it
| through the first 3 directories (dir_name)
| 0) .
| 1) C:\NEWMSVC\Share\Octave\site\m
| 2) C:\NEWMSVC\Share\Octave\site\m\Startup
| 3) C:\NEWMSVC\libexec\Octave\3.0.0+\oct\i686-pc-msvc with as the dir_name
| add_hook(i->dir_name) generates exception
|
| These paths do exist in my Octave installation on the PC
|
| Anyways, it descends into execute_pkg_add_or_del and then descends to
| parse.y (one of JWE's update files) for directory (3) case:
|
|
| void
| source_file (const std::string& file_name, const std::string& context,
| bool verbose, bool require_file, const std::string& warn_for)
| {
| std::string file_full_name = file_ops::tilde_expand (file_name);
|
| unwind_protect::begin_frame ("source_file");
|
| unwind_protect_str (curr_fcn_file_name);
| unwind_protect_str (curr_fcn_file_full_name);
|
| curr_fcn_file_name = file_name;
| curr_fcn_file_full_name = file_full_name;
|
| if (! context.empty ())
| {
| if (context == "caller")
| octave_call_stack::goto_caller_frame ();
| else if (context == "base")
| octave_call_stack::goto_base_frame ();
| else
| error ("source: context must be \"caller\" or \"base\"");
|
| if (! error_state)
| unwind_protect::add (octave_call_stack::unwind_pop);
| }
|
| if (! error_state)
| {
| octave_function *fcn = parse_fcn_fil
|
|
| Context = "base" so the code descends to toplev.h:
|
| static void goto_base_frame (void)
| {
| if (instance_ok ())
| instance->do_goto_base_frame ();
| }
|
| Which descends to
|
| static bool instance_ok (void)
| {
| bool retval = true;
|
| if (! instance)
| instance = new octave_call_stack ();
|
|
| Which descends to Microsofts new.cpp:
|
| operator new function .....
|
| It successfully allocates the memory.
|
| Then the following:
|
| octave_call_stack::do_goto_base_frame (void)
| {
| call_stack_elt tmp (cs[0]);
| tmp.prev = curr_frame;
|
| curr_frame = cs.size ();
|
| cs.push_back (tmp);
|
| symbol_table::set_scope_and_context (tmp.scope, tmp.context);
| }
|
| It breaks after call_stack_elt tmp (cs[0]); which calls deque
|
| I am not sure what is wrong - any hints are appreciated.
I think I've fixed this now.
jwe