All of lore.kernel.org
 help / color / mirror / Atom feed
* Check if gdbsx is running
@ 2015-12-26 23:27 Carl Patenaude Poulin
  2015-12-26 23:38 ` Andrew Cooper
  0 siblings, 1 reply; 3+ messages in thread
From: Carl Patenaude Poulin @ 2015-12-26 23:27 UTC (permalink / raw)
  To: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 318 bytes --]

Hi all,

I'm writing some development tools for my team. Given a domain ID,
is there a way to programmatically check whether gdbsx is running on
that domain and what port it's running on? I could use something
like `top -b -n 1 | grep gdbsx` but that seems very brittle.

Best

Carl Patenaude Poulin
McGill University

[-- Attachment #1.2: Type: text/html, Size: 471 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Check if gdbsx is running
  2015-12-26 23:27 Check if gdbsx is running Carl Patenaude Poulin
@ 2015-12-26 23:38 ` Andrew Cooper
  2016-01-04 11:33   ` Ian Campbell
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Cooper @ 2015-12-26 23:38 UTC (permalink / raw)
  To: Carl Patenaude Poulin, xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 815 bytes --]

On 26/12/2015 23:27, Carl Patenaude Poulin wrote:
> Hi all,
>
> I'm writing some development tools for my team. Given a domain ID,
> is there a way to programmatically check whether gdbsx is running on
> that domain and what port it's running on? I could use something
> like `top -b -n 1 | grep gdbsx` but that seems very brittle.

With a XEN_DOMCTL_getdomaininfo hypercall, "flags & XEN_DOMINF_debugged" 
(or xc_dominfo_t.debugged) will tell you whether a debugger is attached 
to a domain.

This is the closest I am aware of you being able to get.

Whether gdbsx is running, or what port it is running on, are internal 
details to the domain running the debugger and not interesting to Xen.

If you can assume that all debuggers are run in dom0, then some process 
list based approach is probably best.

~Andrew

[-- Attachment #1.2: Type: text/html, Size: 1505 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Check if gdbsx is running
  2015-12-26 23:38 ` Andrew Cooper
@ 2016-01-04 11:33   ` Ian Campbell
  0 siblings, 0 replies; 3+ messages in thread
From: Ian Campbell @ 2016-01-04 11:33 UTC (permalink / raw)
  To: Andrew Cooper, Carl Patenaude Poulin, xen-devel

On Sat, 2015-12-26 at 23:38 +0000, Andrew Cooper wrote:
> On 26/12/2015 23:27, Carl Patenaude Poulin wrote:
> > Hi all,
> > 
> > I'm writing some development tools for my team. Given a domain ID,
> > is there a way to programmatically check whether gdbsx is running on
> > that domain and what port it's running on? I could use something
> > like `top -b -n 1 | grep gdbsx` but that seems very brittle.
> With a XEN_DOMCTL_getdomaininfo hypercall, "flags & XEN_DOMINF_debugged"
> (or xc_dominfo_t.debugged) will tell you whether a debugger is attached
> to a domain.
> 
> This is the closest I am aware of you being able to get.
> 
> Whether gdbsx is running, or what port it is running on, are internal
> details to the domain running the debugger and not interesting to Xen.
> 
> If you can assume that all debuggers are run in dom0, then some process
> list based approach is probably best.

Or patching gdbsx to leave a dropping (akin to a pid file) pointing to the
correct port for a named domain (e.g. /var/run/gdbsx.$domid.port or
something in xenstore maybe?).

Or even make it able to use a named pipe or Unix domain socket instead of a
port (assuming the gdb client supports the same).

Ian.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-01-04 11:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-26 23:27 Check if gdbsx is running Carl Patenaude Poulin
2015-12-26 23:38 ` Andrew Cooper
2016-01-04 11:33   ` Ian Campbell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.