Commit Graph

1053 Commits

Author SHA1 Message Date
Enrico Granata 5e1480c5dc <rdar://problem/13308704>
Fixing a problem where ValueObject::GetPointeeData() would not accept "partial" valid reads (i.e. asking for 10 items and getting only 5 back)
While suboptimal, this situation is not a flat-out failure and could well be caused by legit scenarios, such as hitting a page boundary

Among others, this allows data formatters to print char* buffers allocated under libgmalloc

llvm-svn: 193704
2013-10-30 17:52:44 +00:00
Enrico Granata 38c546320c <rdar://problem/15045059>
One of the things that dynamic typing affects is the count of children a type has
Clear out the flag that makes us blindly believe the children count when a dynamic type change is detected

llvm-svn: 193663
2013-10-30 00:04:29 +00:00
Enrico Granata df7c7f99ba Fixing an issue in yesterday's dynamic type changes where we would not craft a valid SBType given debug information
Added a test case to help us detect regression in this realm

llvm-svn: 193631
2013-10-29 17:42:02 +00:00
Enrico Granata dc4db5a6eb <rdar://problem/15144376>
This commit reimplements the TypeImpl class (the class that backs SBType) in terms of a static,dynamic type pair

This is useful for those cases when the dynamic type of an ObjC variable can only be obtained in terms of an "hollow" type with no ivars
In that case, we could either go with the static type (+iVar information) or with the dynamic type (+inheritance chain)

With the new TypeImpl implementation, we try to combine these two sources of information in order to extract as much information as possible
This should improve the functionality of tools that are using the SBType API to do extensive dynamic type inspection

llvm-svn: 193564
2013-10-29 00:28:35 +00:00
Enrico Granata 553fad5c9a <rdar://problem/15319880>
Introduce a new boolean setting enable-auto-oneliner
This setting if set to false will force LLDB to not use the new compact one-line display

By default, one-line mode stays on, at least until we can be confident it works.
But now if it seriously impedes your workflow while it evolves/it works wonders but you still hate it, there's a way to turn it off

llvm-svn: 193450
2013-10-25 23:09:40 +00:00
Enrico Granata ce451cc300 <rdar://problem/15235492>
Extend DummySyntheticProvider to actually use debug-info vended children as the source of information
Make Python synthetic children either be valid, or fallback to the dummy, like their C++ counterparts

This allows LLDB to actually stop bailing out upon encountering an invalid synthetic children provider front-end, and still displaying the non synthetized ivar info

llvm-svn: 192741
2013-10-15 22:42:14 +00:00
Greg Clayton 93e2861b81 <rdar://problem/15191078>
Fixed Module::ResolveSymbolContextForAddress() to be able to also look in the SymbolVendor's SymbolFile's ObjectFile for a more meaningful symbol when a symbol lookup finds a synthetic symbol from the main object file. This will help lookups on MacOSX as the main executable might be stripped, but the dSYM file always has a full symbol table.

llvm-svn: 192510
2013-10-11 22:03:48 +00:00
Ed Maste d616c97a81 Update comment (MIPS also has 32-bit opcodes)
llvm-svn: 192388
2013-10-10 19:17:07 +00:00
Ed Maste b73f844be3 POSIX RegisterContext for mips64
Based on the POSIX x86_64 register context.  This is sufficient for opening
a mips64 (big endian) core file.  Subsequent changes will connect the
disassembler, dynamic loader support, ABI, etc.

Review: http://llvm-reviews.chandlerc.com/D1873
llvm-svn: 192335
2013-10-10 00:59:47 +00:00
Ed Maste b0e33d4165 Fix endianness in ObjectFile::CopyData
ObjectFile::CopyData is used to copy a block of target memory to the
caller's buffer (e.g. for "memory read").  This should be a straight
memcpy, and not byte-swapped if the target and host have different
endianness.

Add a new DataExtractor::CopyData() method that performs this straight
copy and use it in ObjectFile::CopyData().

llvm-svn: 192323
2013-10-09 20:34:25 +00:00
Sean Callanan c707f32fbe Fixed a bug where variables' byte sizes would not
respect their Clang types if the variables' values
were represented by DWARF constu values.

<rdar://problem/14636499>

llvm-svn: 192267
2013-10-09 02:32:37 +00:00
Enrico Granata b1c6c489ca <rdar://problem/14923930>
Constant ValueObjects should clear their description as well as their summary. Rationale being that both can depend on deeper-than-constified data
so both are subject to changes in "unpredictable" ways
To see this consider repeatedly po'ing a persistent variable of a type whose -description result changes at each invocation

