public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Yao Qi <yao@codesourcery.com>
To: Pedro Alves <palves@redhat.com>
Cc: <gdb-patches@sourceware.org>
Subject: Re: [PATCH v2 3/3] Fix "breakpoint always-inserted off"; remove "breakpoint always-inserted auto"
Date: Thu, 18 Sep 2014 01:49:00 -0000	[thread overview]
Message-ID: <87r3z9zopi.fsf@codesourcery.com> (raw)
In-Reply-To: <1410994028-24282-4-git-send-email-palves@redhat.com> (Pedro	Alves's message of "Wed, 17 Sep 2014 23:47:08 +0100")

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 (齐尧)

  reply	other threads:[~2014-09-18  1:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-17 22:47 [PATCH v2 0/3] " Pedro Alves
2014-09-17 22:47 ` [PATCH v2 1/3] Change parameter type of update_global_location_list from boolean to enum Pedro Alves
2014-09-17 22:47 ` [PATCH v2 2/3] Tell update_global_location_list to insert breakpoints Pedro Alves
2014-09-17 22:47 ` [PATCH v2 3/3] Fix "breakpoint always-inserted off"; remove "breakpoint always-inserted auto" Pedro Alves
2014-09-18  1:49   ` Yao Qi [this message]
2014-09-19 19:05     ` [PATCH v3 " Pedro Alves
2014-09-21  9:45       ` [PATCH v4 " Pedro Alves
2014-09-22  7:48         ` Yao Qi
2014-09-22  9:13           ` Pedro Alves
2014-09-23  8:31             ` Regression for gdb.mi/mi-nsintrall.exp [Re: [PATCH v4 3/3] Fix "breakpoint always-inserted off"; remove "breakpoint always-inserted auto"] Jan Kratochvil
2014-09-23 16:27               ` Pedro Alves
2014-09-25 15:00                 ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r3z9zopi.fsf@codesourcery.com \
    --to=yao@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).