Made all the requested changes. > > Tom> However, I think this is pretty ugly. > Tom> It seems like there should be a better way to get this than looking up > Tom> a convenience variable. > > Sami> Hmm I looked through the code to find another way but could > Sami> not. handle_inferior_event which sets the convenience variable uses > Sami> execution_control_state which I don't have access to. > > I don't want to hold up this patch for a detail like this, but I wonder > if we could put the exit code into the struct inferior as well as in the > convenience variable. > Okay, I added exit_code to struct inferior, set it and used it. How does that part of the patch look ? > [create_stop_event_object] > Tom> I think it would be better to just have one cast at the end, instead of > Tom> lots of casts in the body. > > Sami> Hmm if I change stop_event_object* to event_object it would eliminate > Sami> two casts but also add two. One when setting the inferior thread and > Sami> one for returning. Same goes for all the create_* functions or should > Sami> I change all of those to return more generic objects ? > > It seems to me that the callers of the create_* functions then proceed > to downcast anyway: > > Sami> + event = (event_object *) create_continue_event_object (); > Sami> + if (event) > Sami> + return evpy_emit_event (event, gdb_py_events.cont); > Sami> + return -1; > > Given this, I think just returning the more generic type is ok. > Doing this turned my attention to the fact that the individual c types were not really needed, and that event_object can be used for all events. This resulted in some more clean up. How does it all look now ?