[lldb-dev] Bug in tools/debugserver/source/RNBRemote.cpp

Greg Clayton gclayton at apple.com
Wed Jul 21 13:01:49 PDT 2010


Just change the:

        } while (err == rnb_err);

With:

	if (err == rnb_err)
		break;
        }

On Jul 21, 2010, at 10:34 AM, William Lynch wrote:

> Hi,
> 
> Just as a preface, I've been attempting to get the codebase running under leopard and / or Linux. In the process, I've been using the makefiles. I've gotten to the point where I can run lldb under Leopard, but I can't debug any programs because debugserver won't build yet. While fixing small warnings / errors in the code base, I came across this piece of code at line 422 in tools/debugserver/source/RNBRemote.cpp:
> 
> The set of two while loops is not standard C and this looks alot like a deadlock possibility. I don't know enough right now to fix this however.
> 
> Enjoy,
> Bill Lynch
> 
>         while ((set_events = events.WaitForSetEvents(events_to_wait_for)) != 0)
>         {
>             if (set_events & RNBContext::event_read_packet_available)
>             {
>                 // Try the queue again now that we got an event
>                 err = GetPacketPayload (payload);
>                 if (err == rnb_success)
>                     break;
>             }
> 
>             if (set_events & RNBContext::event_read_thread_exiting)
>                 err = rnb_not_connected;
> 
>             if (err == rnb_not_connected)
>                 return err;
> 
>         } while (err == rnb_err);
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev





More information about the lldb-dev mailing list