After hitting the malloc() breakpoint on FreeBSD our top frame is actually
an inlined function malloc_init.
* frame #0: 0x0000000800dcba19 libc.so.7`malloc [inlined] malloc_init at malloc.c:5397
frame #1: 0x0000000800dcba19 libc.so.7`malloc(size=1024) + 9 at malloc.c:5949
frame #2: 0x00000000004006e5 test_step_out_of_malloc_into_function_b_with_dwarf`b(val=1) + 37 at main2.cpp:29
Add a heuristic to keep stepping out until we come to a non-malloc caller,
before checking if it is our desired caller from the test code.
llvm.org/pr17944
llvm-svn: 203268
A freebsd issue with rm prevents '[g]make clean' from working if $(DSYM)
is empty (fts_open(3) fails if passed an empty argument).
To work around this, simplify the clean target by using three separate
rm invocations: one for the common files, one for the case of non-empty
$(DYLIB_NAME), and one for non-empty $(DSYM).
Issue diagnosed (and reported to FreeBSD) by John Wolfe.
llvm.org/pr17933
llvm-svn: 203253
not going to key off of the ELF object file like I'd intended.
Revert my change in r203205; also revert Greg's change in
r203107 which builds ProcessElfCore on non-Linux/FreeBSD systems
for the moment until we can straighten this out.
llvm-svn: 203207
ProcessMachCore because it doesn't check the format of the file up front. (this is only now
happening because of Greg's change in r203178 to build ProcessElfCore for non-Linux/FreeBSD
hosts).
<rdar://problem/16257533>
llvm-svn: 203205
It speeds up running the full test suite on my HP z620 Ubuntu machine with 32 hyperthreaded CPUs from 11 minutes to about 1m13s (about 9x).
The default behavior is to run single-threaded as before. If the environment variable LLDB_TEST_THREADS is set, a Python work queue is set up with that many worker threads.
To avoid collisions within a test directory where multiple tests make use of the same prebuilt executable, the unit of work for the worker threads is a single directory (that is, all tests within a directory are processed in the normal serial way by a single thread).
tfiala & I have run this way a number of times; the only issue I found was that the TestProcessAttach.py test failed once, when attempting to attach to the process "a.out" by name. I assume this is because some other thread was running an executable of that name at the same time, and we were attempting to attach to the wrong one, so I changed that test to use a different executable name (that change is also included in this commit).
llvm-svn: 203180
Author: ace2001ac
Date: Thu Mar 6 05:30:34 2014
New Revision: 203107
URL: http://llvm.org/viewvc/llvm-project?rev=203107&view=rev
Log:
Fix Windows build break introduced in r203035.
Add '#if defined(__linux__) || defined(__FreeBSD__)' around JITLoaderGDB
and ProcessElfCore, which are only built on Linux and FreeBSD.
Modified:
lldb/trunk/source/lldb.cpp
Windows will need to start building all files necessary so that JITLoaderGDB and ProcessElfCore can build since they should work on all platforms.
llvm-svn: 203178
Please do not add header files that are required in public APIs without first checking with us. This broke the LLDB builds at Apple because the lldb-dll-export.h wasn't included in the LLDB.framework and it was being included by public API header files.
llvm-svn: 203177
Add '#if defined(__linux__) || defined(__FreeBSD__)' around JITLoaderGDB
and ProcessElfCore, which are only built on Linux and FreeBSD.
llvm-svn: 203107
hold a strong pointer to that extended backtrace thread in the Process
just like we do for asking a thread's extended backtrace.
Also, give extended backtrace threads an invalid ThreadIndexID number.
We'll still give them valid thread_id's. Clients who want to know the
original thread's IndexID can call GetExtendedBacktraceOriginatingIndexID().
<rdar://problem/16126034>
llvm-svn: 203088
ProcessGDBRemote::GetAuxvData obtains the auxv from a remote gdbserver (via a binary-data packet), and returns the data as a DataBufferSP.
The patch includes a small fix to GDBRemoteCommunicationClient::SendPacketsAndConcatenateResponses() to support binary file format packet returns (by not assuming each binary packet is a null-terminated string when concatenating them).
llvm-svn: 202907
This change uses a fixed known offset for the Linux i386 DR0 register.
This change also undoes the 32-bit wordsize change from r169645 that
revolved around being 32-bit/64-bit friendly in
WriteRegOperation::Execute within the Linux ProcessMonitor.cpp. I ran
all the tests on x86_64 Linux with no failures. I also ran some simple
tests with 32-bit Linux exe on x86_64 host and 32-bit linux exe on
i686 32-bit host and these worked fine.
Note (from Todd): the UserData struct in the Linux i386 register
context (only used by Linux i386 host running Linux 32-bit inferior)
is out of sync with what shows up in the sys/user.h for an 32-bit
Linux build (per an earlier change of mine to make it look more like
x86_64 host running x86 exe). I think we should (1) make i386 Linux
targets run using the same register context (and correct ones) on i386
and x86_64 linux hosts if that is possible, and (2) we could use some
tests around the register handling, particularly to verify things like
DR0 registers are in the right spots on host/target combos that we can
verify vs. known correct values.
Change by Matthew Gardiner.
llvm-svn: 202887
The following two tests showed up as XFAIL even though they should
always be skipped on Linux, due to the @unittest2.expectedFailure
annotation appearing above the @dsym_test annotation:
TestObjCNewSyntax.ObjCNewSyntaxTestCase.test_expr_with_dsym
TestBlocks.BlocksTestCase.test_expr_with_dsym.
For those two, I simply moved the @dsym_test annotation to the top so
that it would be marked for skip ahead of being marked for XFAIL.
TestObjCNewSyntax.ObjCNewSyntaxTestCase.test_expr_with_dwarf I marked
as @skipIfLinux since my understanding is that isn't a valid test to
run on Linux. So rather than categorize as a fail (i.e. something
wrong to be fixed), just skip it. (My recent changes to Linux tests
have been following that model: if it could never work, skip; if it's
broken, mark XFAIL so we can easily track, fix, notice the fix and
adjust accordingly).
TestDeadStrip.DeadStripTestCase.test_with_dwarf I had previously
marked as XFAIL but this would never work on Linux with the current
linker AFAICT. Marked it as skip.
llvm-svn: 202788
read during materialization. First of all, report
if we can't read the data for some reason. Second,
consult the ValueObject's error and report that if
there's some problem.
<rdar://problem/16074201>
llvm-svn: 202552
This seems a little more straightforward and is equivalent to r201457
for ELF core files. A case for FreeBSD i386 is also added (it was
incorrectly using the 64-bit register context and corrupting mememory).
Better (user-facing) error handling is still needed.
Review: http://llvm-reviews.chandlerc.com/D2765
llvm-svn: 202549
This change adds a missing include path to the
ObjC LanguageRuntime path to the MacOSX SystemRuntime
plugin's Makefile.
It also adds the panel and curses library to the liblldb
shared library linkage step.
Changes by Jevin Sweval with a minor tweak.
llvm-svn: 202547
I carefully reviewed exactly how the IOHandlers interact and found places where we weren't properly controlling things. There should be no overlapping prompts and all output should now come out in a controlled fashion.
<rdar://problem/16111293>
llvm-svn: 202525
I suspect I may have misrun the test previously for check-in
r202456 re: pr15258. This test fails consistently on my end.
I changed the test to expected failure on Linux.
llvm-svn: 202517
TestRegisterVariables.test_with_dwarf_and_run_command was being
skipped on Linux due to issues with clang. I converted it to a
@expectedFailureClang and no longer skip on Linux.
llvm-svn: 202515
TestConstVariables.py was disabled on Linux and marked as
unconditional expected failure. This change removes the Linux disable
and makes the expected failure conditional on using clang. The test
runs fine on gcc-built lldb.
llvm-svn: 202514
This test passed 50 out of 50 times for me on Unbuntu 12.04 LTS x86_64
with lldb built using gcc 4.8.2 and July 2013 libedit.
This is related to:
http://llvm.org/bugs/show_bug.cgi?id=16170
llvm-svn: 202512
Related to this bug:
http://llvm.org/bugs/show_bug.cgi?id=16714
On TOT lldb svn r202507, I found several of the tests disabled within
TestConcurrentEvents.py to run fine, and several of them to fail 100%
of the time on my system (25 out of 25 times).
This changes the following tests for Linux:
Enables (these all work consistently):
* test_many_watchpoints_dwarf
* test_signal_watch_break_dwarf (line 250)
* test_signal_watch_break_dwarf (line 260 - same named test?)
* test_crash_with_watchpoint_dwarf
* test_crash_with_watchpoint_breakpoint_signal_dwarf
* test_delayed_crash_with_breakpoint_watchpoint_dwarf
Marks as expected failure (these all fail consistently):
* test_many_watchpoints_dwarf
* test_watch_break_dwarf
* test_delay_watch_break_dwarf
* test_watch_break_dwarf_delay
* test_signal_watch_dwarf
* test_delay_signal_watch_dwarf
* test_signal_delay_watch_dwarf
* test_two_breakpoints_one_watchpoint_dwarf
* test_breakpoints_delayed_breakpoint_one_watchpoint_dwarf
* test_two_watchpoint_threads_dwarf
* test_watchpoint_with_delay_watchpoint_threads_dwarf
* test_two_watchpoints_one_breakpoint_dwarf
* test_two_watchpoints_one_delay_breakpoint_dwarf
* test_watchpoint_delay_watchpoint_one_breakpoint_dwarf
* test_two_watchpoints_one_signal_dwarf
* test_signal_watch_break_dwarf
llvm-svn: 202511
Related to this bug:
http://llvm.org/bugs/show_bug.cgi?id=15037
Previously this was marked as skipped. I tried running it 10 times in
a row and it failed every time. Switched it to XFAIL.
llvm-svn: 202506
Also remove SetStopOthers from the ThreadPlanCallFunction, because if the value you have doesn't match what is
in the EvaluateExpressionOptions the plan was passed when created it won't work correctly.
llvm-svn: 202464
This is related to:
http://llvm.org/bugs/show_bug.cgi?id=15258
I ran this test 10 times successfully against Ubuntu 12.04 LTS x86_64
with lldb built with gcc 4.8.2 and July 2013 libedit.
llvm-svn: 202456
This is related to:
http://llvm.org/bugs/show_bug.cgi?id=15278
I ran this 20 times in a row without failure at svn r202440 on Ubuntu
12.04 LTS x86_64 using July 2013 libedit and gcc 4.8.2.
llvm-svn: 202448
1 - There were some outdated options being passed to clang
2 - There were some bad paths being passed as options
3 - The path to the main.cpp file ("/tmp/main.cpp") was wrong when the tests were being run, now we create a temp file
4 - Added a new ActionType::eNone to do nothing (no continue, step, or kill)
llvm-svn: 202431
This change fixes up issues with specifying the size of the i386
register infos for FPU registers. The bug was that for the i386
register context, the size of the FPU registers were still being
computed based on the x86_64 FXSAVE structure.
This change permits the FPR_SIZE macro to optionally be defined
outside of RegisterInfos_i386.h, which RegisterContextLinux_i386.cpp
does properly. It redefines the FPR_i386 structure with all the
accessible parts that RegisterInfos_i386.h wants to see, which we had
not done before when we made the overall size of the structure
properly sized a recently.
This change also modifies POSIXThread to create a
RegisterContextLinux_i386 only when the host is 32-bit; otherwise, it
uses the RegisterContextLinux_x86_64, which works properly for 32-bit
and 64-bit inferiors on a 64-bit host.
I tested this debugging a Linux x86 exe on an x86 host (Ubuntu 13.10
x86), and debugging a Linux x86 exe and a Linux x86-64 exe on an
x86-64 host (Ubuntu 12.04 LTS). Those cases all worked.
Thanks to Matthew Gardiner who discoverd may key insights into
tracking down the issue. The motivation for this change and some of
the code originates from him via this thread:
http://lists.cs.uiuc.edu/pipermail/lldb-commits/Week-of-Mon-20140224/010554.html
llvm-svn: 202428
We now write a 'q' to indicate to exit the IOHandlerProcessSTDIO::Run(), and a 'i' to interrupt the process. This should make this code safer to use in a signal handler function.
llvm-svn: 202311
4-byte reserved area when reading the libBacktraceRecording API results.
Also, add a little logging about queues being created.
<rdar://problem/16127752>
llvm-svn: 202306
This fix changes thee x86 32-bit floating point register area to be
the proper size independent of the host platform.
Note as of this change list, this register context is not yet used
since selecting it exposes issues with watchpoint assertions.
Change by Matthew Gardiner.
llvm-svn: 202285
These libraries became necessary recently to link properly.
I think they are needed everywhere non-Windows, but if they
end up breaking on a given platform, we can conditionalize this
further.
llvm-svn: 202282
in lldb.svn/Makefile
* Use CPP.Flags to export the declaration. The current solution broke all builds
on http://llvm-jenkins.debian.net/
llvm-svn: 202270
Bug fix for pr18841:
http://llvm.org/bugs/show_bug.cgi?id=18841
This change creates a stub Python readline.so module that does almost
nothing. Its whole purpose is to prevent Python from loading the real
module, something it does during the embedded Python interpreter's
initialization sequence (and way before lldb ever requests it within
embedded_interpreter.py).
On Ubuntu 12.04 and 13.10 x86_64, and in the Python 2.7.6 tree, the
stock Python readline module links against the GNU readline library.
This appears to be the case on all Pythons except where __APPLE__ is
defined. LLDB now requires linking against the libedit library.
Something about having both libedit.so and libreadline.so linked into
the same process space is causing the Python readline.so to trigger a
NULL memory access. I have put in a separate patch to python.org.
This suppression of embedded interpreter readline support can be
removed if at least any one of the following happens:
1. The stock python distribution accepts a patch similar to what I
submitted to Python 2.7.6's Modules/readline.c file.
2. The stock python distribution implements Modules/readline.c in
terms of libedit's readline compatibility mode (i.e. essentially
compiles it the way __APPLE__ compiles that module) under Linux.
3. a clean-room implementation of the python readline module is
implemented against libedit (either readline compatibility mode or
native libedit). This could be implemented within the readline.cpp
file that this change introduces. It cannot be a fork of python's
readline.c module due to llvm licensing.
The net effect of this change on Linux is that the embedded python's
readline support will not exist.
llvm-svn: 202243
Also fix the bug where lldb prints: "Got a connection and launched debugserver" rather
than the name of the process it actually launched.
llvm-svn: 202189
class. If we try to unwind a stack frame to find a caller stack
frame, and we fail to get a valid-looking frame, AND if the UnwindPlan
we used is an assembly-inspection based UnwindPlan, then we should
throw away the assembly-inspection UnwindPlan and try unwinding with
the architectural default UnwindPlan.
This code path won't be taken if eh_frame unwind instructions are available -
lldb will always prefer those once it's off the zeroth frame.
The problem I'm trying to fix here is the class of unwind failures that
happen when we have hand-written assembly on the stack, with no eh_frame,
and lldb's assembly parser fails to understand the assembly. People usually
write their hand-written assembly to follow the frame-pointer-preserving
conventions of the platform so the architectural default UnwindPlan will
often work. We won't have the spill location for most of the non-volatile
registers if we fall back to this, but it's better than stopping the unwind
prematurely.
This is a bit of a tricky change that I believe is correct, but if we get
unwinds that go of into the weeds / unwind bogus frames at the end of the
stack, I'll need to revisit it.
<rdar://problem/16099440>
llvm-svn: 201839
to a variable. This helps people figure out what
happened if they tried to do something to the variable
and it didn't work because we gave it the default type
of void*.
llvm-svn: 201737
Implement x86_64 debug register read/write in support of hardware
watchpoints. Hoist LinuxThread::TraceNotify code back into
POSIXThread::TraceNotify()
Patch by John Wolfe.
We still need to rework this later to avoid the #ifdef FreeBSD.
llvm-reviews.chandlerc.com/D2572
llvm.org/pr16706
llvm-svn: 201706
because there are too many trap handlers that will have an improperly aligned caller sp
and this will cause the unwinder to stop too early.
llvm-svn: 201637
The way in which we were determining whether a python module had already been imported in the current session stopped working due to the IOHandler changes
As a result, importing in a new debug session a module which had been imported in a previous session did not work
This commit restores that functionality by checking for the module's presence in the session dictionary (which should be more correct anyway)
llvm-svn: 201623
Fix a bug where calling SBFrame::FindValue() would cause a copy of all variables in the block to be inserted in the frame's variable list, regardless of whether those same variables were there or not - which means one could end up with a frame with lots of duplicate copies of the same variables
llvm-svn: 201614
pexpect had a hack to work around some old buggy platforms, and as a
result of the hack running the tests on FreeBSD produced a stream of
kernel warnings in the system log:
Feb 5 17:19:11 feynman kernel: WARNING pid 11323 (python2.7):
ioctl sign-extension ioctl ffffffff80087467
The hack has now been removed upstream, so remove it here too.
llvm.org/pr18749
llvm-svn: 201603
This way the same RegisterContext class can support i386 and
amd64/x86_64 core files.
With some further refinement we should be able to merge all of the
processor-specific RegisterContextPOSIX_* classes into a single shared
one.
llvm-svn: 201577
ProcessElfCore::ParseThreadContextsFromNoteSegment was leaking
ThreadData for each ELF note found in core file. We now allocate it
only once and use std::unique_ptr to ensure it is always being freed.
While at it make ParseFreeBSDThrMisc and ParseFreeBSDPrStatus take
ThreadData by reference, rather than pointer, since those arguments are
not optional.
Patch by Piotr Rak.
http://llvm-reviews.chandlerc.com/D2813
llvm-svn: 201473
This seems like a more straightforward approach for instantiating the
appropriate RegisterContext* class, made possible by Michael Sartain's
cleanup of the POSIX RegisterContext class hierarchy in r190647.
Better (user-facing) error handling is still needed.
llvm-svn: 201457
Revert the spirit of r199857 - a convincing case can be made that overriding a summary's format markers behind its back is not the right thing to do
This commit reverts the behavior of the code to the previous model, and changes the test case to validate the opposite of what it was validating before
llvm-svn: 201455
specify a list of functions which should be treated as trap handlers.
This will be primarily useful to people working in non-user-level
process debugging - kernels and other standalone environments.
For most people, the trap handler functions provided by the Platform
plugin will be sufficient.
<rdar://problem/15835846>, <rdar://problem/15982682>
llvm-svn: 201386
This was primarily working around problems where we weren't able
to identify trap handlers for different environments -- but instead,
I'm working to make it easier to specify those trap handler function
names.
llvm-svn: 201366
add a new pure virtual CalculateTrapHandlerSymbolNames() that Platform
subclasses must implement which fills in the function name list with any
trap handlers that are expected on that platform.
llvm-svn: 201364
Michael Sartain refactored RegisterContextPOSIX_* in r192332, and I must
have missed the now-shadowed variable when I rebased the FreeBSD MIPS64
register context after that.
llvm-svn: 201334
aka asynchronous signal handlers, which subclasses should fill
in as appropriate. For most Unix user process environments,
the one entry in this list is _sigtramp. For bare-board and
kernel environments, there will be different sets of trap
handlers.
The unwinder needs to know when a frame is a trap handler
because the rules it enforces for the frame "above" the
trap handler is different from most middle-of-the-stack frames.
<rdar://problem/15835846>
llvm-svn: 201300
They were enforcing 16-byte alignment on stack frames for Darwin x86 programs.
But we've found that trap handlers typically don't have the stack pointer
aligned correctly when a trap happens and lldb wasn't backtracing all
the way through. This method is only used as a safety guard to prevent
lldb's unwinder from using a bogus address as a stack frame - we'll still
enforce word-size alignment on stack frames so that should be fine.
Also rolled back akaylor's changes from August 2013 in r188952 which changed
the i386 ABI plugin to relax the CallFrameAddressIsValid offsets for non-Darwin
targets where only 4-byte alignment is enforced. Now Darwin is the same as
those environments.
<rdar://problem/15982682>
llvm-svn: 201292
Elf core files were collapsing core segments when the virtual memory
addresses were contiguous without checking if the core-file-backed
memory region was the same size as the segment's VMA region. Without
this extra check, any time regions were collapsed but the core-backed
region was smaller (and thus had a zero-filled hole at the end), the
collapse operation would break VMA to core file lookups for subsequent
collapsed regions.
This change fixes the following bug:
http://llvm.org/bugs/show_bug.cgi?id=18769
llvm-svn: 201214
This test was skipped as it used to segfault on FreeBSD. It seems
the original issue has since been fixed, so have the test run again.
llvm-svn: 201169
use a system-wide unique thread ID instead of a pthread_t to identify
the thread we want debug info for. Also, free some more memory regions
that needed to be freed.
llvm-svn: 201117
Although the interface to el_push should be a constant parameter (as it is on
Darwin), certain Linux distributions currently ship a header which does not
provide proper const correctness. This causes compilation failures on Linux.
Strip the constness on the parameter, which whilst incorrect, is mostly
harmless. The parameter will not be changed by the interface and so it is
acceptable to do this. When distributions have updated to a more correct
declaration, it would be nice to revert this change.
Addresses PR18784.
llvm-svn: 201092
ObjectFile::SetLoadAddress (Target &target,
lldb::addr_t value,
bool value_is_offset);
Now "value" is a slide if "value_is_offset" is true, and "value" is an image base address otherwise. All previous usage of this API was using slides.
Updated the ObjectFileELF and ObjectFileMachO SetLoadAddress methods to do the right thing.
Also updated the ObjectFileMachO::SetLoadAddress() function to not load __LINKEDIT when it isn't needed and to only load sections that belong to the executable object file.
llvm-svn: 201003
What was happening was:
1 - Xcode ran and stopped and was doing work on thread 2
2 - Users would type something in Xcode console on thread 1
3 - thread 3 would be running command interpreter thread and try to execute command but get "failed to get API lock" error for any command that wanted the target API lock (like "expression")
<rdar://problem/15775016>
llvm-svn: 200997
When a user says
type formatter add ... unsigned int
he most probably means to deal with the "unsigned int" type. However, given how the LLDB command parser works, that command will try to add the formatter to the TWO types 'unsigned' AND 'int'
Since this is unlikely to be what the user wants, warn about it, and suggest they can use quotes to override the debugger's understanding
llvm-svn: 200996
Provide a filter for libc++ std::atomic<T>
This just hides some implementation clutter and promotes the actual content to only child status
llvm-svn: 200984
Move some code that was in DynamicLoaderPOSIXDLYD into the
base class DynamicLoader. In the case of UpdateLoadedSections(),
the test to see whether a file is loadable (its address is zero)
is not generally applicable so that test is changed to a more
universally applicable check for the SHF_ALLOC flag on the section.
Also make it explicit that the reading of the module_id in
DynamicLoaderPOSIXDYLD::GetThreadLocalData() is using a hardcoded
size (of module_id) of 4, which might not be appropriate on
big-endian 64-bit systems, leaving a FIXME comment in place.
llvm-svn: 200939
We now properly detect when a result object has an immediate output stream and don't echo the results a second time.
<rdar://problem/15954906>
llvm-svn: 200882
Also emit the "Executing commands" message so it properly only comes out when desired and so it comes out in the right place.
<rdar://problem/15992208>
llvm-svn: 200875