enhanced backtrace to show the main source file name
This commit is contained in:
10
lib/exec.c
10
lib/exec.c
@ -2427,12 +2427,12 @@ static HAK_INLINE int do_throw (hak_t* hak, hak_oop_t val, hak_ooi_t ip)
|
||||
if (f->dbgi != hak->_nil)
|
||||
{
|
||||
hak_dbgi_t* dbgi;
|
||||
hak_loc_t loc;
|
||||
const hak_ooch_t* fname;
|
||||
|
||||
dbgi = (hak_dbgi_t*)HAK_OBJ_GET_BYTE_SLOT(f->dbgi);
|
||||
HAK_MEMSET(&loc, 0, HAK_SIZEOF(loc));
|
||||
loc.file = dbgi[cip].fname;
|
||||
loc.line = dbgi[cip].sline;
|
||||
|
||||
fname = dbgi[cip].fname;
|
||||
if (!fname && hak->c) fname = hak->c->cci_arg.name;
|
||||
|
||||
/* TODO: include arguments? */
|
||||
HAK_LOG7(hak, HAK_LOG_IC | HAK_LOG_INFO, " %.*js%js%.*js(%js:%zu)\n",
|
||||
@ -2441,7 +2441,7 @@ static HAK_INLINE int do_throw (hak_t* hak, hak_oop_t val, hak_ooi_t ip)
|
||||
(c->owner == hak->_nil? oocstr_none: oocstr_colon),
|
||||
(c->name == hak->_nil? 0: HAK_OBJ_GET_SIZE(((hak_oop_char_t)c->name))),
|
||||
(c->name == hak->_nil? oocstr_none: ((hak_oop_char_t)c->name)->slot),
|
||||
(dbgi[cip].fname? dbgi[ip].fname: oocstr_dash), dbgi[cip].sline);
|
||||
(fname? fname: oocstr_dash), dbgi[cip].sline);
|
||||
}
|
||||
c = c->sender;
|
||||
if ((hak_oop_t)c == hak->_nil) break;
|
||||
|
@ -1789,7 +1789,6 @@ struct hak_t
|
||||
int tagged_brands[16];
|
||||
hak_oop_class_t* tagged_classes[16]; /* this is a pointer to hak_oop_class_t which is also a pointer */
|
||||
|
||||
|
||||
hak_oop_t* volat_stack[256]; /* stack for temporaries */
|
||||
hak_oow_t volat_count;
|
||||
|
||||
@ -1843,7 +1842,6 @@ struct hak_t
|
||||
} xbuf; /* buffer to support sprintf */
|
||||
} sprintf;
|
||||
|
||||
|
||||
hak_code_t code;
|
||||
|
||||
/* == PRINTER to udo stream == */
|
||||
|
@ -4240,11 +4240,7 @@ static HAK_INLINE int open_cci_stream (hak_t* hak, hak_io_cciarg_t* arg)
|
||||
bb->fn[0] = '\0';
|
||||
/*bb->fp = stdin;*/
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!arg->includer) /* if main stream */
|
||||
{
|
||||
/* HACK */
|
||||
HAK_ASSERT(hak, arg->name == HAK_NULL);
|
||||
arg->name = hak_dupbtooocstr(hak, bb->fn, HAK_NULL);
|
||||
|
Reference in New Issue
Block a user