llvm-svn: 192259
2013-10-09 00:33:55 +00:00
Enrico Granata 852cc954db <rdar://problem/11778815>
Formats (as in "type format") are now included in categories
The only bit missing is caching formats along with synthetic children and summaries, which might be now desirable

llvm-svn: 192217
2013-10-08 19:03:22 +00:00
Jason Molenda 64a11733c9 Add entries for arm6m to ArchSpec's g_macho_arch_entries.
<rdar://problem/15099306>

llvm-svn: 192161
2013-10-08 03:01:08 +00:00
Sean Callanan 9076c0fffb Made all other "operator bool"s explicit and ensured
that all clients use them explicitly.  This will hopefully
prevent any future confusion where things get cast to types
we don't expect.

<rdar://problem/15146458>

llvm-svn: 191984
2013-10-04 21:35:29 +00:00
Ed Maste db3c60e388 Remove EOL whitespace and redundant break statement
llvm-svn: 191960
2013-10-04 15:29:20 +00:00
Sean Callanan ddd7a2a65b Changed the bool conversion operator on ConstString
to be explicit, to prevent horrid things like

std::string a = ConstString("foo")

from taking the path ConstString -> bool -> char
-> std::string.

This fixes, among other things, ClangFunction.

<rdar://problem/15137989>

llvm-svn: 191934
2013-10-03 22:27:29 +00:00
Enrico Granata 4d93b8cdf3 <rdar://problem/14393032>
DumpValueObject() 2.0

This checkin restores pre-Xcode5 functionality to the "po" (expr -O) command:
- expr now has a new --description-verbosity (-v) argument, which takes either compact or full as a value (-v is the same as -vfull)
 When the full mode is on, "po" will show the extended output with type name, persistent variable name and value, as in
(lldb) expr -O -v -- foo
(id) $0 = 0x000000010010baf0 {
    1 = 2;
    2 = 3;
}

 When -v is omitted, or -vcompact is passed, the Xcode5-style output will be shown, as in
(lldb) expr -O -- foo
{
    1 = 2;
    2 = 3;
}

- for a non-ObjectiveC object, LLDB will still try to retrieve a summary and/or value to display
(lldb) po 5
5
-v also works in this mode
(lldb) expr -O -vfull -- 5
(int) $4 = 5 

On top of that, this is a major refactoring of the ValueObject printing code. The functionality is now factored into a ValueObjectPrinter class for easier maintenance in the future
DumpValueObject() was turned into an instance method ValueObject::Dump() which simply calls through to the printer code, Dump_Impl has been removed

Test case to follow

llvm-svn: 191694
2013-09-30 19:11:51 +00:00
Jason Molenda c7cda27f79 Mark armv6m as "compatible" with armv7 - that's the
closest ISA.  armv6 wouldn't have the handful of
T32 instructions that the Cortex-M0 ISA specifies.
<rdar://problem/15099306> 

llvm-svn: 191588
2013-09-27 23:29:10 +00:00
Jason Molenda a3a0452831 Add definitions for "armv6m", which indicates a Cortex-M0 processor.
It uses the T16 and a few T32 instructions from the ARMv7-A ISA.
<rdar://problem/15099306> 

llvm-svn: 191587
2013-09-27 23:21:54 +00:00
Carlo Kok bb5c5f8289 missed one Close () call in 191446 overload fix for Posix only code.
llvm-svn: 191455
2013-09-26 20:22:28 +00:00
Carlo Kok b1a63bdf55 On Windows MapViewOfFile requires the offset to be aligned on the system dwAllocationGranularity
llvm-svn: 191447
2013-09-26 18:52:08 +00:00
Carlo Kok a46964f1bb On windows a socket and file descriptor aren't the same kind of handle, pass the type to Close so it uses the right api to close it.
llvm-svn: 191446
2013-09-26 18:49:53 +00:00
Joerg Sonnenberger 34ea0f8a34 NetBSD also has a size field in socket addresses.
llvm-svn: 191387
2013-09-25 17:56:00 +00:00
Joerg Sonnenberger 340a17595e Convert to UNIX line endings.
llvm-svn: 191367
2013-09-25 10:37:32 +00:00
Enrico Granata 5d5f60c391 Target::m_suppress_synthetic_value was a hack required to disable synthetic values while passing an SBValue to a synthetic child provider, or incur an endless recursion
Now that SBValues can be setup to ignore synthetic values, this is no longer necessary, and so m_suppress_synthetic_value can go away

Another Hack Bites the Dust

llvm-svn: 191338
2013-09-24 22:58:37 +00:00
Ashok Thirumurthi 35729bb1f8 Adds an option to resolve a symbol from an address that can be used
to build out the symbol table as addresses are used, and implements
the mechanism for ELF to add stripped symbols from eh_frame.

Uses this mechanism to allow disassembly for addresses corresponding
to stripped symbols for ELF, and provide hooks to implement this for
PE COFF.

Also removes eSymbolContextTailCall in favor of an option for
ResolveSymbolContextForAddress for consistency with the documentation
for eSymbolContextEverything.  Essentially, this is just an option for
interpreting the so_addr.
                  

llvm-svn: 191307
2013-09-24 15:34:13 +00:00
Ashok Thirumurthi 2568f45939 Fix lldb regressions due to r190812 in the case where debug info is present.
Specifically, allows the unwinder to handle the case where sc.function
gets resolved with a pc that is one past the address range of the function
(consistent with a tail call).  However, there is no matching symbol.

Adds eSymbolContextTailCall to provide callers with control over the scope
of symbol resolution and to allow ResolveSymbolContextForAddress to handle
tail calls since this routine is common to unwind and disassembly.

llvm-svn: 191102
2013-09-20 19:05:10 +00:00
Ed Maste 7c0f2ce467 Assert that only reg- or word-sized values are byte swapped
Targets and hosts today are little-endian (arm, x86), so this change
should be a no-op as they will not encounter the byte swapping cases.

Byte swapping  will happen when cross debugging of big endian-targets
(e.g. MIPS, PPC) on a little-endian host (x86).  Register- or word-
sized data copies need to be swapped, but calls to ExtractBytes or
CopyByteOrderedData that would invoke the swapping case are presumably
in error.

llvm-svn: 191005
2013-09-19 15:12:36 +00:00
Greg Clayton edfaae3956 Fixed a logic error in Module::ResolveSymbolContextForAddress(). Asking an address if its offet is greater than zero doesn't actually correctly tell us wether the address is section offset or not. A symbol could be the first symbol in a section and its offset can be zero. Also, a non-section offset lldb_private::Address can have a NULL section and calling GetOffset() will return the absolute address. To really test if an address is section offset clients should use Address::IsSectionOffset(). Also simplified the code that backs the address up by one to use the Address::Slide() function.
llvm-svn: 190955
2013-09-18 20:03:31 +00:00
Virgile Bello d0c5c776bc Visual Studio 2013 compilation support: added some #ifdef _MSC_VER for unsupported code in MSVC.
llvm-svn: 190924
2013-09-18 08:09:31 +00:00
Ashok Thirumurthi 30c27d6ace Fix a typo in DataExtractor.cpp causing build breakage
that was introduced by r190873.

llvm-svn: 190879
2013-09-17 19:07:02 +00:00
Ed Maste 661e89c13d Don't output a stray 0x if GetData fails for memory read -f hex
llvm-svn: 190875
2013-09-17 17:54:45 +00:00
Ed Maste 74a23ea494 Avoid abort on "memory read -s N" for N=3,5,6,7
We cannot use "GetMaxU64Bitfield" for non-power-of-two sizes, so just use
the same code that handles N > 8 for these.

Review: http://llvm-reviews.chandlerc.com/D1699
llvm-svn: 190873
2013-09-17 17:51:33 +00:00
Andrew Kaylor bac7af21da Logging enhancements to ConnectionFileDescriptor
llvm-svn: 190872
2013-09-17 17:18:58 +00:00
Ashok Thirumurthi 3880714172 Fixes symbol resolution for a function with a tail call because the PC
for the frame is one past the address range of the calling function.
- Lowers the fix from RegisterContextLLDB for use with disassembly
- Fixes one of three issues in the disassembly test in TestInferiorAssert.py

Also adds documentation that explains the resolution depths and interface.

Note: This change affects the resolution scope for eSymbolContextFunction
without impacting the performance of eSymbolContextSymbol.

Thanks to Matt Kopec for his review.

llvm-svn: 190812
2013-09-16 22:00:17 +00:00
Jason Molenda 6b3e6d5487 Disassembler::DisassembleRange() currently calls Target::ReadMemory
with prefer_file_cache == false.  This is what we want to do when
the user is doing a disassemble command -- show the actual memory
contents in case the memory has been corrupted or something -- but
when we're profiling functions for stepping or unwinding
(ThreadPlanStepRange::GetInstructionsForAddress,
UnwindAssemblyInstEmulation::GetNonCallSiteUnwindP) we can read
__TEXT instructions directly out of the file, if it exists.
<rdar://problem/14397491> 

