Commit Graph

5959 Commits

Author SHA1 Message Date
Jason Molenda 7964ab5e49 Fix ABIMacOSX_i386::RegisterIsVolatile to return the negated value of
RegisterIsCalleeSaved.  Add ebp back to the list of registers that
are callee saved.
<rdar://problem/12817918> 

llvm-svn: 169466
2012-12-06 02:49:20 +00:00
Greg Clayton 4ef877f5e9 <rdar://problem/12560257>
Fixed zero sized arrays to work correctly. This will only happen once we get a clang that emits correct debug info for zero sized arrays. For now I have marked the TestStructTypes.py as an expected failure.

llvm-svn: 169465
2012-12-06 02:33:54 +00:00
Sean Callanan eab6cc98d7 The expression parser will now check the validity
of the "self"/"this" pointer for the current stack
frame before wrapping expressions in C++ or
Objective-C methods.  This works around bad debug
info where the compiler emits a "this" or "self"
but doesn't give any way to find its location.

<rdar://problem/12809985>

llvm-svn: 169461
2012-12-06 01:35:38 +00:00
Daniel Malea ad75f07274 Move isprint8() into lldb_private as per post-commit review from Stefanus
llvm-svn: 169454
2012-12-06 00:10:37 +00:00
Sean Callanan faa0bb3fa1 Rewrote the bitfield logic. Major changes include:
- Removed the BitfieldMap class because it is unnecessary.
  We now just track the most recently added field.

- Moved the code that calculates bitfield widths so it
  can also be used to determine whether it's necessary
  to insert anonymous fields.

- Simplified the anonymous field calculation code into
  three cases (two of which are resolved identically).

- Beefed up the bitfield testcase.

llvm-svn: 169449
2012-12-05 23:37:14 +00:00
Jason Molenda 727e392a45 Adding missing log->Printf instead of printf in Target::SetArchitecture
for target logging.

llvm-svn: 169444
2012-12-05 23:07:34 +00:00
Greg Clayton e6a07793e0 <rdar://problem/12560257>
Fixed arrays with a size of 1 to correctly have 1 member when DW_AT_upper_bound was set to zero and no other attributes were set.

llvm-svn: 169431
2012-12-05 21:59:39 +00:00
Greg Clayton b43165b7a5 <rdar://problem/12749733>
Always allows getting builtin types by name even if there is no backing debug information.

llvm-svn: 169424
2012-12-05 21:24:42 +00:00
Daniel Malea 90b0c84bcf Define isprint8() wrapper around isprint() in order to avoid crashes on Linux
llvm-svn: 169417
2012-12-05 20:24:57 +00:00
Greg Clayton 2a354a2969 Backed out part of the ABI changes that were checked in because it breaks the i386 test suite as it makes backtraces for the first instruction of a function fail. Stepping relies on backtraces being correct, so I am reverting what is causing the breakage.
I filed this to track the fix:

<rdar://problem/12817918> Recent i386 ABI changes break the i386 test suite because stack backtracing is busted when stopped in trampolines

llvm-svn: 169409
2012-12-05 19:43:20 +00:00
Greg Clayton 6d0be66afd Crash every time with new target logging is now fixed.
llvm-svn: 169394
2012-12-05 18:23:55 +00:00
Jason Molenda e1b68aded6 Add an LLDB_LOG_TARGET logging channel (log eanble lldb target).
Update the Target methods which can change the target log to this
channel.

llvm-svn: 169342
2012-12-05 00:25:49 +00:00
Daniel Malea 93a64300f8 Fix Linux build warnings due to redefinition of macros:
- add new header lldb-python.h to be included before other system headers
- short term fix (eventually python dependencies must be cleaned up)

Patch by Matt Kopec!

llvm-svn: 169341
2012-12-05 00:20:57 +00:00
Greg Clayton 90ba81150e <rdar://problem/12649160>
Added the ability to debug through your process exec'ing itself to the same architecture.

llvm-svn: 169340
2012-12-05 00:16:59 +00:00
Jason Molenda 011aea45a9 Fix comment in ABIMacOSX_i386::RegisterIsCalleeSaved to say that
these are the *non-volatile* registers on Darwin/i386, not the
volatile registers.
Recognize the sp, pc, fp generic reg names as well.

llvm-svn: 169316
2012-12-04 22:08:50 +00:00
Sean Callanan c7cb3145a0 In the data formatters, if we know the result
type of an Objective-C selector, don't bother
making the expression parser resolve it all over
again.  Just send the message straight to the
object pointer as if it were an id, and cast the
result.

<rdar://problem/12799087>

llvm-svn: 169300
2012-12-04 20:56:04 +00:00
Sean Callanan 2f505a1c56 Cache the names for Objective-C classes if we know
them while making our initial run through the
Objective-C runtime's class tables.

