From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24421 invoked by alias); 29 Nov 2003 06:56:01 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 24409 invoked from network); 29 Nov 2003 06:56:00 -0000 Received: from unknown (HELO marvin.codito.net) (203.197.88.2) by sources.redhat.com with SMTP; 29 Nov 2003 06:56:00 -0000 Received: from webmail.codito.com (localhost [127.0.0.1]) by marvin.codito.net (8.12.10/8.12.10/Debian-4) with SMTP id hAT767Yb000560; Sat, 29 Nov 2003 12:36:08 +0530 Received: from 61.95.193.95 (SquirrelMail authenticated user ramana.radhakrishnan) by webmail.codito.com with HTTP; Sat, 29 Nov 2003 12:36:09 +0530 (IST) Message-ID: <29298.61.95.193.95.1070089569.squirrel@webmail.codito.com> Date: Sat, 29 Nov 2003 06:56:00 -0000 Subject: RE: regarding transparent data ranges (in tracepoint support) From: "Ramana Radhakrishnan" To: "Newman, Mark (N-Superior Technical Resource Inc)" Cc: "Daniel Jacobowitz" , "ankit thukral" , "Jim Blandy" , gdb@sources.redhat.com Reply-To: ramana.radhakrishnan@codito.com User-Agent: SquirrelMail/1.4.2 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 Importance: Normal X-SW-Source: 2003-11/txt/msg00294.txt.bz2 Hi Mark, We had a similar problem and we added a hack to put in an internal breakpoint at _fini and not at exit so that the program halts there. The problem however is that if the debuggee exits on a SEGV for eg. the transparent data regions cannot be queried anyways. So the cleanest option would be to add support for PTRACE_EVENT_EXIT but thats not available in the 2.4 series of kernels which are the ones on which we are also working. I am travelling for the next week and hence can't make a release without the copyright assignment on which our firm's lawyers are working on. So will try and make a release sometime next week after the copyright assignment is done. cheers Ramana > Could you be specific as to what kernel/file this is in? > > I am using 2.4.18 and can't find it in kernel/ptrace.c . > > Mark Newman > >> -----Original Message----- >> From: Daniel Jacobowitz [mailto:drow@mvista.com] >> Sent: Wednesday, November 19, 2003 3:22 PM >> To: Newman, Mark (N-Superior Technical Resource Inc) >> Cc: ankit thukral; Jim Blandy; gdb@sources.redhat.com >> Subject: Re: regarding transparent data ranges (in tracepoint support) >> >> >> On Wed, Nov 19, 2003 at 02:50:29PM -0500, Newman, Mark >> (N-Superior Technical Resource Inc) wrote: >> > Sorry about the tunnel vision. When the SUT exits we loose >> all of the >> > tracepoint data in target memory. Stopping that from >> happening is the >> > next thing on my list after I finish making interrupt work. >> After the >> > program finishes it should not exit without an ok from the engineer. >> > >> > So Ankit if that is what you are looking to do I agree completely. >> > However can't gdbserver do something more like the restart >> that occurs >> > with a "w" or "x" status after the putpkt in the case statement in >> > server.c >> >> For recent Linux kernels see PTRACE_EVENT_EXIT. >> >> In general, however, there's no easy way to prevent it from exiting >> without that. >> >> > >> > Mark >> > >> > > -----Original Message----- >> > > From: Daniel Jacobowitz [mailto:drow@mvista.com] >> > > Sent: Wednesday, November 19, 2003 2:39 PM >> > > To: Newman, Mark (N-Superior Technical Resource Inc) >> > > Cc: ankit thukral; Jim Blandy; gdb@sources.redhat.com >> > > Subject: Re: regarding transparent data ranges (in >> tracepoint support) >> > > >> > > >> > > On Wed, Nov 19, 2003 at 02:34:49PM -0500, Newman, Mark >> > > (N-Superior Technical Resource Inc) wrote: >> > > > Guys - again please excuse my ignorance but >> > > > >> > > > I was assuming that transparent memory would either be >> > > > >> > > > In ROM >> > > > In a write protected page >> > > > In an unprotected page (for those systems without >> memory protection) >> > > > Possibly swapped out to the disk (for those system with a disk) >> > > > >> > > > However definitely readable by "read_inferior_memory". >> > > > >> > > > Why would the data not be loaded into some form of memory? >> > > > What kind of data are we talking about? >> > > >> > > Ankit is talking about reading the transparant tracepoint >> data after >> > > the program has exited - when its memory isn't there any more. >> > > >> > > > >> > > > Mark Newman >> > > > >> > > > > -----Original Message----- >> > > > > From: gdb-owner@sources.redhat.com >> > > > > [mailto:gdb-owner@sources.redhat.com]On Behalf Of Daniel >> > > Jacobowitz >> > > > > Sent: Wednesday, November 19, 2003 1:56 PM >> > > > > To: ankit thukral >> > > > > Cc: Jim Blandy; gdb@sources.redhat.com >> > > > > Subject: Re: regarding transparent data ranges (in >> > > tracepoint support) >> > > > > >> > > > > >> > > > > On Wed, Nov 19, 2003 at 08:25:37AM -0800, ankit thukral wrote: >> > > > > > >> > > > > > --- Jim Blandy wrote: >> > > > > > > >> > > > > > > ankit thukral writes: >> > > > > > > >> > > > > > > > hi all, >> > > > > > > > i read about the transparent data ranges and >> > > > > > > > learned that data in these ranges are not supposed >> > > > > > > to >> > > > > > > > be collected by the remote stub since they belong >> > > > > > > to >> > > > > > > > read-only segment of the debuggee.my problem is : >> > > > > > > a >> > > > > > > > TSTART would start the debuggee and it may so >> > > > > > > happen >> > > > > > > > that the debuggee finishes executing.at this >> > > > > > > point,if >> > > > > > > > the GDB requests for some data in the transparent >> > > > > > > data >> > > > > > > > range,then how can the remote stub provide it with >> > > > > > > one >> > > > > > > > since the debuggee has exited ? >> > > > > > > >> > > > > > > If the target is a gdbserver, then it would need to >> > > > > > > read the bytes >> > > > > > > from the executable file. This is easy to do with >> > > > > > > BFD, but if I >> > > > > > > remember right, gdbserver doesn't use BFD at the >> > > > > > > moment; not sure how >> > > > > > > to get around that. >> > > > > > > >> > > > > > > If the target is an embedded system, then presumably >> > > > > > > the transparent >> > > > > > > data ranges correspond to ROM regions, so the data >> > > > > > > is still there. >> > > > > > >> > > > > > >> > > > > > >> > > > > > how about setting a (internal) breakpoint in the >> > > > > > debuggee which would prevent it from exiting even >> > > > > > though it has finished executing main(),and then >> > > > > > entertain GDB requests for the transparent (or >> > > > > > read-only) memory regions by reading from the memory >> > > > > > of the debuggee??? >> > > > > >> > > > > That would work (but be wasteful). At least on Linux, >> > > you could read >> > > > > /proc/pid/maps to find what ranges correspond to where in >> > > what file, >> > > > > and save that information. >> > > > > >> > > > > -- >> > > > > Daniel Jacobowitz >> > > > > MontaVista Software Debian >> > > GNU/Linux Developer >> > > > > >> > > > >> > > >> > > -- >> > > Daniel Jacobowitz >> > > MontaVista Software Debian >> GNU/Linux Developer >> > > >> > >> >> -- >> Daniel Jacobowitz >> MontaVista Software Debian GNU/Linux Developer >> > ---- Ramana Radhakrishnan Codito Technologies