binutils-gdb/gdb/target
Simon Marchi 857dfb92de 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
2021-12-03 08:25:05 -05:00
..
resume.h
target.h
wait.h
waitstatus.c gdb, include: replace pragmas with DIAGNOSTIC macros, fix build with g++ 4.8 2021-12-02 08:24:25 -05:00
waitstatus.h gdb: return *this in target_waitstatus setters 2021-12-03 08:25:05 -05:00