<rdar://problem/12799087>

llvm-svn: 169299
2012-12-04 20:52:38 +00:00
Daniel Malea 4e718e7dd8 Mark TestConnectRemote.py as expected to fail on Linux due to bugzilla #14427
llvm-svn: 169295
2012-12-04 19:53:59 +00:00
Greg Clayton e14e19253d <rdar://problem/12750060>
Add the ability to get a symbol or symbols by name and type from a SBModule, and also the ability to get all symbols by name and type from SBTarget objects.

llvm-svn: 169205
2012-12-04 02:22:16 +00:00
Jim Ingham 15a2860b09 Missing #include to pick up def'n of TerminalState.h.
llvm-svn: 169203
2012-12-04 01:57:57 +00:00
Greg Clayton 12057dafea Get rid of a warning where functions in DNB.h were extern "C" when they don't need to be anymore.
llvm-svn: 169202
2012-12-04 01:57:36 +00:00
Greg Clayton 3bcdfc0ec1 <rdar://problem/12798131>
Cleaned up the option parsing code to always pass around the short options as integers. Previously we cast this down to "char" and lost some information. I recently added an assert that would detect duplicate short character options which was firing during the test suite.

This fix does the following:
- make sure all short options are treated as "int"
- make sure that short options can be non-printable values when a short option is not required or when an option group is mixed into many commands and a short option is not desired
- fix the help printing to "do the right thing" in all cases. Previously if there were duplicate short character options, it would just not emit help for the duplicates
- fix option parsing when there are duplicates to parse options correctly. Previously the option parsing, when done for an OptionGroup, would just start parsing options incorrectly by omitting table entries and it would end up setting the wrong option value

llvm-svn: 169189
2012-12-04 00:32:51 +00:00
Daniel Malea 48947c7bbf A few more build fixes for gcc 4.6:
- use const char* instead of char* as needed in ObjC language runtime plugin
- use int to iterate through enum (operator++ on enum not defined)
- use initializer list instead of inline initialization of const field

llvm-svn: 169185
2012-12-04 00:23:45 +00:00
Sean Callanan 811209be11 Fixed a crash in which we examined the extension of
a file name, whether the file name had an extension
or not.

<rdar://problem/12793152>

llvm-svn: 169156
2012-12-03 21:28:37 +00:00
Greg Clayton f74c4034dd Fix clang build issues.
llvm-svn: 169140
2012-12-03 18:29:55 +00:00
Greg Clayton 2ed1c0922c <rdar://problem/12742973>
Forwarding a fix for a crasher in the demangler.

llvm-svn: 169136
2012-12-03 17:50:07 +00:00
Jason Molenda 65d57a3d2a Don't re-add kexts and the kernel each time we get a notification
that kexts were newly added.

The Darwin userland dynamic loader provides lldb with a list of 
newly-added or newly-removed binaries but in the kernel case we
only know that something has changed.  DynamicLoaderDarwinKernel
really needs to maintain its own persistent list of kexts that 
it has been notified about (most importantly, it will not detect
kext unlods) but for now we'll at least avoid re-adding an already
present kext.

<rdar://problem/12658487>, <rdar://problem/12658487> 

llvm-svn: 169082
2012-12-01 06:13:29 +00:00
Jason Molenda 420f81dc5d Bump lldb version num to lldb-178, debugserver version to debugserver-198.
llvm-svn: 169081
2012-12-01 04:50:09 +00:00
Jason Molenda dabdcc040d Read full 64 bits of kernel address when locating a
64-bit kernel in ProcessGDBRemote.
<rdar://problem/12657369>

llvm-svn: 169080
2012-12-01 04:46:58 +00:00
Sean Callanan 2abffe0530 Added support for PtrToInt to the IR
interpreter.

<rdar://problem/12657742>

llvm-svn: 169063
2012-12-01 00:09:34 +00:00
Sean Callanan 70385081c9 Added logging to the code that determines
whether the current frame is in a C++/Objective-C
class or instance method.

llvm-svn: 169062
2012-12-01 00:08:33 +00:00
Jim Ingham c5917d9a38 Save and restore terminal state when lldb is suspended with SIGTSTP and resumed with SIGCONT.
Readline & gdb have a bunch of code to handle older UNIX'es with other job control mechanisms.
I didn't try to replicate that.

llvm-svn: 169032
2012-11-30 20:23:19 +00:00
Enrico Granata 69ea91b402 <rdar://problem/12676084> Dump the traceback when a Python error occurs in "command script import" and the exception is not an ImportError
llvm-svn: 169031
2012-11-30 20:15:16 +00:00
Greg Clayton 1c5f186f30 Added new options to "target create" and "target modules add".
For "target create" you can now specify "--no-dependents" to not track down and add all dependent shared libraries. This can be handy when doing manual symbolication. Also added the "--symfile" or "-s" for short so you can specify a module and a stand alone debug info file:

