From: Pintu Agarwal <pintu.ping@gmail.com> To: Shyam Saini <mayhs11saini@gmail.com> Cc: open list <linux-kernel@vger.kernel.org>, pedro@palves.net, Kernelnewbies <kernelnewbies@kernelnewbies.org> Subject: Re: Pause a process execution from external program Date: Thu, 13 Jun 2019 20:23:11 +0530 Message-ID: <CAOuPNLivFg5jnhzz7GaUjz6Sd5+-3aNeUhbPbnMTBnumpPgSvA@mail.gmail.com> (raw) In-Reply-To: <CAOfkYf7BZ1Ttrm7iVioq4mxZcJy7V44gNmusavPzgi=59=TY6g@mail.gmail.com> On Thu, Jun 13, 2019 at 1:22 PM Shyam Saini <mayhs11saini@gmail.com> wrote: > > 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? > oh thank you so much. Yes, ptrace is going to be very helpful. I will explore more on this and come back if required. > > 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 ? > This required source code modification in the target program, so I don't want this. > Thanks a lot, > Shyam _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
next prev parent reply index Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-06-13 7:43 Pintu Agarwal 2019-06-13 7:52 ` Shyam Saini 2019-06-13 14:53 ` Pintu Agarwal [this message] 2019-06-13 19:43 ` Valdis Klētnieks 2019-06-17 12:20 ` Pintu Agarwal 2019-06-13 15:21 ` Elias Kouskoumvekakis 2019-06-17 12:19 ` Pintu Agarwal
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=CAOuPNLivFg5jnhzz7GaUjz6Sd5+-3aNeUhbPbnMTBnumpPgSvA@mail.gmail.com \ --to=pintu.ping@gmail.com \ --cc=kernelnewbies@kernelnewbies.org \ --cc=linux-kernel@vger.kernel.org \ --cc=mayhs11saini@gmail.com \ --cc=pedro@palves.net \ /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
Kernel Newbies Archive on lore.kernel.org Archives are clonable: git clone --mirror https://lore.kernel.org/kernelnewbies/0 kernelnewbies/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 kernelnewbies kernelnewbies/ https://lore.kernel.org/kernelnewbies \ kernelnewbies@kernelnewbies.org public-inbox-index kernelnewbies Example config snippet for mirrors Newsgroup available over NNTP: nntp://nntp.lore.kernel.org/org.kernelnewbies.kernelnewbies AGPL code for this site: git clone https://public-inbox.org/public-inbox.git