This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Sending signal to inferior program.


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]