(lldb) target create --symfile /tmp/a.dSYM /usr/bin/a

Added the "--symfile" option to the "target modules add" for the same reason. These all help with manualy symbolication and expose functionality that was previously only available through the public API layer.

llvm-svn: 169023
2012-11-30 19:05:35 +00:00
Greg Clayton 50a24bd358 <rdar://problem/12687087>
Emit an error when using "target modules add PATH" where PATH points to a debug info only (dSYM) file.

Also added a "--uuid" option for "target modules add --uuid UUID" to locate and load a module by UUID if the host supports it.

llvm-svn: 168949
2012-11-29 22:16:27 +00:00
Han Ming Ong 929a94f026 <rdar://problem/12780259>
Prevent async and sync calls to get profile data from stomping on each other.
At the same time, don't use '$' as end delimiter per chunk of profile data.

llvm-svn: 168948
2012-11-29 22:14:45 +00:00
Daniel Malea d01b2953fa Resolve printf formatting warnings on Linux:
- use macros from inttypes.h for format strings instead of OS-specific types

Patch from Matt Kopec!

llvm-svn: 168945
2012-11-29 21:49:15 +00:00
Greg Clayton e1e835c626 <rdar://problem/12655594>
Be sure to resolve the file path for the "target.process.python-os-plugin-path" setting.

llvm-svn: 168916
2012-11-29 18:48:47 +00:00
Greg Clayton 1eb0edcd97 <rdar://problem/12635804>
Add new rpath for LLDB: ../../Library/PrivateFrameworks

Also moved the debugserver plists into the Resources group.

llvm-svn: 168915
2012-11-29 18:40:38 +00:00
Daniel Malea c9449ad631 Match extern "C" in declaration and definition (swig template)
- Fix for building with gcc 4.6

llvm-svn: 168901
2012-11-29 16:38:44 +00:00
Greg Clayton 75a0333bf8 <rdar://problem/12445557>
Make stack frames fix up their line table entries when the target has source remappings. Also rearranged how the m_sc.target_sp was filled in so it can be used during the StackFrame::GetSymbolContext(...) function.

llvm-svn: 168845
2012-11-29 00:53:06 +00:00
Sean Callanan ea09a44ceb Don't return decorated (i.e., const or pointer)
versions of UnknownAnyTy for ObjectiveC value types.
<unknown type>* makes no sense and can cause the
parser to behave very oddly.

<rdar://problem/12518999>

llvm-svn: 168844
2012-11-29 00:50:56 +00:00
Jim Ingham 8c3f2764fb Add an example of using the target.process.extra-startup-command to turn on debugserver logging since
we always forget how to do this...

llvm-svn: 168840
2012-11-29 00:41:12 +00:00
Jim Ingham 7730b9a47a Tighten up how we acquire the underlying frame in the SBFrame methods. We were getting
the frame and then getting the run lock.  Which means that our frame could have gotten
invalidated by stopping between the time we got the frame and assured the the target was
stopped.  Now we get the run lock first, and THEN resolve the underlying frame object.

<rdar://problem/12621607>

llvm-svn: 168838
2012-11-29 00:26:19 +00:00
Daniel Malea e812109868 Rename __lambda to __lambda_node (apply r164404 from libcxxabi)
- fixes gcc 4.6 build problems
- resolves open bugzilla http://llvm.org/bugs/show_bug.cgi?id=13889

llvm-svn: 168835
2012-11-29 00:05:50 +00:00
Jason Molenda b8e5c79af1 Correct the label for the com.apple.debugserver.posix plist.
<rdar://problem/12769073> 

llvm-svn: 168834
2012-11-29 00:01:49 +00:00
Daniel Malea 16e126c70b Linux buildbot fix: detect swig tool from PATH in shell script (before searching hardcoded directories)
llvm-svn: 168831
2012-11-28 23:49:11 +00:00
Daniel Malea 9bbc8da517 Add 'class' keyword to friend definition (to fix gcc 4.6 build)
llvm-svn: 168827
2012-11-28 23:20:22 +00:00
Jim Ingham 75f27e8610 Cleanup - remove declarations of unimplemented functions.
llvm-svn: 168807
2012-11-28 20:09:03 +00:00
Sean Callanan c83e341075 If Clang is looking for an Objective-C method on
a type, and we find it in the origin for that
type, don't look anywhere else; just report it.

<rdar://problem/12675970>

llvm-svn: 168766
2012-11-28 03:23:20 +00:00