[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::digital_unix

Title:DIGITAL UNIX(FORMERLY KNOWN AS DEC OSF/1)
Notice:Welcome to the Digital UNIX Conference
Moderator:SMURF::DENHAM
Created:Thu Mar 16 1995
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:10068
Total number of notes:35879

368.0. "dbx: How to step into exec'd program??" by GALVIA::STONES (Tom Stones) Wed Apr 12 1995 09:18

T.RTitleUserPersonal
Name
DateLines
368.1very soon now...QUARRY::petertrigidly defined areas of doubt and uncertaintyWed Apr 12 1995 12:327
368.2Me and my big mouth...GALVIA::STONESTom StonesWed Apr 12 1995 13:173
368.3ANy news?METSYS::HELLIARhttp://samedi.reo.dec.com/Mon Mar 24 1997 04:198
    Hi,
    
    I'm hitting a similar problem with Digital Unix 3.2C. Given its nearly
    2 years on is there anything 'new' that I can try.
    
    Also, if not, whats the definition of 'blocking' the child? 
    
    Graham
368.4Done that, but not for 3.2, which doesn't mean....QUARRY::petertrigidly defined areas of doubt and uncertaintyMon Mar 24 1997 12:1681
Debugging 'exec'd program support was added in V4.0.  The default is to
detect an exec and stop the process at the main point in the new 
program.  At the moment, you need to be debugging the process that is
going to exec in order to be able to see it.  So, in the test case I have,
One process forks, and the forked child execs a new process:

petert@deneb 46> dbx childes
dbx version 3.11.12
Type 'help' for help.

main:  17  if( pipe(toParent) < 0 || pipe(toChild) < 0 )
(dbx) r
New child attached.  Use switch to gain access to process 7363
(dbx) sw 7363
sw 7363

Process 7363:
stopped at   [main:23 +0x8,0x1200013b0]         pid=fork();
(dbx) c
c
(dbx) child forked, pid=7363

Process 7363 now executing in file chipper
stopped at   [main:11 ,0x1200011f4]     write(STDOUT_FILENO, argv[0], sizeof(pid_t)+1);
(dbx) 


This does not work at 3.2c.  You can grap a V4.0 version of the debugger,
but to have it work on a 3.2c system, you have to set up the env variable _RLD_LIST.

setenv _RLD_LIST "DEFAULT:/usr/shlib/libots.so"

or the equivalent for other shells.  You may run into some other problems
that really can't be worked for this release.  One at least is harmless:

% setenv _RLD_LIST "DEFAULT:/usr/shlib/libots.so"
% ./v4.0/dbx childes
dbx version 3.11.10
Type 'help' for help.

main:  17  if( pipe(toParent) < 0 || pipe(toChild) < 0 )
(./v4.0/dbx) r
New child attached.  Use switch to gain access to process 10046
(./v4.0/dbx) sw 10046

Process 10046:
stopped at   [main:24 ,0x120001440]     if( pid < 0 )
(./v4.0/dbx) c
(./v4.0/dbx) child forked, pid=10046

Process 10046 now executing in file chipper
stopped at   [main:11 ,0x12000124c]     write(STDOUT_FILENO, argv[0], sizeof(pid_t)+1);
(./v4.0/dbx) n
5 bytes read from child, value=10046
exiting parent
  [main:12 ,0x12000126c]        bytesRead = read(STDIN_FILENO, bufferIn, 3);
(./v4.0/dbx) 
n
  [main:13 ,0x12000128c]        sprintf(bufferOut, "child received `%s' from parent, exitting\n",
(./v4.0/dbx) c
(./v4.0/dbx) child received `go' from parent, exitting

Program terminated normally


warning: cannot get register (number = 64)

can't attach to loader: No such process

Program terminated normally

(./v4.0/dbx) q

The warning is that dbx has tried to get info from the process that has
already exited.  It's either a timing thing or something that was
fixed in later versions.  If you can't find a copy of v4.0 to play with,
you can try grabbing it off my web page, at 
www.zk3.dec.com/~petert


PeterT