Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Sandra Loosemore <sandra@codesourcery.com>
To: Pedro Alves <palves@redhat.com>
Cc: <gdb-patches@sourceware.org>
Subject: Re: Cannot execute this command without a live selected thread.
Date: Fri, 24 Oct 2014 17:08:00 -0000	[thread overview]
Message-ID: <544A8741.9090705@codesourcery.com> (raw)
In-Reply-To: <544A7930.4040909@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 888 bytes --]

On 10/24/2014 10:07 AM, Pedro Alves wrote:
> On 10/24/2014 04:54 PM, Sandra Loosemore wrote:
>> (gdb) load
>> Loading section .text, size 0x844 lma 0x10000000
>> Loading section .eh_frame, size 0x4 lma 0x10000844
>> Loading section .rodata, size 0x120 lma 0x10000848
>> Loading section .data, size 0x428 lma 0x10000968
>> Start address 0x10000040, load size 3472
>> Transfer rate: 41 KB/sec, 868 bytes/write.
>> (gdb) continue
>> Continuing.
>> Cannot execute this command without a live selected thread.
>> (gdb) ERROR: couldn't run to breakpoint
>>
>
> Odd.  A backtrace at (break at "error") and "set debug infrun/remote"
> logs would probably be revealing.

Attached.  It appears that on the GDB side the default thread is in an 
"exited" state when the continue command is processed.  I don't know if 
it's relevant that the remote stub doesn't understand the "Hg" packet?

-Sandra


