Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Nat Gurumoorthy <natg@ubicom.com>
To: drow@mvista.com
Cc: gdb@sources.redhat.com
Subject: Re: Proposal for customization of output of "to_pid_to_str" op in remote.c
Date: Thu, 12 Dec 2002 11:33:00 -0000	[thread overview]
Message-ID: <200212121933.gBCJXht27822@ubicom.com> (raw)

>Daniel Jaccobowitz wrote
>What's wrong with:
>1  Thread 1 (Original thread)
>2  Thread 2 (Extra thread)
>3  Thread 4 (Thread I Felt Like)
>?  What output do you want?  I'd like to keep it printing the TID for
>consistency.

Daniel,
     Personally there is nothing wrong with the above display. I have
consumers of our debugger who want to see only:
1 Original thread
2 Extra thread
3 Thread I Felt Like

Right now the way remote.c is set up I am unable to satisfy that.


>In any case, a target macro the way you did this is probably the wrong
>way.  It looks almost like you want a gdbarch method...

I am in total agreement with you on this. Red Had did a port of GDB for
our next generation processor where they did add support to gdbarch
to allow a target which uses the remote protocl to be able to provide
functions in its tdep.c files for the following thread related operations

to_thread_alive
to_find_new_threads
to_pid_to_str
to_extra_thread_info

They changed code in remote.c to invoke the functionality in the tdep.c
file.

Here is a sample of what they did

In gdbarch.sh the following was added
# Return a static string representation of internal gdb process id PID.
F:2:REMOTE_PID_TO_STR:char *:remote_pid_to_str:ptid_t ptid:ptid::0
#


In remote.c the remote_pid_to_str was changed as follows

static char *
remote_pid_to_str (ptid_t ptid)
{
  static char buf[30];

  if (REMOTE_PID_TO_STR_P ())
    return REMOTE_PID_TO_STR (ptid);

  sprintf (buf, "Thread %d", PIDGET (ptid));
  return buf;
}

In the target-tdep.c there is a call to 
  "set_gdbarch_remote_pid_to_str" to register the target dependent
pid_to_str function.


I am trying to migrate the original Red Hat work to the top
of trunk GDB and I ran into the issue that what Red Hat had
done for us in not available in the top of trunk. The way they
have implemented is the right way to do it. What do I have to
do make it happen?

Regards
Nat


             reply	other threads:[~2002-12-12 19:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-12 11:33 Nat Gurumoorthy [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-12-11 14:55 Nat Gurumoorthy
2002-12-11 14:52 Nat Gurumoorthy
2002-12-11 14:57 ` Daniel Jacobowitz
2002-12-10 18:24 Nat Gurumoorthy
2002-12-10 18:57 ` Christopher Faylor
2002-12-10 19:04 ` Daniel Jacobowitz
2002-12-10 19:04 ` Andrew Cagney
2002-12-10 16:17 Nat Gurumoorthy
2002-12-10 16:49 ` 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=200212121933.gBCJXht27822@ubicom.com \
    --to=natg@ubicom.com \
    --cc=drow@mvista.com \
    --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