llvm-svn: 190638
2013-09-12 23:23:35 +00:00
Richard Mitton f86248d9ba Added a 'jump' command, similar to GDBs.
This allows the PC to be directly changed to a different line.
It's similar to the example python script in examples/python/jump.py, except implemented as a builtin.

Also this version will track the current function correctly even if the target line resolves to multiple addresses. (e.g. debugging a templated function)

llvm-svn: 190572
2013-09-12 02:20:34 +00:00
Enrico Granata e2e220a805 <rdar://problem/14071463>
SVN r189964 provided a sample Python script to inspect unordered(multi){set|map} with synthetic children, contribued by Jared Grubb
This checkin converts that sample script to a C++ provider built into LLDB
A test case is also provided

llvm-svn: 190564
2013-09-12 00:48:47 +00:00
Jason Molenda 3c2dacaf88 Change a printf() formatter to use %d for a uint32_t.
llvm-svn: 190548
2013-09-11 21:00:37 +00:00
Jim Ingham f0649a6c0e Include file cleanup.
llvm-svn: 190084
2013-09-05 18:57:48 +00:00
Jim Ingham 859a3b98c5 Remove spurious reference to radars in code (we try not to put Radar numbers into the sources.)
llvm-svn: 190023
2013-09-05 01:48:56 +00:00
Virgile Bello 0a3b151fdf Remove <windows.h> from lldb-types.h.
llvm-svn: 189934
2013-09-04 13:56:11 +00:00
Eric Christopher 2490f5c9f6 Fix a bunch of compile time warnings and a build failure on ubuntu.
llvm-svn: 189683
2013-08-30 17:50:57 +00:00
Virgile Bello bdae3787ef Cleanup/rearrange includes:
- factorize unistd.h and stdbool.h in lldb-types.h.
- Add <functional> and <string> where required.

llvm-svn: 189477
2013-08-28 12:14:27 +00:00
Charles Davis 322fc8477c Core: Fix non-Darwin build.
More fallout from my mass-Mach-O-renaming.

llvm-svn: 189323
2013-08-27 06:13:56 +00:00
Charles Davis 510938e528 Fix some names in the wake of my Mach-O changes to LLVM.
llvm-svn: 189317
2013-08-27 05:04:57 +00:00
Charles Davis 237ad9741a Plugins/ObjectFile/PECOFF: Use enums from LLVM, and don't use Mach-O definitions.
Since I renamed most of the LLVM Mach-O enums in r189314, I had to go fix
LLDB to use the new names. While I was here, I decided that a COFF
plugin really shouldn't be using Mach-O enums.

llvm-svn: 189316
2013-08-27 05:04:33 +00:00
Daniel Malea e0f8f574c7 merge lldb-platform-work branch (and assorted fixes) into trunk
Summary:
    This merge brings in the improved 'platform' command that knows how to
    interface with remote machines; that is, query OS/kernel information, push
    and pull files, run shell commands, etc... and implementation for the new
    communication packets that back that interface, at least on Darwin based
    operating systems via the POSIXPlatform class. Linux support is coming soon.

    Verified the test suite runs cleanly on Linux (x86_64), build OK on Mac OS
    X Mountain Lion.

    Additional improvements (not in the source SVN branch 'lldb-platform-work'):
    - cmake build scripts for lldb-platform
    - cleanup test suite
    - documentation stub for qPlatform_RunCommand
    - use log class instead of printf() directly
    - reverted work-in-progress-looking changes from test/types/TestAbstract.py that work towards running the test suite remotely.
    - add new logging category 'platform'

    Reviewers: Matt Kopec, Greg Clayton

    Review: http://llvm-reviews.chandlerc.com/D1493

llvm-svn: 189295
2013-08-26 23:57:52 +00:00
Virgile Bello b2f1fb2943 MingW compilation (windows). Includes various refactoring to improve portability.
llvm-svn: 189107
2013-08-23 12:44:05 +00:00
Richard Mitton f2bef0b15d Fixed DataExtractor to correctly display Intel extended doubles.
This means that "register read stmm0 --format f" actually works now.

This is a little messy but LLDB assumes 'long double' is portable, when it is not.

