Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Sending signal to inferior program.
@ 2011-06-06 17:32 logitech
  2011-06-06 18:18 ` Jan Kratochvil
  0 siblings, 1 reply; 4+ messages in thread
From: logitech @ 2011-06-06 17:32 UTC (permalink / raw)
  To: gdb


Hi, I am currently working with the gdb source code. I wish to send a signal
to the inferior program at a specific time. I tried forking a thread in
gdb.c which sends signal to the inferior process. To get its pid, I declared
an extern variable shared between gdb.c and linux-nat.c
But this gives a seg fault. Also the signal doesn't seem to get delivered.

In linux-nat.c

if (debug_linux_nat)
    fprintf_unfiltered (gdb_stdlog, "linux_nat_wait: [%s]\n",
target_pid_to_str (ptid));

   gpid=ptid.pid; // gpid gets the pid value, the signal is sent to gpid
from gdb.c

Moreover when i debug this with flag set, gpid initially gets the value of
pid of inferior, but later it becomes -1.

Is there any other way in which I can accomplish this. 
Thanks 
-- 
View this message in context: http://old.nabble.com/Sending-signal-to-inferior-program.-tp31785488p31785488.html
Sent from the Sourceware - gdb list mailing list archive at Nabble.com.


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

end of thread, other threads:[~2011-06-06 21:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-06 17:32 Sending signal to inferior program logitech
2011-06-06 18:18 ` Jan Kratochvil
2011-06-06 20:25   ` logitech
2011-06-06 21:03     ` Jan Kratochvil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox