diff options
author | Tom Tromey <tromey@adacore.com> | 2019-02-26 14:46:40 -0700 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2019-03-05 08:48:40 -0700 |
commit | 083eef1f897e2fd13e4afa7b1a52090c83476f5c (patch) | |
tree | 688cad36eb2197c91033a417d85b86e45df25a91 /gdb/nat | |
parent | 3cabd438f3d18e1cb7afd4d2a82449883943e62f (diff) | |
download | gdb-083eef1f897e2fd13e4afa7b1a52090c83476f5c.zip gdb-083eef1f897e2fd13e4afa7b1a52090c83476f5c.tar.gz gdb-083eef1f897e2fd13e4afa7b1a52090c83476f5c.tar.bz2 |
Add ATTRIBUTE_UNUSED_RESULT to scoped_mmap
This applies ATTRIBUTE_UNUSED_RESULT to scoped_mmap::release and fixes
a couple of spots to comply.
gdb/ChangeLog
2019-03-05 Tom Tromey <tromey@adacore.com>
* nat/linux-btrace.c (linux_enable_bts, linux_enable_pt): Update.
* common/scoped_mmap.h (class scoped_mmap) <release>: Add
ATTRIBUTE_UNUSED_RESULT.
Diffstat (limited to 'gdb/nat')
-rw-r--r-- | gdb/nat/linux-btrace.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/gdb/nat/linux-btrace.c b/gdb/nat/linux-btrace.c index b51e70f..ef291ec 100644 --- a/gdb/nat/linux-btrace.c +++ b/gdb/nat/linux-btrace.c @@ -544,13 +544,11 @@ linux_enable_bts (ptid_t ptid, const struct btrace_config_bts *conf) bts->bts.size = size; bts->bts.data_head = &header->data_head; - bts->bts.mem = (const uint8_t *) data.get () + data_offset; + bts->bts.mem = (const uint8_t *) data.release () + data_offset; bts->bts.last_head = 0ull; bts->header = header; bts->file = fd.release (); - data.release (); - tinfo->conf.bts.size = (unsigned int) size; return tinfo.release (); } @@ -667,11 +665,10 @@ linux_enable_pt (ptid_t ptid, const struct btrace_config_pt *conf) pt->pt.size = aux.size (); pt->pt.mem = (const uint8_t *) aux.release (); pt->pt.data_head = &header->aux_head; - pt->header = header; + pt->header = (struct perf_event_mmap_page *) data.release (); + gdb_assert (pt->header == header); pt->file = fd.release (); - data.release (); - tinfo->conf.pt.size = (unsigned int) pt->pt.size; return tinfo.release (); } |