[-- Attachment #2: gdb-output --]
[-- Type: text/plain, Size: 11348 bytes --]

(gdb) set debug remote 1
(gdb) set debug infrun 1
(gdb) break main
Breakpoint 1 at 0x100002ac: file /home/sandra/examples/croak.c, line 10.
(gdb) target remote qa8-centos32-cs:6789
Remote debugging using qa8-centos32-cs:6789
Sending packet: $qSupported:multiprocess+;qRelocInsn+#2a...Ack
Packet received: QStartNoAckMode+;PacketSize=2000;qXfer:features:read+
Packet qSupported (supported-packets) is supported
Sending packet: $QStartNoAckMode#b0...Ack
Packet received: OK
Sending packet: $Hg0#df...Packet received: 
Sending packet: $qXfer:features:read:target.xml:0,fff#7d...Packet received: l<?xml version="1.0"?><!DOCTYPE target SYSTEM "gdb-target.dtd"><target><xi:include href ="nios2-cpu.xml"/></target>
Sending packet: $qXfer:features:read:nios2-cpu.xml:0,fff#56...Packet received: l<?xml version="1.0"?>\n<!-- Copyright (C) 2012-2014 Free Software Foundation, Inc.\n\n     Copying and distribution of this file, with or without modification,\n     are permitted in any medium without royalty provided the copyright\n     notice and this notice are preserved.  -->\n\n<!DOCTYPE feature SYSTEM "gdb-target.dtd">\n<feature name="org.gnu.gdb.nios2.cpu">\n  <reg name="zero" bitsize="32" type="uint32"/>\n  <reg name="at" bitsize="32" type="uint32"/>\n  <reg name="r2" bitsize="32" type="uint32"/>\n  <reg name="r3" bitsize="32" type="uint32"/>\n  <reg name="r4" bitsize="32" type="uint32"/>\n  <reg name="r5" bitsize="32" type="uint32"/>\n  <reg name="r6" bitsize="32" type="uint32"/>\n  <reg name="r7" bitsize="32" type="uint32"/>\n  <reg name="r8" bitsize="32" type="uint32"/>\n  <reg name="r9" bitsize="32" type="uint32"/>\n  <reg name="r10" bitsize="32" type="uint32"/>\n  <reg name="r11" bitsize="32" type="uint32"/>\n  <reg name="r12" bitsize="32" type="uint32"/>\n  <reg name="r13" bitsize="32" type="uint32"/>\n  <reg name="r14" bitsize="32" type="uint32"/>\n  <reg name="r15" bitsize="32" type="uint32"/>\n  <reg name="r16" bitsize="32" type="uint32"/>\n  <reg name="r17" bitsize="32" type="uint32"/>\n  <reg name="r18" bitsize="32" type="uint32"/>\n  <reg name="r19" bitsize="32" type="uint32"/>\n  <reg name="r20" bitsize="32" type="uint32"/>\n  <reg name="r21" bitsize="32" type="uint32"/>\n  <reg name="r22" bitsize="32" type="uint32"/>\n  <reg name="r23" bitsize="32" type="uint32"/>\n  <reg name="et" bitsize="32" type="uint32"/>\n  <reg name="bt" bitsize="32" type="uint32"/>\n  <reg name="gp" bitsize="32" type="data_ptr"/>\n  <reg name="sp" bitsize="32" type="data_ptr"/>\n  <reg name="fp" bitsize="32" type="data_ptr"/>\n  <reg name="ea" bitsize="32" type="code_ptr"/>\n  <reg name="sstatus" bitsize="32" type="uint32"/>\n  <reg name="ra" bitsize="32" type="code_ptr"/>\n  <reg name="pc" bitsize="32" type="code_ptr"/>\n  <reg name="status" bitsize="32" type="uint32"/>\n  <reg name="estatus" bitsize="32" type="uint32"/>\n  <reg name="bstatus" bitsize="32" type="uint32"/>\n  <reg name="ienable" bitsize="32" type="uint32"/>\n  <reg name="ipending" bitsize="32" type="uint32"/>\n  <reg name="cpuid" bitsize="32" type="uint32"/>\n  <reg name="ctl6" bitsize="32" type="uint32"/>\n  <reg name="exception" bitsize="32" type="uint32"/>\n  <reg name="pteaddr" bitsize="32" type="uint32"/>\n  <reg name="tlbacc" bitsize="32" type="uint32"/>\n  <reg name="tlbmisc" bitsize="32" type="uint32"/>\n  <reg name="eccinj" bitsize="32" type="uint32"/>\n  <reg name="badaddr" bitsize="32" type="uint32"/>\n  <reg name="config" bitsize="32" type="uint32"/>\n  <reg name="mpubase" bitsize="32" type="uint32"/>\n  <reg name="mpuacc" bitsize="32" type="uint32"/>\n</feature>\n
Sending packet: $qTStatus#49...Packet received: 
Packet qTStatus (trace-status) is NOT supported
Sending packet: $?#3f...Packet received: S00
Sending packet: $qfThreadInfo#bb...Packet received: l
Sending packet: $Hc-1#09...Packet received: 
Sending packet: $qC#b4...Packet received: unset
Sending packet: $qAttached#8f...Packet received: 
Packet qAttached (query-attached) is NOT supported
infrun: clear_proceed_status_thread (Thread <main>)
Sending packet: $qOffsets#4b...Packet received: 
infrun: wait_for_inferior ()
infrun: target_wait (-1, status) =
infrun:   42000 [Thread <main>],
infrun:   status->kind = stopped, signal = GDB_SIGNAL_0
infrun: TARGET_WAITKIND_STOPPED
Sending packet: $g#67...Packet received: 0000000044f8ff0708800000088000000000000000000000000000000000000020e30010000000000080000000f8ff07efbeaddeefbeaddeefbeaddeefbeaddeefbeadde00000000efbeaddebcf8ff07efbeaddeefbeaddeefbeaddeefbeaddeefbeadde00000000efbeaddeefbeaddeefbeaddeefbeadde0000000004000010
Sending packet: $p20#d2...Packet received: 00000010
Packet p (fetch-register) is supported
infrun: stop_pc = 0x10000000
infrun: quietly stopped
infrun: stop_waiting
Sending packet: $qfThreadInfo#bb...Packet received: l
Sending packet: $qSymbol::#5b...Packet received: 
Packet qSymbol (symbol-lookup) is NOT supported
(gdb) load
...
Start address 0x10000040, load size 58144
Sending packet: $P20=40000010#74...Packet received: OK
Packet P (set-register) is supported
Transfer rate: 37 KB/sec, 3420 bytes/write.

(gdb) c
Continuing.

Breakpoint 1, error (
    fmt=fmt@entry=0x834d2c8 "Cannot execute this command without a live selected thread.")
    at /scratch/sandra/nios2-elf-fsf/obj/gdb-src-mainline-0-nios2-elf-i686-pc-linux-gnu/gdb/common/errors.c:39
39	{
(gdb) bt
#0  error (
    fmt=fmt@entry=0x834d2c8 "Cannot execute this command without a live selected thread.")
    at /scratch/sandra/nios2-elf-fsf/obj/gdb-src-mainline-0-nios2-elf-i686-pc-linux-gnu/gdb/common/errors.c:39
#1  0x0811ed94 in ensure_valid_thread ()
    at /scratch/sandra/nios2-elf-fsf/obj/gdb-src-mainline-0-nios2-elf-i686-pc-linux-gnu/gdb/infcmd.c:696
#2  0x0812202c in continue_1 (all_threads=all_threads@entry=0)
    at /scratch/sandra/nios2-elf-fsf/obj/gdb-src-mainline-0-nios2-elf-i686-pc-linux-gnu/gdb/infcmd.c:768
#3  0x081221fa in continue_command (args=<optimized out>, from_tty=1)
    at /scratch/sandra/nios2-elf-fsf/obj/gdb-src-mainline-0-nios2-elf-i686-pc-linux-gnu/gdb/infcmd.c:858
#4  0x08202d9a in execute_command (p=<optimized out>, p@entry=0x8472998 "c", 
    from_tty=1)
    at /scratch/sandra/nios2-elf-fsf/obj/gdb-src-mainline-0-nios2-elf-i686-pc-linux-gnu/gdb/top.c:476
