From: Aleksandar Ristovski <aristovski@qnx.com>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [patch] gdbserver: qXfer multiprocess
Date: Wed, 17 Jun 2009 17:19:00 -0000 [thread overview]
Message-ID: <4A39258E.2000506@qnx.com> (raw)
In-Reply-To: <200906170204.45325.pedro@codesourcery.com>
[-- Attachment #1: Type: text/plain, Size: 535 bytes --]
Pedro Alves wrote:
>
> By querying the target, how else? Something like:
>
> + if (target_supports_multi_process ())
> strcat (own_buf, ";multiprocess+");
>
Here is a patch that does what you described.
Thanks,
--
Aleksandar Ristovski
QNX Software Systems
ChangeLog:
* target.h (supports_multiprocess): New function.
* server.c (handle_query): Use supports_multiprocess and output
multiprocess accordingly.
* linux-low.c (linux_supports_multiprocess): New function.
(linux_target_ops): Set supports_multiprocess.
[-- Attachment #2: gdbserver-supports_multiprocess-20090617.diff --]
[-- Type: text/x-patch, Size: 2243 bytes --]
Index: target.h
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/target.h,v
retrieving revision 1.36
diff -u -p -r1.36 target.h
--- target.h 1 Apr 2009 22:50:24 -0000 1.36
+++ target.h 17 Jun 2009 17:12:04 -0000
@@ -275,6 +283,8 @@ struct target_ops
/* Switch to non-stop (1) or all-stop (0) mode. Return 0 on
success, -1 otherwise. */
int (*start_non_stop) (int);
+
+ int (*supports_multiprocess) (void);
};
extern struct target_ops *the_target;
@@ -311,6 +321,10 @@ void set_target_ops (struct target_ops *
#define target_async(enable) \
(the_target->async ? (*the_target->async) (enable) : 0)
+#define target_supports_multiprocess() \
+ (the_target->supports_multiprocess ? \
+ (*the_target->supports_multiprocess) () : 0)
+
/* Start non-stop mode, returns 0 on success, -1 on failure. */
int start_non_stop (int nonstop);
Index: server.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/server.c,v
retrieving revision 1.97
diff -u -p -r1.97 server.c
--- server.c 24 May 2009 21:06:53 -0000 1.97
+++ server.c 17 Jun 2009 17:12:04 -0000
@@ -1106,7 +1106,8 @@ handle_query (char *own_buf, int packet_
if (the_target->qxfer_osdata != NULL)
strcat (own_buf, ";qXfer:osdata:read+");
- strcat (own_buf, ";multiprocess+");
+ if (target_supports_multiprocess ())
+ strcat (own_buf, ";multiprocess+");
if (target_supports_non_stop ())
strcat (own_buf, ";QNonStop+");
Index: linux-low.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/linux-low.c,v
retrieving revision 1.105
diff -u -p -r1.105 linux-low.c
--- linux-low.c 24 May 2009 17:44:19 -0000 1.105
+++ linux-low.c 17 Jun 2009 17:12:06 -0000
@@ -3008,6 +3008,12 @@ linux_start_non_stop (int nonstop)
return 0;
}
+static int
+linux_supports_multiprocess (void)
+{
+ return 1;
+}
+
static struct target_ops linux_target_ops = {
linux_create_inferior,
linux_attach,
@@ -3045,6 +3053,7 @@ static struct target_ops linux_target_op
linux_supports_non_stop,
linux_async,
linux_start_non_stop,
+ linux_supports_multiprocess
};
static void
next prev parent reply other threads:[~2009-06-17 17:19 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-16 20:10 Aleksandar Ristovski
2009-06-16 21:09 ` Pedro Alves
2009-06-17 0:56 ` Aleksandar Ristovski
2009-06-17 1:04 ` Pedro Alves
2009-06-17 1:17 ` Aleksandar Ristovski
2009-06-17 17:19 ` Aleksandar Ristovski [this message]
2009-06-17 18:04 ` Pedro Alves
2009-06-17 19:06 ` Aleksandar Ristovski
2009-06-19 13:41 ` Pedro Alves
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=4A39258E.2000506@qnx.com \
--to=aristovski@qnx.com \
--cc=gdb-patches@sourceware.org \
--cc=pedro@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