diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2021-11-22 11:27:29 -0500 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2021-11-22 13:57:43 -0500 |
commit | 7dca2ea7ff4c2c786119e13e81a5e6b0c1bf1d2d (patch) | |
tree | 11f65eb07e8a35b04dd4fda44eca976d8c6d9f23 /gdb/target/waitstatus.c | |
parent | a58577878b19cb2e6ebbfdbff557203c344955b1 (diff) | |
download | gdb-7dca2ea7ff4c2c786119e13e81a5e6b0c1bf1d2d.zip gdb-7dca2ea7ff4c2c786119e13e81a5e6b0c1bf1d2d.tar.gz gdb-7dca2ea7ff4c2c786119e13e81a5e6b0c1bf1d2d.tar.bz2 |
gdb: rename target_waitstatus_to_string to target_waitstatus::to_string
Make target_waitstatus_to_string a "to_string" method of
target_waitstatus, a bit like we have ptid_t::to_string already. This
will save a bit of typing.
Change-Id: Id261b7a09fa9fa3c738abac131c191a6f9c13905
Diffstat (limited to 'gdb/target/waitstatus.c')
-rw-r--r-- | gdb/target/waitstatus.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/gdb/target/waitstatus.c b/gdb/target/waitstatus.c index dc3d75e..2293d83 100644 --- a/gdb/target/waitstatus.c +++ b/gdb/target/waitstatus.c @@ -23,40 +23,40 @@ /* Return a pretty printed form of target_waitstatus. */ std::string -target_waitstatus_to_string (const struct target_waitstatus *ws) +target_waitstatus::to_string () const { const char *kind_str = "status->kind = "; - switch (ws->kind ()) + switch (this->kind ()) { case TARGET_WAITKIND_EXITED: return string_printf ("%sexited, status = %d", - kind_str, ws->exit_status ()); + kind_str, this->exit_status ()); case TARGET_WAITKIND_STOPPED: return string_printf ("%sstopped, signal = %s", kind_str, - gdb_signal_to_symbol_string (ws->sig ())); + gdb_signal_to_symbol_string (this->sig ())); case TARGET_WAITKIND_SIGNALLED: return string_printf ("%ssignalled, signal = %s", kind_str, - gdb_signal_to_symbol_string (ws->sig ())); + gdb_signal_to_symbol_string (this->sig ())); case TARGET_WAITKIND_LOADED: return string_printf ("%sloaded", kind_str); case TARGET_WAITKIND_FORKED: return string_printf ("%sforked, child_ptid = %s", kind_str, - ws->child_ptid ().to_string ().c_str ()); + this->child_ptid ().to_string ().c_str ()); case TARGET_WAITKIND_VFORKED: return string_printf ("%svforked, child_ptid = %s", kind_str, - ws->child_ptid ().to_string ().c_str ()); + this->child_ptid ().to_string ().c_str ()); case TARGET_WAITKIND_EXECD: return string_printf ("%sexecd, execd_pathname = %s", kind_str, - ws->execd_pathname ()); + this->execd_pathname ()); case TARGET_WAITKIND_VFORK_DONE: return string_printf ("%svfork-done", kind_str); @@ -84,7 +84,7 @@ target_waitstatus_to_string (const struct target_waitstatus *ws) case TARGET_WAITKIND_THREAD_EXITED: return string_printf ("%sthread exited, status = %d", - kind_str, ws->exit_status ()); + kind_str, this->exit_status ()); default: return string_printf ("%sunknown???", kind_str); |