#5  0x08141cff in command_handler (command=0x8472998 "c")
    at /scratch/sandra/nios2-elf-fsf/obj/gdb-src-mainline-0-nios2-elf-i686-pc-linux-gnu/gdb/event-top.c:432
#6  0x081426fa in command_line_handler (rl=0x84ece58 "")
    at /scratch/sandra/nios2-elf-fsf/obj/gdb-src-mainline-0-nios2-elf-i686-pc-linux-gnu/gdb/event-top.c:629
#7  0x0824be3a in rl_callback_read_char ()
    at /scratch/sandra/nios2-elf-fsf/obj/gdb-src-mainline-0-nios2-elf-i686-pc-linux-gnu/readline/callback.c:220
#8  0x08141d68 in rl_callback_read_char_wrapper (client_data=0x0)
    at /scratch/sandra/nios2-elf-fsf/obj/gdb-src-mainline-0-nios2-elf-i686-pc-linux-gnu/gdb/event-top.c:166
#9  0x08140ad0 in handle_file_event (data=data@entry=...)
    at /scratch/sandra/nios2-elf-fsf/obj/gdb-src-mainline-0-nios2-elf-i686-pc-linux-gnu/gdb/event-loop.c:762
#10 0x08141088 in process_event ()
    at /scratch/sandra/nios2-elf-fsf/obj/gdb-src-mainline-0-nios2-elf-i686-pc-linux-gnu/gdb/event-loop.c:339
#11 process_event ()
    at /scratch/sandra/nios2-elf-fsf/obj/gdb-src-mainline-0-nios2-elf-i686-pc-linux-gnu/gdb/event-loop.c:311
#12 0x08141424 in gdb_do_one_event ()
    at /scratch/sandra/nios2-elf-fsf/obj/gdb-src-mainline-0-nios2-elf-i686-pc-linux-gnu/gdb/event-loop.c:403
#13 0x08141587 in start_event_loop ()
    at /scratch/sandra/nios2-elf-fsf/obj/gdb-src-mainline-0-nios2-elf-i686-pc-linux-gnu/gdb/event-loop.c:428
#14 0x0813ab58 in current_interp_command_loop ()
    at /scratch/sandra/nios2-elf-fsf/obj/gdb-src-mainline-0-nios2-elf-i686-pc-linux-gnu/gdb/interps.c:317
#15 0x0813b1d2 in captured_command_loop (data=data@entry=0x0)
    at /scratch/sandra/nios2-elf-fsf/obj/gdb-src-mainline-0-nios2-elf-i686-pc-linux-gnu/gdb/main.c:321
#16 0x081388a7 in catch_errors (
    func=func@entry=0x813b1c0 <captured_command_loop>, 
    func_args=func_args@entry=0x0, errstring=errstring@entry=0x830587c "", 
    mask=mask@entry=RETURN_MASK_ALL)
    at /scratch/sandra/nios2-elf-fsf/obj/gdb-src-mainline-0-nios2-elf-i686-pc-linux-gnu/gdb/exceptions.c:237
#17 0x0813be24 in captured_main (data=data@entry=0xffffd964)
    at /scratch/sandra/nios2-elf-fsf/obj/gdb-src-mainline-0-nios2-elf-i686-pc-linux-gnu/gdb/main.c:1149
#18 0x081388a7 in catch_errors (func=func@entry=0x813b7d0 <captured_main>, 
    func_args=func_args@entry=0xffffd964, 
    errstring=errstring@entry=0x830587c "", mask=mask@entry=RETURN_MASK_ALL)
    at /scratch/sandra/nios2-elf-fsf/obj/gdb-src-mainline-0-nios2-elf-i686-pc-linux-gnu/gdb/exceptions.c:237
#19 0x0813c5b7 in gdb_main (args=0xffffd964)
    at /scratch/sandra/nios2-elf-fsf/obj/gdb-src-mainline-0-nios2-elf-i686-pc-linux-gnu/gdb/main.c:1157
