public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Problem writing python tests without installing
@ 2011-11-10 13:15 Robert Lupton the Good
  2011-11-10 15:55 ` Phil Muldoon
  0 siblings, 1 reply; 3+ messages in thread
From: Robert Lupton the Good @ 2011-11-10 13:15 UTC (permalink / raw)
  To: gdb

When running the testsuite, the python files that are sourced are apparently e.g.
	gdb/testsuite/../data-directory/python/gdb/printing.py
rather than
	gdb/python/lib/gdb/printing.py
although the binary is as expected gdb/gdb

The files appear to be installed by "make install".  This is another manifestation of the problem that you cannot apparently work on the gdb python code without first installing it (away from it's cvs home -- but that can be faked with a link...)

Is there a proper way to work around this?

				R

P.S. I wasted a lot of time on this... the final trick was 
	runtest -v -v -v
and
	gdb_test_no_output "python import gdb.printing" 
	gdb_test_no_output "python raise RuntimeError(gdb.printing.__file__)" 
to get the path.  Sigh.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Problem writing python tests without installing
  2011-11-10 13:15 Problem writing python tests without installing Robert Lupton the Good
@ 2011-11-10 15:55 ` Phil Muldoon
  2011-11-20  9:20   ` Doug Evans
  0 siblings, 1 reply; 3+ messages in thread
From: Phil Muldoon @ 2011-11-10 15:55 UTC (permalink / raw)
  To: Robert Lupton the Good; +Cc: gdb

Robert Lupton the Good <rhl@astro.princeton.edu> writes:

> When running the testsuite, the python files that are sourced are apparently e.g.
> 	gdb/testsuite/../data-directory/python/gdb/printing.py
> rather than
> 	gdb/python/lib/gdb/printing.py
> although the binary is as expected gdb/gdb

Right, but you don't have to do 'make install' to get data-directory.

>
> The files appear to be installed by "make install".  This is another
> manifestation of the problem that you cannot apparently work on the
> gdb python code without first installing it (away from it's cvs home
> -- but that can be faked with a link...)

I work with Python every day and I don't have this issue.  The files are
correctly sourced from ../data-dictionary.

I could not find the gdb.printing test in my output, but this works fine:

python
>Sending "import gdb.command.prompt" to gdb
Looking to match ""[\r\n]*()[\r\n]+(\(gdb\) | *>)$""
Message is "prompt substitution readline - import gdb.command.prompt"
board_info host exists name

FWIW GDB is spawned in the test as:

Spawning /home/pmuldoon/bugs/setex/obj/gdb/testsuite/../../gdb/gdb -nw -nx -data-directory /home/pmuldoon/bugs/setex/obj/gdb/testsuite/../data-directory 

> Is there a proper way to work around this?

There's not enough information on your install/setup to diagnose the
issue. How did you configure the build?

Cheers

Phil

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Problem writing python tests without installing
  2011-11-10 15:55 ` Phil Muldoon
@ 2011-11-20  9:20   ` Doug Evans
  0 siblings, 0 replies; 3+ messages in thread
From: Doug Evans @ 2011-11-20  9:20 UTC (permalink / raw)
  To: pmuldoon; +Cc: Robert Lupton the Good, gdb

On Thu, Nov 10, 2011 at 7:54 AM, Phil Muldoon <pmuldoon@redhat.com> wrote:
> Robert Lupton the Good <rhl@astro.princeton.edu> writes:
>
>> When running the testsuite, the python files that are sourced are apparently e.g.
>>       gdb/testsuite/../data-directory/python/gdb/printing.py
>> rather than
>>       gdb/python/lib/gdb/printing.py
>> although the binary is as expected gdb/gdb
>
> Right, but you don't have to do 'make install' to get data-directory.
>
>>
>> The files appear to be installed by "make install".  This is another
>> manifestation of the problem that you cannot apparently work on the
>> gdb python code without first installing it (away from it's cvs home
>> -- but that can be faked with a link...)
>
> I work with Python every day and I don't have this issue.  The files are
> correctly sourced from ../data-dictionary.
>
> I could not find the gdb.printing test in my output, but this works fine:
>
> python
>>Sending "import gdb.command.prompt" to gdb
> Looking to match ""[\r\n]*()[\r\n]+(\(gdb\) | *>)$""
> Message is "prompt substitution readline - import gdb.command.prompt"
> board_info host exists name
>
> FWIW GDB is spawned in the test as:
>
> Spawning /home/pmuldoon/bugs/setex/obj/gdb/testsuite/../../gdb/gdb -nw -nx -data-directory /home/pmuldoon/bugs/setex/obj/gdb/testsuite/../data-directory
>
>> Is there a proper way to work around this?
>
> There's not enough information on your install/setup to diagnose the
> issue. How did you configure the build?

Yeah, I suspect the problem is either an absence of "-data-directory
..." when starting gdb, or not doing a "make" after editing a .py file
(*1).
[And if you add new .py files, remember to mention them in
data-directory/Makefile.in]

---
(*1) Since .py files aren't "compiled" having to do a "make" may be
unexpected, but it's ultimately easier to stage them in
$build/data-directory rather than trying to fetch them from the the
source tree.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-11-20  9:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-10 13:15 Problem writing python tests without installing Robert Lupton the Good
2011-11-10 15:55 ` Phil Muldoon
2011-11-20  9:20   ` Doug Evans

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).