From 7a24d42223ae98598c99bfb21437a00f13397d6d Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Tue, 22 Jul 2008 16:14:02 -0400 Subject: PR4225: parse process("path").function/statement probe points --- translate.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'translate.cxx') diff --git a/translate.cxx b/translate.cxx index c62ba9fd..5956cba7 100644 --- a/translate.cxx +++ b/translate.cxx @@ -4507,7 +4507,7 @@ emit_symbol_data (systemtap_session& s) unwindsym_dump_context ctx = { s, kallsyms_out, 0, s.unwindsym_modules }; - // XXX: copied from tapsets.cxx, sadly + // XXX: copied from tapsets.cxx dwflpp::, sadly static char debuginfo_path_arr[] = "-:.debug:/usr/lib/debug:build"; static char *debuginfo_env_arr = getenv("SYSTEMTAP_DEBUGINFO_PATH"); @@ -4546,6 +4546,7 @@ emit_symbol_data (systemtap_session& s) // ---- step 2: process any user modules (files) listed + // XXX: see dwflpp::setup_user. static const Dwfl_Callbacks user_callbacks = { NULL, /* dwfl_linux_kernel_find_elf, */ -- cgit From 1384b663414d5380e25b21457e71458078ded8d5 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Sat, 2 Aug 2008 13:50:28 -0400 Subject: c code generation: assert C indentation/nesting cancels out at appropriate points --- translate.cxx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'translate.cxx') diff --git a/translate.cxx b/translate.cxx index 5956cba7..03ac0941 100644 --- a/translate.cxx +++ b/translate.cxx @@ -4714,6 +4714,7 @@ translate_pass (systemtap_session& s) s.up->emit_global_init (s.globals[i]); } s.op->newline(-1) << "};"; + s.op->assert_0_indent(); for (unsigned i=0; inewline(); s.up->emit_functionsig (s.functions[i]); } + s.op->assert_0_indent(); for (unsigned i=0; inewline(); s.up->emit_function (s.functions[i]); } + s.op->assert_0_indent(); // Run a varuse_collecting_visitor over probes that need global // variable locks. We'll use this information later in @@ -4738,18 +4741,21 @@ translate_pass (systemtap_session& s) if (s.probes[i]->needs_global_locks()) s.probes[i]->body->visit (&cup.vcv_needs_global_locks); } + s.op->assert_0_indent(); for (unsigned i=0; iemit_probe (s.probes[i]); } + s.op->assert_0_indent(); s.op->newline(); s.up->emit_module_init (); + s.op->assert_0_indent(); s.op->newline(); s.up->emit_module_exit (); - + s.op->assert_0_indent(); s.op->newline(); // XXX impedance mismatch @@ -4760,17 +4766,20 @@ translate_pass (systemtap_session& s) s.op->newline() << "void probe_exit () {"; s.op->newline(1) << "systemtap_module_exit ();"; s.op->newline(-1) << "}"; + s.op->assert_0_indent(); for (unsigned i=0; inewline(); s.up->emit_global_param (s.globals[i]); } + s.op->assert_0_indent(); emit_symbol_data (s); s.op->newline() << "MODULE_DESCRIPTION(\"systemtap-generated probe\");"; s.op->newline() << "MODULE_LICENSE(\"GPL\");"; + s.op->assert_0_indent(); } catch (const semantic_error& e) { -- cgit From 17c128f2fe920f785979aa9445eff5ac2f30d307 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Thu, 21 Aug 2008 14:31:10 -0400 Subject: pr4225: add putative shared library (ET_DYN) support --- translate.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'translate.cxx') diff --git a/translate.cxx b/translate.cxx index 03ac0941..fc8a578e 100644 --- a/translate.cxx +++ b/translate.cxx @@ -4429,7 +4429,13 @@ dump_unwindsyms (Dwfl_Module *m, else if (n > 0) { assert (secname != NULL); - // secname adequately set + // secname adequately set + + // NB: it may be an empty string for ET_DYN objects + // like shared libraries, as their relocation base + // is implicit. + if (secname[0] == '\0') + secname = ".dynamic"; } else { -- cgit