mirror of
https://github.com/matrix-construct/construct
synced 2024-12-27 07:54:05 +01:00
ircd::mods::ldso: Improve exceptions for undefined symbols.
This commit is contained in:
parent
42f02d2aa7
commit
6b69fe2d24
1 changed files with 28 additions and 4 deletions
|
@ -267,21 +267,45 @@ _dl_signal_exception(int errcode,
|
||||||
struct dl_exception *e,
|
struct dl_exception *e,
|
||||||
const char *occasion)
|
const char *occasion)
|
||||||
{
|
{
|
||||||
const ircd::unwind free
|
using namespace ircd;
|
||||||
|
|
||||||
|
const unwind free
|
||||||
{
|
{
|
||||||
std::bind(_dl_exception_free, e)
|
std::bind(_dl_exception_free, e)
|
||||||
};
|
};
|
||||||
|
|
||||||
ircd::log::derror
|
assert(e);
|
||||||
|
log::derror
|
||||||
{
|
{
|
||||||
ircd::mods::log, "dynamic linker (%d) %s in `%s' :%s",
|
mods::log, "dynamic linker (%d) %s in `%s' :%s",
|
||||||
errcode,
|
errcode,
|
||||||
occasion,
|
occasion,
|
||||||
e->objname,
|
e->objname,
|
||||||
e->errstring
|
e->errstring
|
||||||
};
|
};
|
||||||
|
|
||||||
throw ircd::mods::error
|
static const auto &undefined_symbol_prefix
|
||||||
|
{
|
||||||
|
"undefined symbol: "
|
||||||
|
};
|
||||||
|
|
||||||
|
if(startswith(e->errstring, undefined_symbol_prefix))
|
||||||
|
{
|
||||||
|
const auto &mangled
|
||||||
|
{
|
||||||
|
lstrip(e->errstring, undefined_symbol_prefix)
|
||||||
|
};
|
||||||
|
|
||||||
|
throw mods::undefined_symbol
|
||||||
|
{
|
||||||
|
"%s %s (%s)",
|
||||||
|
e->objname,
|
||||||
|
demangle(mangled),
|
||||||
|
mangled,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
throw mods::error
|
||||||
{
|
{
|
||||||
"%s in %s (%d) %s",
|
"%s in %s (%d) %s",
|
||||||
occasion,
|
occasion,
|
||||||
|
|
Loading…
Reference in a new issue