llvm-svn: 188698
2013-08-19 19:39:03 +00:00
Jason Molenda 20eb31b907 Add a new Section::SetFileAddress method to change a Section's file
address.

When loading a dSYM, and the file addresses of the dSYM Sections are
different than the executable binary Sections' file addresses, the
debug info won't be remapped to the actual load addresses correctly.
This only happens with binaries on the in-memory shared cache binaries
where their File addresses have been set to their actual load address
(outside an offset value) whereas the original executable and dSYM
have 0-based File addresses.

I think this patch will not be activated for other cases -- this is
the only case we know of where the dSYM and the executable's File
addresses differ -- but if this causes other problems we can restrict
it more carefully.

<rdar://problem/12335086> 

llvm-svn: 188532
2013-08-16 03:20:42 +00:00
Greg Clayton 540fbbfa7a When adding a dSYM file, don't remove all sections for the Module's object file if the symbol vendor used the same object file.
llvm-svn: 188289
2013-08-13 16:46:35 +00:00
Greg Clayton fd814c5a64 <rdar://problem/14717184>
LLDB needs in memory module load level settings to control how much information is read from memory when loading in memory modules. This change adds a new setting:

(lldb) settings set target.memory-module-load-level [minimal|partial|complete]

minimal will load only sections (no symbols, or function bounds via function starts or EH frame)
partial will load sections + bounds
complete will load sections + bounds + symbols

llvm-svn: 188246
2013-08-13 01:42:25 +00:00
Greg Clayton 83b162d87f Change PowerPC to have the correct byte order.
llvm-svn: 188189
2013-08-12 18:34:04 +00:00
Sean Callanan 9ba6eaec57 Check for division by zero when performing modulus
operations.

<rdar://problem/14656908>

llvm-svn: 187996
2013-08-08 17:57:00 +00:00
Jim Ingham 56d404281f The DisassemblerLLVMC has a retain cycle - the InstructionLLVMC's contained in its instruction
list have a shared pointer back to their DisassemblerLLVMC.  This checkin force clears the InstructionList
in all the places we use the DisassemblerSP to stop the leaking for now.  I'll go back and fix this
for real when I have time to do so.

<rdar://problem/14581918>

llvm-svn: 187473
2013-07-31 02:19:15 +00:00
Michael Sartain 0769b2b1f3 Add format specifiers to various format ids so we can print thread ids in decimal on Linux and FreeBSD.
CC: emaste

Differential Revision: http://llvm-reviews.chandlerc.com/D1234

llvm-svn: 187425
2013-07-30 16:44:36 +00:00
Greg Clayton 46a4426286 <rdar://problem/14521548>
Fixed a crasher where if you accidentally specify a size that is too large when reading memory, LLDB would crash.

llvm-svn: 187060
2013-07-24 18:17:35 +00:00
Ed Maste 76859d6cb2 elf-core: Parse vendor-specific notes
ELF notes contain a 'name' field, which specifies a vendor who defines
the format of the note.  Examples are 'FreeBSD' or 'GNU', or it may be
empty for generic notes.

Add a case for FreeBSD-specific notes, leaving Linux and GNU notes,
other vendor-specific notes, and generic notes to be handled by the
existing code for now.

Thanks to Samuel Jacob for reviewing and suggesting improvements.

llvm-svn: 186973
2013-07-23 18:22:17 +00:00
Michael Sartain 3cf443ddd6 simple plugin now works with Linux fix assert in SetPluginInfo implement Linux ePathTypeLLDBSystemPlugins and ePathTypeLLDBUserPlugins implement Linux Host::Backtrace and Host::GetEnvironment add .gnu_debugdata comment
Differential Revision: http://llvm-reviews.chandlerc.com/D1159

llvm-svn: 186475
2013-07-17 00:26:30 +00:00
Greg Clayton 7f98240df6 <rdar://problem/13793059>
Added a setting to control timeout for kdp response packets. While I was at it, I also added a way to control the response timeout for gdb-remote packets.

KDP defaults to 5 seconds, and GDB defaults to 1 second. These were the default values that were in the code prior to adding these settings.

(lldb) settings set plugin.process.gdb-remote.packet-timeout 10
(lldb) settings set plugin.process.kdp-remote.packet-timeout 10

