lkml.org 
[lkml]   [2019]   [Jun]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: Pause a process execution from external program
Hi Pintu,


> Hi All,
> I was just wondering if this is possible in the Linux world.
> My requirement is:
> For some reason, I want to halt/pause the execution (for some
> specified time) of a running process/thread (at some location),
> without modified the source, may be by firing some events/signals from
> an another external program, by specifying the address location or a
> line number.
>
> Is this possible ?
> May be by using some system call, or other mechanism using the process PID.
> Assume that its a debugging system with all root privileges.
>
> Basically, its just like how "gdb" is able to set the break-point in a
> program, and able to stop its execution exactly at that location.
> I am wondering what mechanism "gdb" uses to do this?

gdb uses ptrace system call, may you can explore ptrace?

> I tried to check here, but could find the exact place, where this is handled:
> https://github.com/bminor/binutils-gdb/blob/master/gdb/breakpoint.c

from command line we use ctrl-z to stop execution of a foreground
process but you can program
SIGTSTP signal handler in your application code to do the same.

is that you want ?

Thanks a lot,
Shyam

\
 
 \ /
  Last update: 2019-06-13 18:34    [W:0.170 / U:1.620 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site