summaryrefslogtreecommitdiffstats
path: root/lldb
Commit message (Collapse)AuthorAgeFilesLines
* Fixed debugserver to properly attach to a process by name with the Greg Clayton2010-10-1810-92/+163
| | | | | | | | | | | | | | | | | | | "vAttachName;<PROCNAME>" packet, and wait for a new process by name to launch with the "vAttachWait;<PROCNAME>". Fixed a few issues with attaching where if DoAttach() returned no error, yet there was no valid process ID, we would deadlock waiting for an event that would never happen. Added a new "process launch" option "--tty" that will launch the process in a new terminal if the Host layer supports the "Host::LaunchInNewTerminal(...)" function. This currently works on MacOSX and will allow the debugging of terminal applications that do complex operations with the terminal. Cleaned up the output when the process resumes, stops and halts to be consistent with the output format. llvm-svn: 116693
* Added a new Host call to find LLDB related paths:Greg Clayton2010-10-1715-114/+834
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | static bool Host::GetLLDBPath (lldb::PathType path_type, FileSpec &file_spec); This will fill in "file_spec" with an appropriate path that is appropriate for the current Host OS. MacOSX will return paths within the LLDB.framework, and other unixes will return the paths they want. The current PathType enums are: typedef enum PathType { ePathTypeLLDBShlibDir, // The directory where the lldb.so (unix) or LLDB mach-o file in LLDB.framework (MacOSX) exists ePathTypeSupportExecutableDir, // Find LLDB support executable directory (debugserver, etc) ePathTypeHeaderDir, // Find LLDB header file directory ePathTypePythonDir // Find Python modules (PYTHONPATH) directory } PathType; All places that were finding executables are and python paths are now updated to use this Host call. Added another new host call to launch the inferior in a terminal. This ability will be very host specific and doesn't need to be supported on all systems. MacOSX currently will create a new .command file and tell Terminal.app to open the .command file. It also uses the new "darwin-debug" app which is a small app that uses posix to exec (no fork) and stop at the entry point of the program. The GDB remote plug-in is almost able launch a process and attach to it, it currently will spawn the process, but it won't attach to it just yet. This will let LLDB not have to share the terminal with another process and a new terminal window will pop up when you launch. This won't get hooked up until we work out all of the kinks. The new Host function is: static lldb::pid_t Host::LaunchInNewTerminal ( const char **argv, // argv[0] is executable const char **envp, const ArchSpec *arch_spec, bool stop_at_entry, bool disable_aslr); Cleaned up FileSpec::GetPath to not use strncpy() as it was always zero filling the entire path buffer. Fixed an issue with the dynamic checker function where I missed a '$' prefix that should have been added. llvm-svn: 116690
* prefix more stuff with '$' to make sure we don't go trying to lookup anythingGreg Clayton2010-10-161-5/+5
| | | | | | we don't need to. llvm-svn: 116676
* Fixed an issue with MachTask::TaskResume () where if the task was alreadyGreg Clayton2010-10-161-2/+6
| | | | | | | suspended, we would call "int ::task_resume (task_t task);" as many times as it took to resume the task which isn't what we want to do. llvm-svn: 116674
* Missed this spot where module.cleanup() can be passed a test instance toJohnny Chen2010-10-161-1/+1
| | | | | | | facilitate session recording. This happens inside an instance method where the test instance is well known. llvm-svn: 116649
* Some re-achitecturing of the plugins interface. The caller is now required toJohnny Chen2010-10-153-76/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pass in a 'sender' arg to the buildDefault(), buildDsym(), buildDwarf(), and cleanup() functions. The sender arg will be the test instance itself (i.e., an instance of TestBase). This is so that the relevant command execution can be recorded in the TestBase.session object if sender is available. The lldbtest.system() command has been modified to pop the 'sender' arg out of the keyword arguments dictionary and use it as the test instance to facilitate seesion recordings. An example is in test/types/AbstractBase.py: def generic_type_tester(self, atoms, quotedDisplay=False): """Test that variables with basic types are displayed correctly.""" # First, capture the golden output emitted by the oracle, i.e., the # series of printf statements. go = system("./a.out", sender=self) There are cases when sender is None. This is the case when the @classmethod is involved in the use of these APIs. When this happens, there is no recording into a session object, but printing on the sys.stderr is still honored if the trace flag is ON. An example is in test/settings/TestSettings.py: @classmethod def classCleanup(cls): system(["/bin/sh", "-c", "rm -f output.txt"]) system(["/bin/sh", "-c", "rm -f stdout.txt"]) llvm-svn: 116648
* Use line_number() utility function to find the number from main.c to test ↵Johnny Chen2010-10-152-3/+7
| | | | | | | | against instead of using hard-coded line number. llvm-svn: 116646
* Remove the @expectedFailure decorators, as rdar://problem/8542091 is ↵Johnny Chen2010-10-151-4/+3
| | | | | | | | supposed to be fixed. Also change the expected matching pattern of the 'expr -o -- my' output. llvm-svn: 116645
* Don't wrap StringIO inside a with statement. It is not a context manager.Johnny Chen2010-10-151-7/+5
| | | | llvm-svn: 116643
* Fixed the UnixSignals class to be able to get a signal by name, short name, ↵Greg Clayton2010-10-152-52/+25
| | | | | | | | or signal number when using: int32_t UnixSignals::GetSignalNumberFromName (const char *name) const; llvm-svn: 116641
* Use the ValueObject directly where possible.Jim Ingham2010-10-151-1/+1
| | | | llvm-svn: 116638
* Made many ConstString functions inlined in the header file.Greg Clayton2010-10-1522-501/+539
| | | | | | | | | | | | | | | | | | | Changed all of our synthesized "___clang" functions, types and variables that get used in expressions over to have a prefix of "$_lldb". Now when we do name lookups we can easily switch off of the first '$' character to know if we should look through only our internal (when first char is '$') stuff, or when we should look through program variables, functions and types. Converted all of the clang expression code over to using "const ConstString&" values for names instead of "const char *" since there were many places that were converting the "const char *" names into ConstString names and them throwing them away. We now avoid making a lot of ConstString conversions and benefit from the quick comparisons in a few extra spots. Converted a lot of code from LLVM coding conventions into LLDB coding conventions. llvm-svn: 116634
* Mark a ValueObjectConstResult as valid if it is created with some data, ↵Jim Ingham2010-10-151-0/+1
| | | | | | don't wait till it gets updated. llvm-svn: 116633
* Disable "process.macosx" plugin, since it is not being actively supportedCaroline Tice2010-10-152-3/+3
| | | | | | at the moment, and no longer works properly (bit rot). llvm-svn: 116626
* Make sure to close the string buffer when finished.Johnny Chen2010-10-151-5/+7
| | | | llvm-svn: 116621
* Remove the @skip("Skip due to deadlock?") decorators. Change the command toJohnny Chen2010-10-151-3/+1
| | | | | | | | 'breakpoint delete 1' from 'breakpoint delete'. With 'breakpoint delete', the command interpreter was asking for a confirmation from the user, which there isn't any. llvm-svn: 116610
* Add two @expectedFailure decorators for:Johnny Chen2010-10-151-0/+6
| | | | | | | # rdar://problem/8557478 # test/class_types test failures: runCmd: expr this->m_c_int llvm-svn: 116609
* Add a test case for exercising breakpoint conditions using the lldb command:Johnny Chen2010-10-154-1/+125
| | | | | | | | | | | | | breakpoint modify -c 'val == 3' 1 after: breakpoint set -n c which sets a breakpoint on function 'c'. The breakpoint should only stop if expression 'val == 3' evaluates to true. llvm-svn: 116607
* Add a const string for assert message. Remove extra printing of newlines fromJohnny Chen2010-10-151-5/+2
| | | | | | the session recordings. llvm-svn: 116596
* There's no need to explicitly call lldb.SBDebugger.Initialize() now. It is doneJohnny Chen2010-10-151-3/+0
| | | | | | when importing the lldb module. llvm-svn: 116585
* Add more comments.Johnny Chen2010-10-151-2/+5
| | | | llvm-svn: 116583
* Be more specific about cases whenthe runCmd() check flag is False, meaning thereJohnny Chen2010-10-151-0/+2
| | | | | | | is no need to check the return status of the command execution, and an error status is not deemed a failure in the test. llvm-svn: 116582
* Skip checking for a bunch of built-ins when evaluating an expression.Greg Clayton2010-10-152-14/+35
| | | | llvm-svn: 116565
* Did a bit of parameter renaming.Greg Clayton2010-10-153-28/+29
| | | | llvm-svn: 116562
* Added short names and descriptions to the UnixSignals class. Also cleaned upGreg Clayton2010-10-152-131/+119
| | | | | | the code a bit. llvm-svn: 116561
* Simply use the TestBase.markFailure() callback method to set the __failed__ ↵Johnny Chen2010-10-152-5/+8
| | | | | | flag. llvm-svn: 116559
* Separated the DWARF index for types from that the index of the namespacesGreg Clayton2010-10-154-8/+19
| | | | | | | | | | | since we can't parse DW_TAG_namespace DIEs as types. They are only decls in clang. All of the types we handle right now have both clang "XXXType" classes to go with the "XXXDecl" classes which means they can be used within the lldb_private::Type class. I need to check to see which other decls that don't have associated type objects need to float around the debugger and possibly make a lldb_private::Decl class to manage them. llvm-svn: 116558
* This is an initial version of test driver enhanceent to be able to dump theJohnny Chen2010-10-154-36/+137
| | | | | | | | | | | | | | | | | | | | | | | | | | | | session info after a test case failure, allowing more direct inspection of debugger session which leads to the test failure. For a simple usage scenario: [18:06:26] johnny:/Volumes/data/lldb/svn/trunk/test $ ./dotest.py -v . 2> ~/Developer/Log/lldbtest.log ... [18:14:43] johnny:/Volumes/data/lldb/svn/trunk/test $ ls -l .session-* -rw-r--r-- 1 johnny admin 1359 Oct 14 18:06 .session-TestArrayTypes.ArrayTypesTestCase.test_with_dwarf_and_run_command -rw-r--r-- 1 johnny admin 2054 Oct 14 18:07 .session-TestClassTypes.ClassTypesTestCase.test_with_dsym_and_expr_parser -rw-r--r-- 1 johnny admin 2055 Oct 14 18:07 .session-TestClassTypes.ClassTypesTestCase.test_with_dwarf_and_expr_parser -rw-r--r-- 1 johnny admin 1351 Oct 14 17:57 .session-TestClassTypes.ClassTypesTestCase.test_with_dwarf_and_run_command [18:14:51] johnny:/Volumes/data/lldb/svn/trunk/test $ The test case which failed will have its recorded session info dumped to a .session-* file in the current working directory. For test suite using relocated directory, expect to find the .session-* files there. In this checkin, I also add @skip decorator to the two test methods in test/foundation/TestObjCMethods.py as it looks like the test suite is deadlocking when running the tests. More investigations are needed. llvm-svn: 116552
* Added support for breakpoint conditions. I also had to separate the "run ↵Jim Ingham2010-10-1426-129/+760
| | | | | | | | the expression" part of ClangFunction::Execute from the "Gather the expression result" so that in the case of the Breakpoint condition I can move the condition evaluation into the normal thread plan processing. Also added support for remembering the "last set breakpoint" so that "break modify" will act on the last set breakpoint. llvm-svn: 116542
* Fixed an expression parsing issue where if you were stopped somewhere withoutGreg Clayton2010-10-1420-191/+478
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | debug information and you evaluated an expression, a crash would occur as a result of an unchecked pointer. Added the ability to get the expression path for a ValueObject. For a rectangle point child "x" the expression path would be something like: "rect.top_left.x". This will allow GUI and command lines to get ahold of the expression path for a value object without having to explicitly know about the hierarchy. This means the ValueObject base class now has a "ValueObject *m_parent;" member. All ValueObject subclasses now correctly track their lineage and are able to provide value expression paths as well. Added a new "--flat" option to the "frame variable" to allow for flat variable output. An example of the current and new outputs: (lldb) frame variable argc = 1 argv = 0x00007fff5fbffe80 pt = { x = 2 y = 3 } rect = { bottom_left = { x = 1 y = 2 } top_right = { x = 3 y = 4 } } (lldb) frame variable --flat argc = 1 argv = 0x00007fff5fbffe80 pt.x = 2 pt.y = 3 rect.bottom_left.x = 1 rect.bottom_left.y = 2 rect.top_right.x = 3 rect.top_right.y = 4 As you can see when there is a lot of hierarchy it can help flatten things out. Also if you want to use a member in an expression, you can copy the text from the "--flat" output and not have to piece it together manually. This can help when you want to use parts of the STL in expressions: (lldb) frame variable --flat argc = 1 argv = 0x00007fff5fbffea8 hello_world._M_dataplus._M_p = 0x0000000000000000 (lldb) expr hello_world._M_dataplus._M_p[0] == '\0' llvm-svn: 116532
* Modify "process handle" so that if no signals are specified it lists/updates ↵Caroline Tice2010-10-141-47/+113
| | | | | | | | | | them all, if no update commands are specified it just lists the current values, and show that it always shows the new values for a signal after it has been updated. Also updated the help text to match the new functionality. llvm-svn: 116520
* Make calling the super class's setUp() method less fragile.Johnny Chen2010-10-1417-17/+34
| | | | llvm-svn: 116490
* Wrap the file writing operations inside a with statement to simplify code.Johnny Chen2010-10-141-11/+3
| | | | llvm-svn: 116486
* Change the call within lldb.py to 'SBDebugger.Initialize()' from ↵Johnny Chen2010-10-142-2/+7
| | | | | | | | | | | | 'lldb.SBDebugger.Initialize()'. Inside the lldb module, there's no need (and as a matter of fact, incorrect) to specify the 'lldb' module name. Comment out the call to lldb.SBDebugger.Initialize() within the test driver itself, since it is already done when we import the lldb.py module. llvm-svn: 116485
* Add more comments and wait a little bit after resuming the inferior process ↵Johnny Chen2010-10-141-1/+10
| | | | | | | | before sending it a signal. llvm-svn: 116481
* Add an initial version of test that exercise the lldb commands: 'process signal'Johnny Chen2010-10-143-6/+79
| | | | | | | | | | | | and 'process handle'. The test suite would like to control the asynch/sync execution of the interpreter during the middle of the test method, so the CommandInterpreter::SetSynchronous(bool value) is modified to allow the mode to be changed more than once. In practice, it would be advisable to control the process and to set the async/sync mode from a single thread, too. llvm-svn: 116467
* Fix a regression introduced in r116430 with the added 'break' statement,Johnny Chen2010-10-141-1/+1
| | | | | | | | which broke test/breakpoint_locations. Add a comment about intentional fall-through in the case statement. llvm-svn: 116463
* Add new argument type, eArgSignalName,Caroline Tice2010-10-134-0/+243
| | | | | | | | | | | Add missing break statment to case statement in Process::ShouldBroadcastEvent. Add new command, "process handle" to allow users to control process behavior on the receipt of various Unix signals (whether the process should stop; whether the process should be passed the signal; whether the debugger user should be notified that the signal came in). llvm-svn: 116430
* Fix these comments and the commented out code about 'frame variable -t', too.Johnny Chen2010-10-131-5/+5
| | | | llvm-svn: 116420
* Apply (query-replace "frame variable" "frame variable -t") and fix a comment ↵Johnny Chen2010-10-1311-33/+33
| | | | | | | | about 'expr var', not 'frame variable var'. llvm-svn: 116419
* Default "frame variable" to not show types before values by default. You now ↵Greg Clayton2010-10-131-3/+3
| | | | | | enable type display with --show-types or -t (instead of disabling it with --no-types or -t). llvm-svn: 116418
* Add a test case for the test/forward directory with @expectedFailure decoratorJohnny Chen2010-10-131-0/+64
| | | | | | for test_with_dwarf_and_run_command(self). llvm-svn: 116416
* Fixed C++ class clang type creation and display by making sure we omit Greg Clayton2010-10-1310-124/+237
| | | | | | | | | | | | | | | | | | | | | | | | | | | artifical members (like the vtable pointer member that shows up in the DWARF). We were adding this to each class which was making all member variables be off by a pointer size. Added a test case so we can track this with "test/forward". Fixed the type name index in DWARF to include all the types after finding some types were being omitted due to the DW_AT_specification having the DW_AT_declaration attribute which was being read into the real type instances when there were forward declarations in the DWARF, causing the type to be omitted. We now check to make sure any DW_AT_declaration values are only respected when parsing types if the attribute is from the current DIE. After fixing the missing types, we ran into some issues with the expression parser finding duplicate entries for __va_list_tag since they are built in types and would result in a "duplicate __va_list_tag definition" error. We are now just ignoring this name during lookup, but we will need to see if we can get the name lookup function to not get called in these cases. Fixed an issue that would cause an assertion where DW_TAG_subroutine_types that had no children, would not properly make a clang function type of: "void (*) (void)". llvm-svn: 116392
* Avoid using hardcoded line number to break on. Use the line_number() utilityJohnny Chen2010-10-122-20/+39
| | | | | | | | | | | | | | | | | function to get the line numbers for breakpoints 1-5 during setUp(). Use a pattern to match the output from both gcc-compiled and clang-compiled binary. This finishes the conversion of the test suite to avoid hardcoded line numbers when setting breakpoints with either the lldb command: breakpoint set -f filename -l lineno or the Python API: target.BreakpointCreateByLocation(filename, lineno) llvm-svn: 116378
* Avoid using hardcoded line number to break on. Use the line_number() utilityJohnny Chen2010-10-122-5/+12
| | | | | | | | function to get the line number to break on during setUp(). Use a pattern to match the output from both gcc-compiled and clang-compiled binary. llvm-svn: 116374
* Avoid using hardcoded line number to break on. Use the line_number() utilityJohnny Chen2010-10-122-6/+15
| | | | | | | function to get the line number to break on as well as the line number of the first executable statement during setUp(). llvm-svn: 116369
* Avoid using hardcoded line number to break on. Use the line_number() utilityJohnny Chen2010-10-121-2/+13
| | | | | | function to get the line number to break on during setUp(). llvm-svn: 116363
* Update the comment with reagard to a bug filed against possible clang-generatedJohnny Chen2010-10-121-0/+4
| | | | | | debug info which results in the breakpoint locations of 3, instead of 1 (as in gcc). llvm-svn: 116361
* Avoid using hardcoded line number to break on. Use the line_number() utilityJohnny Chen2010-10-122-4/+11
| | | | | | function to get the line number to break on during setUp(). llvm-svn: 116358
* Comment out code that was preventing commands that take raw input stringsCaroline Tice2010-10-121-9/+9
| | | | | | from being alias-able. llvm-svn: 116357
OpenPOWER on IntegriCloud