From: Nick Roberts <nickrob@snap.net.nz>
To: Vladimir Prus <vladimir@codesourcery.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFA] Implement -thread-info.
Date: Mon, 18 Feb 2008 21:45:00 -0000 [thread overview]
Message-ID: <18361.64577.771676.184618@kahikatea.snap.net.nz> (raw)
In-Reply-To: <200802181038.04497.vladimir@codesourcery.com>
> > mi_info_threads is nearly the same function as thread_command.
>
> You probably meant info_threads_command?
Yes.
> > Can this be
> > used in a dual way just as -break-list uses breakpoint_1?
>
> I don't know -- I actually have no idea what magic makes breakpoint_1 to
> work both for MI and CLI. Do you happen to know?
It just seems to be a kind of overloading where the output format of
functions like ui_out_field_string depends on the interpreter used (value
of uiout). In cases where only one interpreter outputs anything
ui_out_is_mi_like_p is used.
> > Also Denis Pilat has already proposed a patch for -thread-info:
> > http://sourceware.org/ml/gdb-patches/2007-03/msg00167.html
>
> I did not notice that.
>
> >
> > How does your patch compare? (assuming the problem of return type is solved
> > as has been done for thread_select).
>
> It appears that my patch:
>
> 1. Does not bother with making non-throwing function, as MI top-level can
> handle exceptions.
>
> 2. Allows to print information about all threads.
I see. Denis also proposed something for -thread-list-all-threads
(http://sourceware.org/ml/gdb-patches/2007-03/msg00144.html)
Do you not want to print the frame level? Also do you want to
catch errors in print_stack_frame? Rather than:
+ print_stack_frame (get_selected_frame (NULL), 0, LOCATION);
Would it be better to use:
+ print_frame_info (get_selected_frame (NULL), 1, LOC_AND_ADDRESS, 0);
?
Note that with MI (following the thread with Denis) that the address gets
printed anyway when print_stack_frame is used:
args.print_what = ui_out_is_mi_like_p (uiout) ? LOC_AND_ADDRESS : print_what;
> I don't know what problem of return type you refer to -- can you clarify?
That, in Denis' patch, gdb_thread_info returns type enum gdb_rc but
catch_exceptions_with_msg returns type int. (just like gdb_breakpoint and
break_command_really did for a while).
--
Nick http://www.inet.net.nz/~nickrob
next prev parent reply other threads:[~2008-02-18 21:45 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-17 15:33 Vladimir Prus
2008-02-18 6:26 ` Nick Roberts
2008-02-18 7:38 ` Vladimir Prus
2008-02-18 21:45 ` Nick Roberts [this message]
2008-02-20 11:28 ` Vladimir Prus
2008-02-20 19:07 ` Eli Zaretskii
2008-02-20 19:38 ` Nick Roberts
2008-02-20 20:03 ` Vladimir Prus
2008-02-26 0:58 ` Nick Roberts
2008-02-26 1:21 ` Daniel Jacobowitz
2008-03-23 4:56 ` Nick Roberts
2008-03-23 7:38 ` Vladimir Prus
2008-03-23 16:22 ` Daniel Jacobowitz
2008-03-08 15:50 ` Vladimir Prus
2008-03-08 15:55 ` Vladimir Prus
2008-03-08 20:04 ` Nick Roberts
2008-03-10 7:59 ` Vladimir Prus
2008-03-10 9:13 ` Nick Roberts
2008-03-14 10:17 ` Vladimir Prus
2008-03-17 18:40 ` Michael Snyder
2008-03-14 15:08 ` Daniel Jacobowitz
2008-03-14 15:11 ` Daniel Jacobowitz
2008-03-14 17:04 ` Vladimir Prus
2008-03-14 18:04 ` Daniel Jacobowitz
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=18361.64577.771676.184618@kahikatea.snap.net.nz \
--to=nickrob@snap.net.nz \
--cc=gdb-patches@sources.redhat.com \
--cc=vladimir@codesourcery.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