Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: George Anzinger <george@mvista.com>
To: Andrew Cagney <cagney@gnu.org>
Cc: Daniel Jacobowitz <drow@mvista.com>,
	Eli Zaretskii <eliz@elta.co.il>,
	gdb@sources.redhat.com
Subject: Re: Making "info thread" sane
Date: Fri, 12 Mar 2004 00:24:00 -0000	[thread overview]
Message-ID: <40510325.4070101@mvista.com> (raw)
In-Reply-To: <404D1CFF.6070209@gnu.org>

Andrew Cagney wrote:
>> First, the objective is to get something like what "info thread" does 
>> but with a frame that is outside of the switch code (which may mean  
>> several frames up the stack).  I was considering a macro that would do 
>> a silent info thread followed by a loop on each discovered thread.  In 
>> your message yesterday you suggested something like:
>>
>> thread apply all try... end
>>
>> Well, I don't find "try" but the apply all seems to accept a macro as 
>> a command so I think this will do the right thing.  And up-silent does 
>> a silent up.
> 
> 
> "try" isn't seen cos the patch is sitting in the bug database :-(
> 
> I mentioned "try" as without it the command will abort on the first 
> error (e.g., corrupt stack for bad memory access).
> 
>> So, this would be my macro set:
>>
>> define do_threads
>>   thread apply all do_th_lines
>> end
>>
>> define do_th_lines
>>   while ($pc > $low_sched) && ($pc < $high_sched)
>>     up-silent
>>   end
>>   do-silent
>>   up
>> end
>>
>> What is missing are: 1) I would like to not have the newline after the
>> "Thread 1 (Thread 1):" (a minor point, but with 100 threads it adds 
>> up) and
> 
>  > 2) I would like to have the result of the "ThreadExtraInfo" on the 
> same line (as the info thread command does).
> 
> Can you post the output so we can see exactly what you mean here?

I haven't got it all working as yet, but the "thread apply all"
puts out something like:
  Thread 1 (Thread 1):
for each thread.  An option I would like is for this to not have new line so I 
can add to it, something like:
Thread 1 (Thread 1): (init) 0xff00....
and keep it all on one line.
> 
>> Nice, would be the ability to print the final up result without doing 
>> the down first.  In fact this is really needed if it turns out that we 
>> are at the first frame which would be the case for the current 
>> thread.  Is that a command I missed?
> 
> 
> You mean an abbreviated "info frame"?  Yes, using "up" to get that 
> output isn't right.

Not only isn't it right, it does not work if at the bottom of the stack.  Right 
now this is what errors out my macro set.
> 
>> I suspect that 2) can be handled by "info remote-process" with changes 
>> to the stub AND I would like this to NOT put in a linefeed.
> 
> 
> What "info remote-process" command?
To quote the source:

* This query allows the target stub to return an arbitrary string
  * (or strings) giving arbitrary information about the target process.
  * This is optional; the target stub isn't required to implement it.
  *
  * Syntax: qfProcessInfo        request first string
  *         qsProcessInfo        request subsequent string
  * reply:  'O'<hex-encoded-string>
  *         'l'                  last reply (empty)
  */

I have not, as yet, coded this into my stub so I don't know what gdb does with 
it, but, again, I want a way to suppress the new line that I suspect it attaches.

In the case of kgdb, what I want to return here is the task name and put it in 
the threads report much as the extra thread info is put in the info threads report.
> 
>> It would appear that this has unwound into a couple of rather simple 
>> things:
>> a) No new line capability on the "thread apply all"
>> b) No new line on "info remote-process"
>> c) Ability to do the up/down report without moving to a new frame. 
> 
> 
Actually with out c) the whole thing is a non-starter.  Is there some trick to 
make this happen today?

I think an option on the info stack command would be just the thing.  I.e. info 
stack <frame> <limit>  where limit, if present says how many frames to display 
prior to <frame>.  So info stack 3 0 would display frame 3 only while
info stack 3 2 would display frames 1,2,and 3.

-- 
George Anzinger   george@mvista.com
High-res-timers:  http://sourceforge.net/projects/high-res-timers/
Preemption patch: http://www.kernel.org/pub/linux/kernel/people/rml


  reply	other threads:[~2004-03-12  0:24 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20040227212301.GC1052@smtp.west.cox.net>
     [not found] ` <20040227235059.GG425@elf.ucw.cz>
     [not found]   ` <403FEA02.6040506@mvista.com>
     [not found]     ` <200403011454.35346.amitkale@emsyssoft.com>
     [not found]       ` <4044FEDE.5000105@mvista.com>
     [not found]         ` <20040302214535.GA24405@nevyn.them.org>
     [not found]           ` <40450749.7020304@mvista.com>
     [not found]             ` <20040302221718.GA26931@nevyn.them.org>
2004-03-02 23:15               ` George Anzinger
2004-03-02 23:25                 ` Andrew Cagney
2004-03-03  0:14                   ` George Anzinger
2004-03-03  6:01                     ` Eli Zaretskii
2004-03-03 14:28                       ` Daniel Jacobowitz
2004-03-03 15:08                         ` Andrew Cagney
2004-03-03 18:40                         ` George Anzinger
2004-03-03 18:54                           ` Andrew Cagney
2004-03-03 22:04                             ` George Anzinger
2004-03-09  1:25                               ` Andrew Cagney
2004-03-12  0:24                                 ` George Anzinger [this message]
2004-03-12 21:33                                   ` Andrew Cagney
2004-03-22  9:40                                     ` George Anzinger
2004-04-21  1:30                                     ` George Anzinger
2004-03-08 19:21 Jim Houston

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=40510325.4070101@mvista.com \
    --to=george@mvista.com \
    --cc=cagney@gnu.org \
    --cc=drow@mvista.com \
    --cc=eliz@elta.co.il \
    --cc=gdb@sources.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