Subject DWARF OP is used for accessing TLS variables in GCC-compiled C
code. In all but the simplest cases, we must emulate libthread_db
logic for resolving TLS addresses. Step 1 is to map this operator to
a tapset function call __push_tls_address, which will implement the
architecture-specific lookup functionality.
We also tweak systemtap_session::print_error to ensure even isolated
little error messages seen only once do get printed.
See also: https://infinitynotes.org/wiki/Glibc
else
{
string sugs = levenshtein_suggest(e->function, collect_functions(), 5); // print 5 funcs
- throw SEMANTIC_ERROR(_F("unresolved function%s",
+ throw SEMANTIC_ERROR(_F("unresolved function %s%s",
+ string(e->function).c_str(),
sugs.empty() ? "" : (_(" (similar: ") + sugs + ")").c_str()),
e->tok);
}
}
break;
+ case DW_OP_GNU_push_tls_address:
+ {
+ POP(addr);
+ functioncall *fc = new functioncall;
+ fc->tok = e->tok;
+ fc->function = std::string("__push_tls_address");
+ fc->synthetic = true;
+ fc->args.push_back(addr);
+ PUSH(fc);
+ }
+ break;
+
default:
DIE ("unhandled DW_OP operation");
break;
if (verbose > 0 || seen_errors[se.errsrc_chain()] < 1)
{
seen_errors[se.errsrc_chain()]++;
+ cerr << build_error_msg(se);
for (const semantic_error *e = &se; e != NULL; e = e->get_chain())
if (verbose > 1 || seen_errors[e->errsrc] < 1) // dupe-eliminate chained errors too
{