mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-10 18:28:27 +08:00
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.
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
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.
|
||||||
|
|
||||||
2019-03-05 Tom Tromey <tromey@adacore.com>
|
2019-03-05 Tom Tromey <tromey@adacore.com>
|
||||||
|
|
||||||
* common/scoped_fd.h (class scoped_fd) <release>: Add
|
* common/scoped_fd.h (class scoped_fd) <release>: Add
|
||||||
|
@ -57,7 +57,7 @@ public:
|
|||||||
|
|
||||||
DISABLE_COPY_AND_ASSIGN (scoped_mmap);
|
DISABLE_COPY_AND_ASSIGN (scoped_mmap);
|
||||||
|
|
||||||
void *release () noexcept
|
ATTRIBUTE_UNUSED_RESULT void *release () noexcept
|
||||||
{
|
{
|
||||||
void *mem = m_mem;
|
void *mem = m_mem;
|
||||||
m_mem = MAP_FAILED;
|
m_mem = MAP_FAILED;
|
||||||
|
@ -544,13 +544,11 @@ linux_enable_bts (ptid_t ptid, const struct btrace_config_bts *conf)
|
|||||||
|
|
||||||
bts->bts.size = size;
|
bts->bts.size = size;
|
||||||
bts->bts.data_head = &header->data_head;
|
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->bts.last_head = 0ull;
|
||||||
bts->header = header;
|
bts->header = header;
|
||||||
bts->file = fd.release ();
|
bts->file = fd.release ();
|
||||||
|
|
||||||
data.release ();
|
|
||||||
|
|
||||||
tinfo->conf.bts.size = (unsigned int) size;
|
tinfo->conf.bts.size = (unsigned int) size;
|
||||||
return tinfo.release ();
|
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.size = aux.size ();
|
||||||
pt->pt.mem = (const uint8_t *) aux.release ();
|
pt->pt.mem = (const uint8_t *) aux.release ();
|
||||||
pt->pt.data_head = &header->aux_head;
|
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 ();
|
pt->file = fd.release ();
|
||||||
|
|
||||||
data.release ();
|
|
||||||
|
|
||||||
tinfo->conf.pt.size = (unsigned int) pt->pt.size;
|
tinfo->conf.pt.size = (unsigned int) pt->pt.size;
|
||||||
return tinfo.release ();
|
return tinfo.release ();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user