#20 0x0804ce9b in main (argc=2, argv=0xffffda24)
    at /scratch/sandra/nios2-elf-fsf/obj/gdb-src-mainline-0-nios2-elf-i686-pc-linux-gnu/gdb/gdb.c:32
(gdb) frame 1
#1  0x0811ed94 in ensure_valid_thread ()
    at /scratch/sandra/nios2-elf-fsf/obj/gdb-src-mainline-0-nios2-elf-i686-pc-linux-gnu/gdb/infcmd.c:696
696	    error (_("Cannot execute this command without a live selected thread."));
(gdb) print inferior_ptid
$1 = {pid = 42000, lwp = -1, tid = 1}
(gdb) print null_ptid
$2 = {pid = 0, lwp = 0, tid = 0}
(gdb) print is_exited (inferior_ptid)
$3 = 1
(gdb) print *find_thread_ptid (inferior_ptid)
$4 = {next = 0x0, ptid = {pid = 42000, lwp = -1, tid = 1}, num = 1, 
  name = 0x0, executing = 0, state = THREAD_EXITED, refcount = 0, control = {
    step_resume_breakpoint = 0x0, exception_resume_breakpoint = 0x0, 
    single_step_breakpoints = 0x0, step_range_start = 0, step_range_end = 0, 
    may_range_step = 0, step_frame_id = {stack_addr = 0, code_addr = 0, 
      special_addr = 0, stack_status = FID_STACK_INVALID, code_addr_p = 0, 
      special_addr_p = 0, artificial_depth = 0}, step_stack_frame_id = {
      stack_addr = 0, code_addr = 0, special_addr = 0, 
      stack_status = FID_STACK_INVALID, code_addr_p = 0, special_addr_p = 0, 
      artificial_depth = 0}, trap_expected = 0, proceed_to_finish = 0, 
    in_infcall = 0, step_over_calls = STEP_OVER_UNDEBUGGABLE, stop_step = 0, 
    stop_bpstat = 0x0, command_interp = 0x0}, suspend = {
    stop_signal = GDB_SIGNAL_0}, current_line = 0, current_symtab = 0x0, 
  prev_pc = 0, stepping_over_breakpoint = 0, stepping_over_watchpoint = 0, 
  step_after_step_resume_breakpoint = 0, continuations = 0x0, 
  intermediate_continuations = 0x0, step_multi = 0, pending_follow = {
    kind = TARGET_WAITKIND_SPURIOUS, value = {integer = 0, sig = GDB_SIGNAL_0, 
      related_pid = {pid = 0, lwp = 0, tid = 0}, execd_pathname = 0x0, 
      syscall_number = 0}}, stop_requested = 0, initiating_frame = {
    stack_addr = 0, code_addr = 0, special_addr = 0, 
    stack_status = FID_STACK_INVALID, code_addr_p = 0, special_addr_p = 0, 
    artificial_depth = 0}, private = 0x8508ad0, 
  private_dtor = 0x8051830 <free_private_thread_info>, btrace = {target = 0x0, 
    begin = 0x0, end = 0x0, level = 0, flags = 0, insn_history = 0x0, 
    call_history = 0x0, replay = 0x0}}
(gdb) 

  reply	other threads:[~2014-10-24 17:08 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-24 15:55 Sandra Loosemore
2014-10-24 16:07 ` Pedro Alves
2014-10-24 17:08   ` Sandra Loosemore [this message]
2014-10-24 17:23     ` Pedro Alves
2014-10-24 17:40       ` Pedro Alves
2014-10-24 19:02         ` Sandra Loosemore
2014-10-24 19:19         ` Doug Evans
2014-10-24 19:40           ` Pedro Alves
2014-10-24 20:02             ` Doug Evans
2014-10-24 20:20               ` Pedro Alves
2014-10-24 20:38                 ` Doug Evans
2014-10-24 20:52                   ` Remove libthread_db -> remove thread_stratum? [was Re: Cannot execute this command without a live selected thread.] Doug Evans
2014-10-24 22:07                   ` Cannot execute this command without a live selected thread Pedro Alves
2014-10-27 19:53         ` Sandra Loosemore
2014-10-28 12:10           ` [pushed] Workaround remote targets that report an empty list to qfThreadInfo (Re: Cannot execute this command without a live selected thread.) Pedro Alves
2014-10-29 19:16             ` Doug Evans
2014-10-24 17:57       ` Cannot execute this command without a live selected thread Sandra Loosemore
2014-10-24 18:15         ` 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=544A8741.9090705@codesourcery.com \
    --to=sandra@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