Notices
Computer & Technology Related Post here for help and discussion of computing and related technology. Internet, TVs, phones, consoles, computers, tablets and any other gadgets.

Techie Q - dbx.

Thread Tools
 
Search this Thread
 
Old 08 July 2003, 03:48 PM
  #1  
sempers
Scooby Regular
Thread Starter
 
sempers's Avatar
 
Join Date: Nov 2001
Posts: 367
Likes: 0
Received 0 Likes on 0 Posts
Post

Anyone experience of using dbx (sun debugger) with multiple processes?

I'm using follow_fork_mode child, following into child proc after attaching to the parent. I'm actually tracing a server that takes multiple requests from a client, serving each sequentially in a child process.

Has anyone found a way of persuading dbx to re-attach to the parent process when the child quits?

Ta.
Mark.
Old 08 July 2003, 03:56 PM
  #2  
stevencotton
Scooby Regular
 
stevencotton's Avatar
 
Join Date: Jan 2001
Location: behind twin turbos
Posts: 2,710
Likes: 0
Received 1 Like on 1 Post
Post

Try with 'truss -f -p <pid>' if you just need to see the calls it's making - I haven't used the Solaris debugger, but truss is usually as far as I need to go.

Steve.
Old 08 July 2003, 04:15 PM
  #3  
sempers
Scooby Regular
Thread Starter
 
sempers's Avatar
 
Join Date: Nov 2001
Posts: 367
Likes: 0
Received 0 Likes on 0 Posts
Post

Ought to have mentioned I'm using RTC (runtime checking) to sort out memory leaks/rui/bad frees etc in several thousand lines

I've even tried a handler for exit:
where exit { attach pid; } (parent pid consistent..)

Tells me to stuff off, can't use attach in handler.

Or:

stop sig sigchld

in parent proc. doesn't work either. Starting to really irritate me; surely it's not that bizarre a thing to need to do?

- M.

P.S. Don't tell me to use purify, can't
Old 08 July 2003, 04:25 PM
  #4  
stevencotton
Scooby Regular
 
stevencotton's Avatar
 
Join Date: Jan 2001
Location: behind twin turbos
Posts: 2,710
Likes: 0
Received 1 Like on 1 Post
Post

Hmm .. ok, how about this:

Good luck
Old 08 July 2003, 04:37 PM
  #5  
sempers
Scooby Regular
Thread Starter
 
sempers's Avatar
 
Join Date: Nov 2001
Posts: 367
Likes: 0
Received 0 Likes on 0 Posts
Post

erm, thanks

Can't even find a decent forum to ask the question on sun's site.
Old 08 July 2003, 04:48 PM
  #6  
stevencotton
Scooby Regular
 
stevencotton's Avatar
 
Join Date: Jan 2001
Location: behind twin turbos
Posts: 2,710
Likes: 0
Received 1 Like on 1 Post
Post

How about here, http://docs.sun.com/db/doc/805-4948/6j4m9icbi?a=view ?
Old 08 July 2003, 04:50 PM
  #7  
sempers
Scooby Regular
Thread Starter
 
sempers's Avatar
 
Join Date: Nov 2001
Posts: 367
Likes: 0
Received 0 Likes on 0 Posts
Post

That was how I found out how to follow the fork down.. now to come back up
Old 08 July 2003, 04:53 PM
  #8  
stevencotton
Scooby Regular
 
stevencotton's Avatar
 
Join Date: Jan 2001
Location: behind twin turbos
Posts: 2,710
Likes: 0
Received 1 Like on 1 Post
Post

I haven't used it (can you tell? ), but what if you set dbxenv to Both or Ask?
Old 08 July 2003, 05:12 PM
  #9  
sempers
Scooby Regular
Thread Starter
 
sempers's Avatar
 
Join Date: Nov 2001
Posts: 367
Likes: 0
Received 0 Likes on 0 Posts
Post

Both might be the answer - but only works if you're using a gui workshop tool from sun, ask just asks you what you want to do.

If you can visualise what's going on: follow fork allows you to either stay with the original process when a fork happens, or to follow the split to the new process. There appears to be no way of 'automagically' getting back to the parent process having followed into the child; I can manually issue an attach at the prompt to get the parent again, but by this time the second child has already spawned, and gone on it's merry way.. so I get 1, 3, 5 etc.. not much help when the mem leaks could be in 2, 4, 6 etc...

Ah well....

Thanks for the ideas anyhow.

- Mark.
Old 08 July 2003, 05:34 PM
  #10  
stevencotton
Scooby Regular
 
stevencotton's Avatar
 
Join Date: Jan 2001
Location: behind twin turbos
Posts: 2,710
Likes: 0
Received 1 Like on 1 Post
Post

Yeah I understood the problem, I'm surprised that wasn't the default behaviour. If you find out how, mail me and let me know because it may well come in handy
Old 08 July 2003, 11:27 PM
  #11  
sempers
Scooby Regular
Thread Starter
 
sempers's Avatar
 
Join Date: Nov 2001
Posts: 367
Likes: 0
Received 0 Likes on 0 Posts
Post

Hokay, suspect it may involve an'orrible hack

dbx is a really useful tool honest No, really. Just sometimes a little obtuse. Big fan of printf() myself.
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
Da Booga
Computer & Technology Related
2
13 December 2002 01:18 PM
The TunnelMeister
General Technical
16
08 December 2002 01:33 PM
Scoobychick
Computer & Technology Related
12
12 January 2002 05:49 PM
barge
Member's Gallery
1
17 September 2001 06:43 PM
Denz
ScoobyNet General
4
22 August 2000 02:06 PM



Quick Reply: Techie Q - dbx.



All times are GMT +1. The time now is 07:03 PM.