Example #1
0
char* Except::callstack() const
	{
	OstreamStr oss;
	for (int i = 0; i < calls_->size(); ++i)
		oss << endl << calls_->get(i).getdata("fn");
	return oss.str();
	}
Example #2
0
Value su_syminfo()
	{
	int n_symbols = symbols.size() / sizeof (SuSymbol);
	OstreamStr os;
	os << "Symbols: Count " << n_symbols << " (max " << MAX_SYMBOLS << "), " <<
		"Size " << names.size() << " (max " << NAMES_SPACE << ")";
	return new SuString(os.str());
	}
Example #3
0
char* callStackString()
	{
	OstreamStr stk;
	gcstring indent = "";
	for (Frame* f = tls().proc->fp; f > tls().proc->frames; --f)
		{
		stk << endl << indent;
		if (f->fn)
			stk << f->fn;
		else if (f->prim)
			stk << f->prim;
		indent += "  ";
		}
	return stk.str();
	}
Example #4
0
char* Func::params() const {
	OstreamStr out;
	out << "(";
	short j = 0;
	for (int i = 0; i < nparams; ++i) {
		if (i != 0)
			out << ",";
		if (i == nparams - rest)
			out << "@";
		if (flags && (flags[i] & DYN))
			out << "_";
		out << symstr(locals[i]);
		if (i >= nparams - ndefaults - rest && i < nparams - rest)
			out << "=" << literals[j++];
	}
	out << ")";
	return out.str();
}
Example #5
0
// used for "function call overflow" and "value stack overflow"
void except_log_stack_()
	{
	static bool first = true;
	const char* stk = "";
	if (first)
		{
		first = false;
		stk = callStackString();
		}
	errlog(os.str(), stk);
	except_();
	}
Example #6
0
Value SuFunction::call(Value self, Value member, short nargs, short nargnames,
	short* argnames, int each) {
	static Value Disasm("Disasm");
	static Value Source("Source");

	if (member == CALL) {
		args(nargs, nargnames, argnames, each);

		if (flags)
			dotParams(self);

		Framer frame(this, self);
		return tls().proc->fp->run();
	} else if (member == Disasm) {
		NOARGS("function.Disasm()");
		OstreamStr oss;
		disasm(oss);
		return new SuString(oss.str());
	} else if (member == Source) {
		return new SuString(src);
	} else
		return Func::call(self, member, nargs, nargnames, argnames, each);
}
Example #7
0
const char* DbmsQueryLocal::explain()
	{
	OstreamStr os;
	os << q;
	return os.str();
	}
Example #8
0
void except_() {
	alert(os.str());
	exit(EXIT_FAILURE);
}
Example #9
0
// to allow setting breakpoints
void except_err_()
	{
	Except e(os.str());
	os.clear();
	throw e;
	}