From: Simon Marchi <simark@simark.ca>
To: Pedro Alves <pedro@palves.net>, gdb-patches@sourceware.org
Subject: Re: [PATCH 2/2] Fix "thread find" with multiple inferiors/targets (PR gdb/26631)
Date: Thu, 17 Sep 2020 15:37:17 -0400 [thread overview]
Message-ID: <9532fa68-2223-3b2d-9264-7aa661ad892b@simark.ca> (raw)
In-Reply-To: <20200917180038.29226-3-pedro@palves.net>
On 2020-09-17 2:00 p.m., Pedro Alves wrote:
> "thread find" with multiple inferiors got broken with the multi-target
> work:
>
> Thread 1 "gdb" hit Breakpoint 1, internal_error (...) at ../../src/gdbsupport/errors.cc:51
> 51 {
> (top-gdb) bt
> #0 internal_error (file=0xffffd4d0 <error: Cannot access memory at address 0xffffd4d0>, line=0, fmt=0x555556330320 "en_US.UTF-8") at ../../src/gdbsupport/errors.cc:51
> #1 0x0000555555bca4c7 in target_thread_name (info=0x555556801290) at ../../src/gdb/target.c:2035
> #2 0x0000555555beb07a in thread_find_command (arg=0x7fffffffe08e "1", from_tty=0) at ../../src/gdb/thread.c:1959
> #3 0x000055555572ec49 in do_const_cfunc (c=0x555556786bc0, args=0x7fffffffe08e "1", from_tty=0) at ../../src/gdb/cli/cli-decode.c:95
> #4 0x0000555555732abd in cmd_func (cmd=0x555556786bc0, args=0x7fffffffe08e "1", from_tty=0) at ../../src/gdb/cli/cli-decode.c:2181
> #5 0x0000555555bf1245 in execute_command (p=0x7fffffffe08e "1", from_tty=0) at ../../src/gdb/top.c:664
> #6 0x00005555559cad10 in catch_command_errors (command=0x555555bf0c31 <execute_command(char const*, int)>, arg=0x7fffffffe082 "thread find 1", from_tty=0) at ../../src/gdb/main.c:457
> #7 0x00005555559cc33d in captured_main_1 (context=0x7fffffffdb60) at ../../src/gdb/main.c:1218
> #8 0x00005555559cc571 in captured_main (data=0x7fffffffdb60) at ../../src/gdb/main.c:1243
> #9 0x00005555559cc5e8 in gdb_main (args=0x7fffffffdb60) at ../../src/gdb/main.c:1268
> #10 0x0000555555623816 in main (argc=17, argv=0x7fffffffdc78) at ../../src/gdb/gdb.c:32
>
> The problem is that we're not switching to the inferior/target before
> calling target methods, which trips on an assertion put in place
> exactly to catch this sort of problem.
This LGTM. And I can't wait until we make all target methods
independent of the current target/inferior/thread :).
Simon
prev parent reply other threads:[~2020-09-17 19:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-17 18:00 [PATCH 0/2] Fix "thread find" with multi inferior/target " Pedro Alves
2020-09-17 18:00 ` [PATCH 1/2] Split gdb.multi/multi-target.exp into separate testcases Pedro Alves
2020-09-17 19:16 ` Simon Marchi
2020-09-18 12:34 ` Pedro Alves
2020-09-17 19:41 ` Simon Marchi
2020-09-18 13:01 ` Pedro Alves
2020-09-17 18:00 ` [PATCH 2/2] Fix "thread find" with multiple inferiors/targets (PR gdb/26631) Pedro Alves
2020-09-17 19:37 ` Simon Marchi [this message]
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=9532fa68-2223-3b2d-9264-7aa661ad892b@simark.ca \
--to=simark@simark.ca \
--cc=gdb-patches@sourceware.org \
--cc=pedro@palves.net \
/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