mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-08-06 14:49:38 +08:00
PR 8145.
* thread.c (do_captured_list_thread_ids): Report the current thread id.
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
2009-01-30 Vladimir Prus <vladimir@codesourcery.com>
|
||||||
|
|
||||||
|
PR 8145.
|
||||||
|
* thread.c (do_captured_list_thread_ids): Report the current
|
||||||
|
thread id.
|
||||||
|
|
||||||
2009-01-30 Vladimir Prus <vladimir@codesourcery.com>
|
2009-01-30 Vladimir Prus <vladimir@codesourcery.com>
|
||||||
|
|
||||||
* breakpoint.c (create_breakpoint, create_breakpoints)
|
* breakpoint.c (create_breakpoint, create_breakpoints)
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
2009-01-30 Vladimir Prus <vladimir@codesourcery.com>
|
||||||
|
|
||||||
|
* gdb.texinfo (GDB/MI Thread Commands): Document the
|
||||||
|
'current-thread-id' field. Remove the example with zero threads,
|
||||||
|
since current GDB won't ever report that if there's inferior.
|
||||||
|
|
||||||
2009-01-30 Vladimir Prus <vladimir@codesourcery.com>
|
2009-01-30 Vladimir Prus <vladimir@codesourcery.com>
|
||||||
|
|
||||||
* gdb.texinfo (GDB/MI Breakpoint Commands): Document the -d
|
* gdb.texinfo (GDB/MI Breakpoint Commands): Document the -d
|
||||||
|
@ -20513,23 +20513,11 @@ Part of @samp{info threads} supplies the same information.
|
|||||||
|
|
||||||
@subsubheading Example
|
@subsubheading Example
|
||||||
|
|
||||||
No threads present, besides the main process:
|
|
||||||
|
|
||||||
@smallexample
|
|
||||||
(gdb)
|
|
||||||
-thread-list-ids
|
|
||||||
^done,thread-ids=@{@},number-of-threads="0"
|
|
||||||
(gdb)
|
|
||||||
@end smallexample
|
|
||||||
|
|
||||||
|
|
||||||
Several threads:
|
|
||||||
|
|
||||||
@smallexample
|
@smallexample
|
||||||
(gdb)
|
(gdb)
|
||||||
-thread-list-ids
|
-thread-list-ids
|
||||||
^done,thread-ids=@{thread-id="3",thread-id="2",thread-id="1"@},
|
^done,thread-ids=@{thread-id="3",thread-id="2",thread-id="1"@},
|
||||||
number-of-threads="3"
|
current-thread-id="1",number-of-threads="3"
|
||||||
(gdb)
|
(gdb)
|
||||||
@end smallexample
|
@end smallexample
|
||||||
|
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
2009-01-30 Vladimir Prus <vladimir@codesourcery.com>
|
||||||
|
|
||||||
|
* lib/mi-support.exp (et_mi_thread_list)
|
||||||
|
(check_mi_and_console_threads): Adjust for current thread in
|
||||||
|
-thread-list-ids output.
|
||||||
|
|
||||||
2009-01-30 Vladimir Prus <vladimir@codesourcery.com>
|
2009-01-30 Vladimir Prus <vladimir@codesourcery.com>
|
||||||
|
|
||||||
* gdb.mi/mi-break.exp (test_disabled_creation): New.
|
* gdb.mi/mi-break.exp (test_disabled_creation): New.
|
||||||
|
@ -1605,7 +1605,7 @@ proc get_mi_thread_list {name} {
|
|||||||
# ^done,thread-ids=[thread-id="1",thread-id="2",...],number-of-threads="N"
|
# ^done,thread-ids=[thread-id="1",thread-id="2",...],number-of-threads="N"
|
||||||
# (gdb)
|
# (gdb)
|
||||||
mi_gdb_test "-thread-list-ids" \
|
mi_gdb_test "-thread-list-ids" \
|
||||||
{.*\^done,thread-ids={(thread-id="[0-9]+"(,)?)+},number-of-threads="[0-9]+"} \
|
{.*\^done,thread-ids={(thread-id="[0-9]+"(,)?)+},current-thread-id="[0-9]+",number-of-threads="[0-9]+"} \
|
||||||
"-thread_list_ids ($name)"
|
"-thread_list_ids ($name)"
|
||||||
|
|
||||||
set output {}
|
set output {}
|
||||||
@ -1639,7 +1639,7 @@ proc check_mi_and_console_threads {name} {
|
|||||||
global expect_out
|
global expect_out
|
||||||
|
|
||||||
mi_gdb_test "-thread-list-ids" \
|
mi_gdb_test "-thread-list-ids" \
|
||||||
{.*\^done,thread-ids={(thread-id="[0-9]+"(,)*)+},number-of-threads="[0-9]+"} \
|
{.*\^done,thread-ids={(thread-id="[0-9]+"(,)*)+},current-thread-id="[0-9]+",number-of-threads="[0-9]+"} \
|
||||||
"-thread-list-ids ($name)"
|
"-thread-list-ids ($name)"
|
||||||
set mi_output {}
|
set mi_output {}
|
||||||
if {[info exists expect_out(buffer)]} {
|
if {[info exists expect_out(buffer)]} {
|
||||||
|
@ -410,6 +410,7 @@ do_captured_list_thread_ids (struct ui_out *uiout, void *arg)
|
|||||||
struct thread_info *tp;
|
struct thread_info *tp;
|
||||||
int num = 0;
|
int num = 0;
|
||||||
struct cleanup *cleanup_chain;
|
struct cleanup *cleanup_chain;
|
||||||
|
int current_thread = -1;
|
||||||
|
|
||||||
prune_threads ();
|
prune_threads ();
|
||||||
target_find_new_threads ();
|
target_find_new_threads ();
|
||||||
@ -420,11 +421,18 @@ do_captured_list_thread_ids (struct ui_out *uiout, void *arg)
|
|||||||
{
|
{
|
||||||
if (tp->state_ == THREAD_EXITED)
|
if (tp->state_ == THREAD_EXITED)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (ptid_equal (tp->ptid, inferior_ptid))
|
||||||
|
current_thread = tp->num;
|
||||||
|
|
||||||
num++;
|
num++;
|
||||||
ui_out_field_int (uiout, "thread-id", tp->num);
|
ui_out_field_int (uiout, "thread-id", tp->num);
|
||||||
}
|
}
|
||||||
|
|
||||||
do_cleanups (cleanup_chain);
|
do_cleanups (cleanup_chain);
|
||||||
|
|
||||||
|
if (current_thread != -1)
|
||||||
|
ui_out_field_int (uiout, "current-thread-id", current_thread);
|
||||||
ui_out_field_int (uiout, "number-of-threads", num);
|
ui_out_field_int (uiout, "number-of-threads", num);
|
||||||
return GDB_RC_OK;
|
return GDB_RC_OK;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user