public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [pushed] gdb: fix remote-sim.c build
@ 2021-10-22  4:15 Simon Marchi
  2021-10-22 15:07 ` Tom Tromey
  0 siblings, 1 reply; 2+ messages in thread
From: Simon Marchi @ 2021-10-22  4:15 UTC (permalink / raw)
  To: gdb-patches

Commit 183be222907a ("gdb, gdbserver: make target_waitstatus safe")
broke the remote-sim.c build.  In fact, it does some wrong changes,
result of a bad sed invocation.

Fix it by adjusting the code to the new target_waitstatus API.

Change-Id: I3236ff7ef7681fc29215f68be210ff4263760e91
---
 gdb/remote-sim.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c
index 55d674fc4d3b..328b4e91b290 100644
--- a/gdb/remote-sim.c
+++ b/gdb/remote-sim.c
@@ -980,8 +980,7 @@ gdbsim_target::wait (ptid_t ptid, struct target_waitstatus *status,
   switch (reason)
     {
     case sim_exited:
-      status->kind = TARGET_WAITKIND_EXITED;
-      status->value.integer = sigrc;
+      status->set_exited (sigrc);
       break;
     case sim_stopped:
       switch (sigrc)
@@ -992,14 +991,12 @@ gdbsim_target::wait (ptid_t ptid, struct target_waitstatus *status,
 	case GDB_SIGNAL_INT:
 	case GDB_SIGNAL_TRAP:
 	default:
-	  status->kind = TARGET_WAITKIND_STOPPED;
-	  status->sig () = (enum gdb_signal) sigrc;
+	  status->set_stopped ((gdb_signal) sigrc);
 	  break;
 	}
       break;
     case sim_signalled:
-      status->kind = TARGET_WAITKIND_SIGNALLED;
-      status->sig () = (enum gdb_signal) sigrc;
+      status->set_signalled ((gdb_signal) sigrc);
       break;
     case sim_running:
     case sim_polling:
-- 
2.33.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [pushed] gdb: fix remote-sim.c build
  2021-10-22  4:15 [pushed] gdb: fix remote-sim.c build Simon Marchi
@ 2021-10-22 15:07 ` Tom Tromey
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Tromey @ 2021-10-22 15:07 UTC (permalink / raw)
  To: Simon Marchi via Gdb-patches

>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:

Simon> Commit 183be222907a ("gdb, gdbserver: make target_waitstatus safe")
Simon> broke the remote-sim.c build.  In fact, it does some wrong changes,
Simon> result of a bad sed invocation.

I've done this a few times too.
I wish we could replace remote-sim with an ordinary remote target, but I
don't know how best to handle the register mapping stuff.

Tom

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-10-22 15:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-22  4:15 [pushed] gdb: fix remote-sim.c build Simon Marchi
2021-10-22 15:07 ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).