This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Proposal for customization of output of "to_pid_to_str" op in remote.c.
- From: Nat Gurumoorthy <natg at ubicom dot com>
- To: gdb at sources dot redhat dot com
- Cc: nickk at ubicom dot com
- Date: Tue, 10 Dec 2002 16:17:11 -0800
- Subject: Proposal for customization of output of "to_pid_to_str" op in remote.c.
HI all,
This is a proposal to allow targets using the remote backend to
customize the output of "to_pid_to_str" operations. The changes to
src/gdb/remote.c would be as follows:
/* Convert a thread ID to a string. Returns the string in a static
buffer. */
static char *
remote_pid_to_str (ptid_t ptid)
{
static char buf[30];
#ifndef REMOTE_PID_TO_STR
sprintf (buf, "Thread %d", PIDGET (ptid));
#else
REMOTE_PID_TO_STR(buf, ptid, 30);
#endif
return buf;
}
In the target "tm-XXXX.h"
extern void my_target_pid_to_str(char *buf, ptid_t ptid, unsigned int buflength);
#define REMOTE_PID_TO_STR(buf, ptid, buflength) my_target_pid_to_str(buf, ptid, buflength)
In the target "target-tdep.c" file
void
my_target_pid_to_str(char *buf, ptid_t ptid, unsigned int buflength)
{
/* sprintf some sensible string into the provided buffer */
..
..
..
}
Currently remote.c provides all the facilities for multithreaded
debugging except for a way to print a customized name for that thread.
Is this the proper forum to discuss this idea? Do I have to file a PR
and mark it as an enhancement request?
I'd like some feedback on this proposal. Is this going to screw up
multi arch support?
Regards
Nat