llvm-svn: 186360
2013-07-15 22:54:20 +00:00
Greg Clayton 2540a8a7bc Fixed GetModuleSpecifications() to work better overall:
- MachO files now correctly extract the UUID all the time
- More file size and offset verification done for universal mach-o files to watch for truncated files
- ObjectContainerBSDArchive now supports enumerating all objects in BSD archives (.a files)
- lldb_private::Module() can not be properly constructed using a ModuleSpec for a .o file in a .a file
- The BSD archive plug-in shares its cache for GetModuleSpecifications() and the create callback
- Improved printing for ModuleSpec objects

llvm-svn: 186211
2013-07-12 22:07:46 +00:00
Greg Clayton 57ee306789 Huge change to clean up types.
A long time ago we start with clang types that were created by the symbol files and there were many functions in lldb_private::ClangASTContext that helped. Later we create ClangASTType which contains a clang::ASTContext and an opauque QualType, but we didn't switch over to fully using it. There were a lot of places where we would pass around a raw clang_type_t and also pass along a clang::ASTContext separately. This left room for error.

This checkin change all type code over to use ClangASTType everywhere and I cleaned up the interfaces quite a bit. Any code that was in ClangASTContext that was type related, was moved over into ClangASTType. All code that used these types was switched over to use all of the new goodness.

llvm-svn: 186130
2013-07-11 22:46:58 +00:00
Michael Sartain cc791bbfab Fix "source list -n printf" on Linux (printf is symbol alias for __printf)
Differential Revision: http://llvm-reviews.chandlerc.com/D1109

llvm-svn: 186104
2013-07-11 16:40:56 +00:00
Greg Clayton 3046e66830 Cleanup on the unified section list changes. Main changes are:
- ObjectFile::GetSymtab() and ObjectFile::ClearSymtab() no longer takes any flags
- Module coordinates with the object files and contain a unified section list so that object file and symbol file can share sections when they need to, yet contain their own sections.

Other cleanups:
- Fixed Symbol::GetByteSize() to not have the symbol table compute the byte sizes on the fly
- Modified the ObjectFileMachO class to compute symbol sizes all at once efficiently
- Modified the Symtab class to store a file address lookup table for more efficient lookups
- Removed Section::Finalize() and SectionList::Finalize() as they did nothing
- Improved performance of the detection of symbol files that have debug maps by excluding stripped files and core files, debug files, object files and stubs
- Added the ability to tell if an ObjectFile has been stripped with ObjectFile::IsStripped() (used this for the above performance improvement)

llvm-svn: 185990
2013-07-10 01:23:25 +00:00
Greg Clayton 226cce2511 Added a way to extract the module specifications from a file. A module specification is information that is required to describe a module (executable, shared library, object file, ect). This information includes host path, platform path (remote path), symbol file path, UUID, object name (for objects in .a files for example you could have an object name of "foo.o"), and target triple. Module specification can be used to create a module, or used to add a module to a target. A list of module specifications can be used to enumerate objects in container objects (like universal mach files and BSD archive files).
There are two new classes:

lldb::SBModuleSpec
lldb::SBModuleSpecList

The SBModuleSpec wraps up a lldb_private::ModuleSpec, and SBModuleSpecList wraps up a lldb_private::ModuleSpecList.

llvm-svn: 185877
2013-07-08 22:22:41 +00:00
Michael Sartain 4b2967ff9f Use target DisplaySource if available so we can get mixed source and assembly.
This fixes "disassemble -m -n __printf".

llvm-svn: 185845
2013-07-08 17:56:02 +00:00
Jason Molenda 45f6b1f935 Remove lldb's custom copy of the C++ demangler, used only on Mac
OS X.  Testsuite shows no change in results using the system runtime's
demangler.
<rdar://problem/12029914> 

llvm-svn: 185510
2013-07-03 04:52:51 +00:00
Michael Sartain a7499c9830 Split symbol support for ELF and Linux.
llvm-svn: 185366
2013-07-01 19:45:50 +00:00
Jim Ingham d516deb4f2 Formatting cleanup.
llvm-svn: 185357
2013-07-01 18:49:43 +00:00
Tim Northover 0614fcd0e3 Prevent race in when stopping a "read thread"
Both StopReadThread and the thread being stopped set the thread id to
0 after m_read_thread_enabled was set to false. If the thread being
stopped got there first then StopReadThread called pthread_join on an
invalid thread number. This is not a Good Thing,

Should fix a fairly regular segfault when quitting on Linux.

llvm-svn: 185107
2013-06-27 21:19:30 +00:00
Ed Maste da9f9ae7d4 Use canonical termios.h location
llvm-svn: 184744
2013-06-24 15:03:16 +00:00
Enrico Granata 2c75f11e86 Adding two new markers to the ${var..} specifier
- %N = show the name of the variable
- %> = show the expression path of the variable

