Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!194.109.133.84.MISMATCH!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'subject:Python': 0.04; 'completeness': 0.05; 'think,': 0.05; 'python': 0.07; 'configure': 0.11; 'am,': 0.14; 'cc:': 0.14; 'described': 0.14; 'wrote:': 0.14; '$path': 0.16; 'calculation': 0.16; 'hardcoded': 0.16; 'iirc': 0.16; 'it).': 0.16; 'moderately': 0.16; 'posix': 0.16; 'received:172.25': 0.16; 'fine': 0.18; 'header:In-Reply-To:1': 0.22; 'cc:addr:python-list': 0.22; 'linux,': 0.22; 'platforms,': 0.23; 'set.': 0.23; '+0200': 0.25; 'installation': 0.25; 'windows': 0.26; 'pass': 0.27; 'van': 0.27; 'message- id:@mail.gmail.com': 0.28; 'date:': 0.28; 'sat,': 0.29; 'subject:Windows': 0.29; '(the': 0.30; 'cc:addr:python.org': 0.31; 'cc:addr:gmail.com': 0.31; 'enabled': 0.31; 'perhaps': 0.32; "isn't": 0.34; 'reference': 0.34; 'skip:" 10': 0.34; 'problem,': 0.35; 'suggestion': 0.35; 'difficult': 0.35; 'change,': 0.35; 'executable': 0.35; 'fails': 0.35; 'option.': 0.35; 'too': 0.36; 'think': 0.36; 'else': 0.37; 'should': 0.37; 'received:google.com': 0.38; 'but': 0.38; 'used': 0.38; 'cc:2**2': 0.39; 'where': 0.39; 'from:': 0.39; 'works': 0.40; 'would': 0.40; "it's": 0.40; '2011': 0.62; 'lives': 0.64; 'special': 0.66; 'from:addr:google.com': 0.68; 'you).': 0.91; 'cc:no real name:2**2': 0.95 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1305398299; bh=ibY/YYEdh1Wk1TS4SzxpDJCk0io=; h=MIME-Version:In-Reply-To:References:Date:Message-ID:Subject:From: To:Cc:Content-Type:Content-Transfer-Encoding; b=KQZhG9XcMdiPsY491A/CLe1HCiiTWV06V+pX+GyPPpsuQxzqRvJS4nPCywF2Sxa3B NGa/Xd+D5AjmeW8ahUHKQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=beta; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=sDPKckqwBEBJau5H3W5e/m8hdHP3SCg6UvLxYJb8MyU=; b=If7rd5E3f5zcIeeXchZ39byNUb3XtNSJ2y9j+vKGWbAJMAr/2rxJ/kSZvJIhXsjnuq bcKRKd3wlfn+NgQaNr3A== DomainKey-Signature: a=rsa-sha1; c=nofws; d=google.com; s=beta; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=UjKOrFKVMKDqw5zIfsV3JC4zhnxRXtG1fipoOLhXoBpVi31J4nRQCxfpuoTld9FniP UkipmxCgKAz8/ukAijcw== MIME-Version: 1.0 In-Reply-To: <83ei41fx4a.fsf@gnu.org> References: <83ei41fx4a.fsf@gnu.org> Date: Sat, 14 May 2011 11:38:16 -0700 Subject: Re: Python enabled gdb on Windows and relocation From: Doug Evans To: Eli Zaretskii Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true Cc: python-list@python.org, gdb@sourceware.org, vanboxem.ruben@gmail.com X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 34 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1305398301 news.xs4all.nl 41113 [::ffff:82.94.164.166]:48306 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:5378 On Sat, May 14, 2011 at 2:29 AM, Eli Zaretskii wrote: >> Date: Sat, 14 May 2011 11:09:13 +0200 >> From: Ruben Van Boxem >> Cc: gdb@sourceware.org, python-list@python.org >> >> 1. Check hardcoded path; my suggestion would be "/../lib= /python27" >> 2. If this fails to find the necessary files/scripts, find it like you >> described above in Linux, without PYTHONPATH set. >> 3. Check PYTHONPATH. >> >> I would think only number one would change, and perhaps be only >> enabled with a special configure option. Nothing else would have to >> change, and Windows users would rejoice :) > > The problem, I think, is that it's not so easy on Unix to get the > place where the GDB executable leaves. =A0There isn't a system call to > do that (similar to what Windows gives you). > > So I think on Posix platforms, number 2 would be used most of the > time. For reference sake, gdb is "relocatable". [meaning, if you take a gdb installation and move it, it should continue to work fine] And if gdb's python lives inside the gdb tree, that too should continue to work fine if moved with gdb (the value to pass to Py_SetProgramName is appropriately (re-)computed when gdb is run). [For completeness sake, IIRC the calculation of a path being "relocatable" isn't bulletproof, but it works in practice.] It's not impossible for gdb to find where it lives, but you're right it can be moderately difficult (basically, if argv[0] isn't an absolute path then scan $PATH for it).