1 Jul 2010 01:14
[commit] Fix build failure with Python installed in non-system location.
Joel Brobecker <brobecker <at> adacore.com>
2010-06-30 23:14:54 GMT
2010-06-30 23:14:54 GMT
Hello,
The debugger fails to build when configure with --python-python=<path>
where <path> is a non-system location. The reason is a warning made
fatal due to the definition of _XOPEN_SOURCE inside pyconfig.h. This
is exactly the same problem as with _POSIX_C_SOURCE, handled in
python-internal.h as follow:
| /* /usr/include/features.h on linux systems will define _POSIX_C_SOURCE
| if it sees _GNU_SOURCE (which config.h will define).
| pyconfig.h defines _POSIX_C_SOURCE to a different value than
| /usr/include/features.h does causing compilation to fail.
| To work around this, undef _POSIX_C_SOURCE before we include Python.h. */
| #undef _POSIX_C_SOURCE
This patch fixes this problem the same way. We discussed the problem on
IRC, and talked about using -isystem to provide the location of the Python
includes, and eventually just decided that it was better to just keep it
simple.
2010-06-30 Joel Brobecker <brobecker <at> adacore.com>
* python/python-internal.h (_XOPEN_SOURCE): Undefine before
including Python.h.
Tested on x86_64-linux (I removed -Werror, allowing me to build and run
the testsuite without this patch first). No regression.
Checked in.
(Continue reading)
See check_condition below:
> *data_value = value_as_long (val);
> *data_value_len = TYPE_LENGTH (value_type (val));
> *data_value = *data_value << (sizeof (CORE_ADDR) - *data_value_len) * 8;
That was true when using memcpy instead of value_as_long, and I thought
that keeping it that way made things simpler for calculate_dvc. It turns
out that I was wrong.
> > + if (data_value_len - len > align_offset)
> > + /* The user-provided value type is larger than the watched value type,
> > + and it is also to the right of the offset within the DVC register
> > + where it should be. */
> > + *condition_value = (uint64_t) data_value << (data_value_len - len
> > + - align_offset) * 8;
> > + else
> > + /* The user-provided value type is either smaller than the watched
> > + value type, or else it is equal or larger than the watched value
> > + type but to the left of the offset within the DVC register where
> > + it should be. */
> > + *condition_value = (uint64_t) data_value >> (align_offset
RSS Feed