llvm-svn: 184502
2013-06-21 00:04:51 +00:00
Enrico Granata aad8e48054 In thread and frame format strings, it is now allowed to use Python functions to generate part or all of the output text
Specifically, the ${target ${process ${thread and ${frame specifiers have been extended to allow a subkeyword .script:<fctName> (e.g. ${frame.script:FooFunction})
The functions are prototyped as

def FooFunction(Object,unused)

where object is of the respective SB-type (SBTarget for target.script, ... and so on)

This has not been implemented for ${var because it would be akin to a Python summary which is already well-defined in LLDB

llvm-svn: 184500
2013-06-20 23:40:21 +00:00
Greg Clayton d8c3d4b1e9 Implemented a types.py module that allows types to be inspected for padding.
The script was able to point out and save 40 bytes in each lldb_private::Section by being very careful where we need to have virtual destructors and also by re-ordering members.

llvm-svn: 184364
2013-06-19 21:50:28 +00:00
Andy Gibbs a297a97e09 Sort out a number of mismatched integer types in order to cut down the number of compiler warnings.
llvm-svn: 184333
2013-06-19 19:04:53 +00:00
Enrico Granata 08a1bb8199 <rdar://problem/14194140>
Adding support for correctly extracting children out of vector types for data formatter purposes

llvm-svn: 184262
2013-06-19 00:00:45 +00:00
Enrico Granata 68ae4117d9 <rdar://problem/12717717>
Modifying our data formatters matching algorithm to ensure that "const X*" is treated as equivalent to "X*"
Also, a couple improvements to the "lldb types" logging

llvm-svn: 184215
2013-06-18 18:23:07 +00:00
Greg Clayton d8cf1a119d Huge performance improvements when one breakpoint contains many locations.
325,000 breakpoints for running "breakpoint set --func-regex ." on lldb itself (after hitting a breakpoint at main so that LLDB.framework is loaded) used to take up to an hour to set, now we are down under a minute. With warm file caches, we are at 40 seconds, and that is with setting 325,000 breakpoint through the GDB remote API. Linux and the native debuggers might be faster. I haven't timed what how much is debug info parsing and how much is the protocol traffic to/from GDB remote.

That there were many performance issues. Most of them were due to storing breakpoints in the wrong data structures, or using the wrong iterators to traverse the lists, traversing the lists in inefficient ways, and not optimizing certain function name lookups/symbol merges correctly.

Debugging after that is also now very efficient. There were issues with replacing the breakpoint opcodes in memory that was read, and those routines were also fixed.

llvm-svn: 183820
2013-06-12 00:46:38 +00:00
Greg Clayton bc8fc0f5e0 Use llvm::APFloat for formatting if a target is available. Each target when debugging has a "ASTContext" that helps us to use the correct floating point semantics. Now that APFloat supports toString we now use that. If we don't have a target, we still fall back on the old display methodology, but the important formatting should always have a target available and thus use the compiler floating point code.
Modified the test programs to use floating point constants that always will display correctly. We had some numbers that were being rounded, and now that we are using clang, we no longer round them and we get more correct results.

llvm-svn: 183792
2013-06-11 21:56:55 +00:00
Greg Clayton 3fb543b06d Remove eFormatHalfFloat as it isn't needed. eFormatFloat should be used and the byte size will tell us how to display it.
llvm-svn: 183755
2013-06-11 17:32:06 +00:00
Enrico Granata 97fe23e00a <rdar://problem/12783351>
Add support for half-floats, as specified by IEEE-754-2008
With this checkin, you can now say:
(lldb) x/7hf foo

to read 7 half-floats at address foo

llvm-svn: 183716
2013-06-11 00:18:18 +00:00
Jim Ingham 4e5c821087 Don't retry the Connect when starting up debugserver if the reason for the previous failure was
EINTR.  That means the user was trying to interrupt us, and we should just stop instead.

<rdar://problem/13184758>

llvm-svn: 183577
2013-06-07 22:09:53 +00:00
Jim Ingham e96ade8bf6 Make the "SearchFilterByModuleListAndCU" work correctly for searches at the CompUnit
level.  Fixes a bug in "break set --source-pattern-regexp" when a shared library is
specified.  

Also cleaned up the help text for --source-pattern-regexp so it is a little clearer.

<rdar://problem/14084261>

llvm-svn: 183476
2013-06-07 01:13:00 +00:00
Jim Ingham d3480f5851 Address::GetSection() turns a weak pointer to a shared pointer which is a little slow. So in Address::operator== & != do the
cheap GetOffset() comparison first and only compare the sections if that is true.

llvm-svn: 183452
2013-06-06 22:16:56 +00:00
Matt Kopec ef14371d3f Fix various build warnings.
llvm-svn: 183140
2013-06-03 18:00:07 +00:00
Daniel Malea c91e4ab26e Use C-style include to match style in file (instead of C++ style)
- as per review comment from Dimitry Andric!

llvm-svn: 183039
2013-05-31 20:21:38 +00:00
Daniel Malea e376a65182 FreeBSD cmake build fixes.
- missing #include <cstdlib> in Mangled.cpp
- missing include dirs in FreeBSD CMakeLists.txt

Patch by Ed Maste!

llvm-svn: 183032
2013-05-31 19:24:53 +00:00
Enrico Granata b294fd2037 <rdar://problem/14035604>
Fixing an issue where formats would not propagate from parents to children in all cases
Details follow:
an SBValue has children and those are fetched along with their values
Now, one calls SBValue::SetFormat() on the parent
Technically, the format choices should propagate onto the children (see ValueObject::GetFormat())
But if the children values are already fetched, they won't notice the format change and won't update themselves
This commit fixes that by making ValueObject::GetValueAsCString() check if any format change intervened from the previous call to the current one
A test case is also added

llvm-svn: 183030
2013-05-31 19:18:19 +00:00
Enrico Granata 39d5141085 Small code cleanups
llvm-svn: 183024
2013-05-31 17:43:40 +00:00
Enrico Granata e0c70f1b2c <rdar://problem/11109316>
command script import now does reloads - for real
If you invoke command script import foo and it detects that foo has already been imported, it will
 - invoke reload(foo) to reload the module in Python
 - re-invoke foo.__lldb_init_module
 This second step is necessary to ensure that LLDB does not keep cached copies of any formatter, command, ... that the module is providing

Usual caveats with Python imports persist. Among these:
 - if you have objects lurking around, reloading the module won't magically update them to reflect changes
 - if module A imports module B, reloading A won't reload B
These are Python-specific issues independent of LLDB that would require more extensive design work

The --allow-reload (-r) option is maintained for compatibility with existing scripts, but is clearly documented as redundant - reloading is always enabled whether you use it or not

llvm-svn: 182977
2013-05-31 01:03:09 +00:00
Greg Clayton 086e085efa Remove unused variable.
llvm-svn: 182892
2013-05-29 23:22:22 +00:00
Sean Callanan 0b342b6ddf Fixed signed operations in the IR interpreter.
Scalar now can make itself signed if needed.

<rdar://problem/13977632>

llvm-svn: 182668
2013-05-24 20:36:56 +00:00
Michael Sartain c836ae7d36 ObjectFileELF::GetModuleSpecifications on Linux should work now.
Which means "platform process list" should work and list the architecture.
We are now parsing the elf build-id if it exists, which should allow us to load stripped symbols (looking at that next).

llvm-svn: 182610
2013-05-23 20:57:03 +00:00
Michael Sartain c3ce7f2740 Add ${ansi.XX} parsing to lldb prompt, use-color setting, and -no-use-colors command line options.
settings set use-color [false|true]
settings set prompt "${ansi.bold}${ansi.fg.green}(lldb)${ansi.normal} "
also "--no-use-colors" on the command prompt

llvm-svn: 182609
2013-05-23 20:47:45 +00:00
Greg Clayton cc24775b42 <rdar://problem/13966084>
Make sure to not call "regexec" from <regex.h> with a NULL C string, otherwise we can crash.

llvm-svn: 182607
2013-05-23 20:27:15 +00:00
Greg Clayton 217b28baee <rdar://problem/13880690>
Lock the lldb_private::Module mutex while tearing down the module to make sure we don't get clients accessing the contents on a module as it is going away.

llvm-svn: 182511
2013-05-22 20:13:22 +00:00
Enrico Granata 4e284caa9b Adding a newline for better overall readability
llvm-svn: 182434
2013-05-21 22:34:17 +00:00
Enrico Granata 397ddd5f96 <rdar://problem/13878726>
Yet another implementation of the python in dSYM autoload :)
This time we are going with a ternary setting:
true - load, do not warn
false - do not load, do not warn
warn - do not load, warn (default)

llvm-svn: 182414
2013-05-21 20:13:34 +00:00