Gregory Hainaut [Sun, 9 Jun 2013 08:06:28 +0000 (09:06 +0100)]
gltrace: Prevent crash in _glGetDebugMessageLog_length (issue #140).
The function was not being called correctly from glGetDebugMessageLog
(and others).
From the spec the GL function:
lengths is an array provided by the application and count is the
maximum number of message that the driver will report into attribute
array (ie lengths). That mean if the driver report 3 messages only
lengths[0 to 2] are valid, others part are not valid and could have
random data.
José Fonseca [Tue, 4 Jun 2013 15:59:21 +0000 (16:59 +0100)]
retrace: Remove the -c/--compare=PREFIX .
That is, remove the ability to compare images while replaying.
For several reasons:
- This duplicates diff-images command.
- It is less versatile -- it is unable to output diff images.
- It will be necessary to change how snapshots are done to properly
accommodate APIs that have no concept of current context, like
Direct3D APIs, so the less fat on this code the better.
It seems that elf.c for some reason includes snappy/config.h instead of
its own generated config.h, possbily due to wrong order of include
directories. Solved it by explicitly including
${CMAKE_CURRENT_BINARY_DIR} before all other paths.
José Fonseca [Thu, 30 May 2013 13:00:44 +0000 (14:00 +0100)]
dxgitrace: Handle simultanous D3D11 maps.
On D3D11 Map/Unmap are context methods, not resource methods, but in order
to handle simultanous maps we need to put the book-keeping in the
resource objects.
Vasil Dimov [Fri, 24 May 2013 11:50:51 +0000 (14:50 +0300)]
In Android.mk: explicitly specify the toolchain
If NDK is cloned from git://codeaurora.org/platform/prebuilt instead of
from git://android.git.linaro.org/platform/prebuilt then
prebuilt/linux-x86/toolchain/ contains some extra entries that confuse
the toolchain pickup logic in cmake/toolchain/android.toolchain.cmake,
thus we explicitly specify the toolchain via ANDROID_TOOLCHAIN_NAME.
libbacktrace #include's two header files from GCC. Provide minimal
replacements for those files. For filenames.h, declare missing macros
assuming POSIX-style paths. For dwarf2.h, #include system dwarf.h and
declare missing enum tags and define missing enum values as macros.
There was a bool field that was caching results of 'is_backtrace_needed'
lookups. Now that field is gone, and 'is_backtrace_needed' is called
repeatedly. I guess it's not that bad (it boils down to a lookup in an
std::set), but that function was also printing notices for functions
with enabled stack trace recording, and now those messages are printed
repeatedly as well. The following patch removes the notices completely
and slightly cleans up the surrounding code.
Ben Kelly [Mon, 6 May 2013 17:25:15 +0000 (13:25 -0400)]
Use ndk-android-r7 for FirefoxOS builds.
Commit 7445733 added support for FirefoxOS, but appears to have been using
a newer version of the NDK than we typically build with. The codeaurora.org
prebuilts repo we are tracking has not pulled in r8 yet and only provides r7.
For the time being it would be helpful to drop back to r7. Admittedly, we
should probably have a better mechanism for selecting the latest version
available.
Changes from v3: Instead of writing the backtrace as Array, the backtrace is
now recorded as a list of stack frame nodes with optional stack frame details
(the scheme is below).
This patch implements backtrace recording during tracing, and adds support in
'apitrace dump' and QApitrace. Backtrace is obtained via platform-specific
functions (and, internally, in platform-specific format). Then it is parsed to
produce an std::vector of stack frame structs: { char *module, *function,
*filename, *linenumber, *offset } (some fields may be NULL) and is written
into the trace file in the Enter call section as a call detail:
BACKTRACE
FRAME
MODULE "module"
FUNCTION "Foo"
FILENAME "foo.cpp"
LINENUMBER "1234"
OFFSET "0xSDF"
FRAME
FUNCTION "Boo"
// no filename line info available for this frame
END_BACKTRACE
A platform-dependent mechanism is provided to specify a set of traced
calls for which backtraces will be recorded. It is possible to specify
either function names, or prefixes of names by appending a '*' (e.g.
"glUniform*").
On Android the backtrace is retrieved from Dalvik via libdvm functions
imported at runtime.
Function set is specified in /data/apitrace.fnames, one per line.
On Linux the backtrace is retrieved via glibc backtrace(), and will not always
yield filename:linenumber information.
Function set is specified via APITRACE_BT_FUNCTIONS environment variable.
On other platforms, obtaining a backtrace is not implemented by this patch.