013e355 gdbserver/linux-low: use std::list to store pending signals

Authored and Committed by Tankut Baris Aktemur 3 years ago
    gdbserver/linux-low: use std::list to store pending signals
    
    Use std::list to store pending signals instead of a manually-managed
    linked list.  This is a refactoring.
    
    In the existing code, pending signals are kept in a manually-created
    linked list with "prev" pointers.  A new pending signal is thus
    inserted to the beginning of the list.  When consuming, GDB goes until
    the end of the list, following the "prev" pointers, and processes the
    final item.  With this patch, a new item is added to the end of the
    list and the item at the front of the list is consumed.  In other
    words, the list elements used to be stored in reverse order; with this
    patch, they are stored in their order of arrival.  This causes a change
    in the debug messages that print the pending signals.  Otherwise, no
    behavioral change is expected.
    
    gdbserver/ChangeLog:
    2020-06-22  Tankut Baris Aktemur  <tankut.baris.aktemur@intel.com>
    
    	Use std::list to stop pending signal instead of manually-created
    	linked list.
    	* linux-low.h: Include <list>.
    	(struct pending_signal): Move here from linux-low.cc.
    	(struct lwp_info) <pending_signals>
    	<pending_signals_to_report>: Update the type.
    	* linux-low.cc (struct pending_signals): Remove.
    	(linux_process_target::delete_lwp)
    	(linux_process_target::add_lwp)
    	(enqueue_one_deferred_signal)
    	(dequeue_one_deferred_signal)
    	(enqueue_pending_signal)
    	(linux_process_target::resume_one_lwp_throw)
    	(linux_process_target::thread_needs_step_over)
    	(linux_process_target::resume_one_thread)
    	(linux_process_target::proceed_one_lwp): Update the use of pending
    	signal list.
    
        
file modified
+20 -0
file modified
+32 -69
file modified
+20 -7