This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v2 3/3] Fix "breakpoint always-inserted off"; remove "breakpoint always-inserted auto"


Pedro Alves <palves@redhat.com> writes:

> -  /* Insert locations now, even if breakpoints_always_inserted_mode is
> -     false.  */
> +  /* Insert locations now, irrespective of
> +     breakpoints_should_be_inserted_now.  E.g., say all threads are
> +     stopped right now, and the user did "continue".  We need to
> +     insert breakpoints _before_ resuming the target, but
> +     UGLL_MAY_INSERT wouldn't insert them, because
> +     breakpoints_should_be_inserted_now returns false at that point,
> +     as no thread is running yet.  */
>    UGLL_INSERT

Yeah, that is clear to me.

> +
> +   You should have received a copy of the GNU General Public License
> +   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
> +
> +#include <pthread.h>
> +#include <assert.h>
> +#include <pthread.h>

pthread.h is included twice.
> +
> +    gdb_breakpoint [gdb_get_line_number "breakpoint A child here"]
> +    gdb_continue_to_breakpoint "run to child breakpoint"
> +    gdb_test "info threads" "\\\* 2 .* 1.*" "info threads shows all threads"
> +
> +    delete_breakpoints
> +
> +    # Leave one thread stopped, so GDB
> +    gdb_test_no_output "set scheduler-locking on"
> +
> +    gdb_test "continue &" "Continuing\."
> +
> +    # Switch to a stopped thread, so GDB can poke at memory freely.
> +    gdb_test "thread 1" "Switching to .*" "switch to stopped thread"
> +
> +    gdb_test "info threads" "2.*running.*\\\* 1.*" "info threads shows running thread"
> +

IWBN to check thread 1 is stopped too, because thread 1 isn't stopped in
non-stop mode, or the test can stop thread 1 explicitly if it isn't.

-- 
Yao (éå)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]