diff options
| author | ruki <[email protected]> | 2026-04-10 00:50:45 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2026-04-10 00:50:45 +0800 |
| commit | 6c19bc3f69104af23660ecec7f1c6fce755be6e4 (patch) | |
| tree | 881ef1cae3fbe05e5551db536ba70ddb3b007020 | |
| parent | cfb24095248fcb8b7991d765ca577cd025fe8fba (diff) | |
add binpath in errors
| -rw-r--r-- | core/src/xmake/binutils/deplibs.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/core/src/xmake/binutils/deplibs.c b/core/src/xmake/binutils/deplibs.c index 1ce0d5c29..4d72bfe1b 100644 --- a/core/src/xmake/binutils/deplibs.c +++ b/core/src/xmake/binutils/deplibs.c @@ -76,7 +76,7 @@ tb_int_t xm_binutils_deplibs(lua_State *lua) { tb_int_t format = xm_binutils_format_detect(istream); if (format < 0) { lua_pushboolean(lua, tb_false); - lua_pushfstring(lua, "cannot detect file format"); + lua_pushfstring(lua, "cannot detect file format for %s", binaryfile); break; } @@ -88,7 +88,7 @@ tb_int_t xm_binutils_deplibs(lua_State *lua) { if (!xm_binutils_coff_deplibs(istream, 0, lua)) { lua_pop(lua, 1); // pop table lua_pushboolean(lua, tb_false); - lua_pushfstring(lua, "failed to parse COFF"); + lua_pushfstring(lua, "failed to parse COFF for %s", binaryfile); break; } } else if (format == XM_BINUTILS_FORMAT_PE) { @@ -96,7 +96,7 @@ tb_int_t xm_binutils_deplibs(lua_State *lua) { if (!tb_stream_seek(istream, 0x3c)) { lua_pop(lua, 1); // pop table lua_pushboolean(lua, tb_false); - lua_pushfstring(lua, "failed to seek to e_lfanew"); + lua_pushfstring(lua, "failed to seek to e_lfanew for %s", binaryfile); break; } @@ -105,7 +105,7 @@ tb_int_t xm_binutils_deplibs(lua_State *lua) { if (!tb_stream_bread(istream, (tb_byte_t*)&e_lfanew, 4)) { lua_pop(lua, 1); // pop table lua_pushboolean(lua, tb_false); - lua_pushfstring(lua, "failed to read e_lfanew"); + lua_pushfstring(lua, "failed to read e_lfanew for %s", binaryfile); break; } @@ -116,28 +116,28 @@ tb_int_t xm_binutils_deplibs(lua_State *lua) { if (!xm_binutils_coff_deplibs(istream, e_lfanew + 4, lua)) { lua_pop(lua, 1); // pop table lua_pushboolean(lua, tb_false); - lua_pushfstring(lua, "failed to parse PE/COFF"); + lua_pushfstring(lua, "failed to parse PE/COFF for %s", binaryfile); break; } } else if (format == XM_BINUTILS_FORMAT_MACHO) { if (!xm_binutils_macho_deplibs(istream, 0, lua)) { lua_pop(lua, 1); // pop table lua_pushboolean(lua, tb_false); - lua_pushfstring(lua, "failed to parse Mach-O"); + lua_pushfstring(lua, "failed to parse Mach-O for %s", binaryfile); break; } } else if (format == XM_BINUTILS_FORMAT_ELF) { if (!xm_binutils_elf_deplibs(istream, 0, lua)) { lua_pop(lua, 1); // pop table lua_pushboolean(lua, tb_false); - lua_pushfstring(lua, "failed to parse ELF"); + lua_pushfstring(lua, "failed to parse ELF for %s", binaryfile); break; } } else if (format == XM_BINUTILS_FORMAT_WASM) { } else { lua_pop(lua, 1); // pop table lua_pushboolean(lua, tb_false); - lua_pushfstring(lua, "unsupported format %d", format); + lua_pushfstring(lua, "unsupported format %d for %s", format, binaryfile); break; } |
