Article View: gnu.gdb.bug
Article #827attach/detach supported on HPUX 6.5
From: David Newton
Date: Tue, 06 Feb 1990 17:49
Date: Tue, 06 Feb 1990 17:49
48 lines
2022 bytes
2022 bytes
Gdb 3.3 as distributed does not support the attach command to an executing
process. The following code (copied from sun3-dep.c with slight renaming of
ptrace arguments to match the HP include file) inserted into hp9k320-dep.c
after the code for function "kill-inferior" provides a functioning attach
command.
| #ifdef ATTACH_DETACH
|
| extern int attach_flag ;
|
| /* Start debugging the process whose number is PID. */
|
| attach (pid)
| int pid;
| {
| errno = 0;
| ptrace (PT_ATTACH, pid, 0, 0);
| if (errno)
| perror_with_name ("ptrace");
| attach_flag = 1;
| return pid;
| }
|
| /* Stop debugging the process whose number is PID
| and continue it with signal number SIGNAL.
| SIGNAL = 0 means just continue it. */
|
| void
| detach (signal)
| int signal;
| {
| errno = 0;
| ptrace (PT_DETACH, inferior_pid, 1, signal);
| if (errno)
| perror_with_name ("ptrace");
| attach_flag = 0;
| }
| #endif /* ATTACH_DETACH */
+---------------------------------+----------------------------------+
| David Newton | HPDESK: David Newton/HP1400/B1 |
| Hewlett Packard Ltd | ARPA: daven@hpsqf.sqf.hp.com |
| Queensferry Telecomms Division | |
| South Queensferry | UUCP: ..!hplabs!hpsqf!daven |
| West Lothian | JANET: daven@hpqtdla.hp.co.uk |
| Scotland EH30 9TG. | PHONE: +44-31-331-7234 |
+---------------------------------+----------------------------------+
Technical Details
Message-ID:
<9002061749.AA00210@hpqtdlj.HP.COM>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!HPQTDLJ.SQF.HP.COM!davenShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!HPQTDLJ.SQF.HP.COM!daven From: daven@HPQTDLJ.SQF.HP.COM (David Newton) Newsgroups: gnu.gdb.bug Subject: attach/detach supported on HPUX 6.5 Message-ID: <9002061749.AA00210@hpqtdlj.HP.COM> Date: 6 Feb 90 17:49:36 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 48