From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 640 invoked by alias); 5 Jul 2007 04:45:28 -0000 Received: (qmail 632 invoked by uid 22791); 5 Jul 2007 04:45:27 -0000 X-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,DK_POLICY_SIGNSOME,FORGED_RCVD_HELO,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 05 Jul 2007 04:45:21 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l654jGXF013929; Thu, 5 Jul 2007 00:45:17 -0400 Received: from pobox.hsv.redhat.com (pobox.hsv.redhat.com [172.16.16.12]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l654jFLn023120; Thu, 5 Jul 2007 00:45:16 -0400 Received: from localhost.localdomain (vpn-14-164.rdu.redhat.com [10.11.14.164]) by pobox.hsv.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id l654jCVM017213; Thu, 5 Jul 2007 00:45:13 -0400 Message-ID: <468C7757.3050105@redhat.com> Date: Thu, 05 Jul 2007 04:45:00 -0000 From: Phil Muldoon User-Agent: Thunderbird 2.0.0.4 (X11/20070615) MIME-Version: 1.0 To: Mark Wielaard CC: frysk@sourceware.org Subject: Re: Breakpoint stepping References: <1183573205.3598.157.camel@dijkstra.wildebeest.org> In-Reply-To: <1183573205.3598.157.camel@dijkstra.wildebeest.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact frysk-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: frysk-owner@sourceware.org X-SW-Source: 2007-q3/txt/msg00022.txt.bz2 Mark Wielaard wrote: > > - Single Step Out Of Line Address Area. Currently the Isa (for x86 and > x86_64 at least) just provide one address. The address of the main() > function entry point taken by just doing: > > Elf elf = new Elf(proc.getExe(), ElfCommand.ELF_C_READ); > Dwarf dwarf = new Dwarf(elf, DwarfCommand.READ, null); > DwarfDie die = DwarfDie.getDecl(dwarf, "main"); > return die.getEntryBreakpoints(); > > This works surprisingly well for a simple first approach, and programs > generally don't reenter their own main() function. But it would be nice > to either find an area that is guaranteed to never be used (again) by > the process, or to map in an executable area in the inferior that is > just used by us (maybe just making the inferior load a dummy shared > library). Again any suggestions welcome. > Mark, I'm still reading the rest of your email (the state machine changes I'm still trying to understand). Is the above entry point code similar too getting the Entry Point from the process auxiliary? Something like: Auxv[] auxv = proc.getAuxv (); long entryPoint = 0; if (auxv == null) return 0; // Find the Auxv ENTRY data for (int i = 0; i < auxv.length; i++) if (auxv[i].type == inua.elf.AT.ENTRY) { entryPoint = auxv[i].val; break; } Not sure if one is more expensive than the other, just trivia really. As a side point, be sure to close to call elf.close() which immediately dispenses of the fd associated with the Elf object. It will eventually be cleaned up "anyway" on the finalize() call but that can happen quite a long time away. I agree on the main() entry-point being a good first step to as a usable space, though I wonder how that would look in a corefile. Though I suspect if you are dumping core while stepping a process one is in deeper trouble than one suspects ;) One of the other ideas was creating a custom solib and using it's address space to store the stuff needed. All this sounds hacky though. I vaguely recall a discussion to how uprobes does something similar by mapping in a page from somewhere? Do you remember any of that stuff? Regards Phil