diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2021-12-01 20:40:01 -0500 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2021-12-03 08:25:05 -0500 |
commit | 857dfb92de66c1ce66e78ae40a4b7d0e8fdbf2f0 (patch) | |
tree | d8d1508737a094e8519732a7a3faed3370520ed9 /gdb/procfs.c | |
parent | ce1a6f421d29aad57f5f25fe2b8a929523c3de27 (diff) | |
download | binutils-857dfb92de66c1ce66e78ae40a4b7d0e8fdbf2f0.zip binutils-857dfb92de66c1ce66e78ae40a4b7d0e8fdbf2f0.tar.gz binutils-857dfb92de66c1ce66e78ae40a4b7d0e8fdbf2f0.tar.bz2 |
gdb: return *this in target_waitstatus setters
While playing with some code creating target_waitstatus objects, I was
mildly annoyed by the fact that we can't just return a new
target_waitstatus object. We have to do:
target_waitstatus ws;
ws.set_exited (123);
return ws;
Make the setters return the "this" object as a reference, such that it's
possible to do:
return target_waitstatus ().set_exited (123);
I initially thought of adding static creation functions, which you would
use like:
return target_waitstatus::make_exited (123);
However, making the setters return a reference to the object achieves
pretty much the same thing, with less new code.
Change-Id: I45159b7f9fcd9db5b20603480e323020b14ed147
Diffstat (limited to 'gdb/procfs.c')
0 files changed, 0 insertions, 0 deletions