summaryrefslogtreecommitdiffstats
path: root/tapsets.cxx
diff options
context:
space:
mode:
authorfche <fche>2008-02-28 21:34:46 +0000
committerfche <fche>2008-02-28 21:34:46 +0000
commit49abf162fa91397b0c65d41f5c9af31ace4e6290 (patch)
tree45fe654102d6db99e627fe04f7cbfd78e9db12e1 /tapsets.cxx
parent7e6c2d0bd81af35151167ca75fc1b7d20a9e9a7d (diff)
downloadsystemtap-steved-49abf162fa91397b0c65d41f5c9af31ace4e6290.tar.gz
systemtap-steved-49abf162fa91397b0c65d41f5c9af31ace4e6290.tar.xz
systemtap-steved-49abf162fa91397b0c65d41f5c9af31ace4e6290.zip
PR5045: clean up after interrupts
2008-02-28 Frank Ch. Eigler <fche@elastic.org> PR5045 * session.h (pending_interrupts): New global. * main.cxx (handle_interrupts): New fn to handle SIGINT* etc. * elaborate.cxx, translate.cxx, tapsets.cxx, main.cxx (*): Insert pending_interrupts escape hatches inside potentially timetaking loops. * buildrun.cxx: Don't deal with signals.
Diffstat (limited to 'tapsets.cxx')
-rw-r--r--tapsets.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/tapsets.cxx b/tapsets.cxx
index c5ed6ea1..52c14024 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -827,6 +827,7 @@ struct dwflpp
ptrdiff_t off = 0;
do
{
+ if (pending_interrupts) return;
off = dwfl_getmodules (dwfl, module_caching_callback,
& module_cache, off);
}
@@ -837,6 +838,7 @@ struct dwflpp
// Traverse the cache.
for (unsigned i = 0; i < module_cache.size(); i++)
{
+ if (pending_interrupts) return;
module_cache_entry& it = module_cache[i];
int rc = callback (it.mod, 0, it.name, it.addr, data);
if (rc != DWARF_CB_OK) break;
@@ -868,6 +870,7 @@ struct dwflpp
Dwarf_Off noff;
while (dwarf_nextcu (dw, off, &noff, &cuhl, NULL, NULL, NULL) == 0)
{
+ if (pending_interrupts) return;
Dwarf_Die die_mem;
Dwarf_Die *die;
die = dwarf_offdie (dw, off + cuhl, &die_mem);
@@ -878,6 +881,7 @@ struct dwflpp
for (unsigned i = 0; i < v->size(); i++)
{
+ if (pending_interrupts) return;
Dwarf_Die die = v->at(i);
int rc = (*callback)(& die, data);
if (rc != DWARF_CB_OK) break;
@@ -1057,6 +1061,7 @@ struct dwflpp
{
for (size_t i = 0; i < nsrcs; ++i)
{
+ if (pending_interrupts) return;
if (srcsp [i]) // skip over mismatched lines
callback (srcsp[i], data);
}
@@ -3012,6 +3017,7 @@ static int
query_cu (Dwarf_Die * cudie, void * arg)
{
dwarf_query * q = static_cast<dwarf_query *>(arg);
+ if (pending_interrupts) return DWARF_CB_ABORT;
try
{