summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/common
Commit message (Collapse)AuthorAgeFilesLines
...
* EOF is outside the value range of char on architectures with unsignedJoerg Sonnenberger2014-05-021-1/+1
| | | | | | char like ARM. Check for EOF explicitly. llvm-svn: 207859
* Fixed CTRL+C related issues:Greg Clayton2014-05-021-27/+65
| | | | | | | | | | | | - CTRL+C wasn't clearing the command in lldb - CTRL+C doesn't work in python macros in lldb - Ctrl+C no longer interrupts the running process that you attach to <rdar://problem/15949205> <rdar://problem/16778652> <rdar://problem/16774411> llvm-svn: 207816
* Since one or more Editline instances of the same kind (lldb commands, ↵Greg Clayton2014-04-251-57/+157
| | | | | | | | expressions, etc) can exist at once, they should all shared a ref counted history object. Now they do. llvm-svn: 207293
* Change the default key bindings for multi-line mode:Greg Clayton2014-04-231-2/+3
| | | | | | | Up/down arrows select next/prev line in multi-line mode CTRL+N and CTRL+P do next/prev history llvm-svn: 207033
* Fixed a case where if someone added a "bind -v" to their ~/.editrc file, key ↵Greg Clayton2014-04-231-6/+18
| | | | | | | | | | mappings would get messed up. I fixed this by only doing el_set(e, EL_BIND, ...) calls before sourcing the .editrc files. <rdar://problem/16614095> llvm-svn: 207005
* sweep up -Wformat warnings from gccSaleem Abdulrasool2014-04-041-11/+7
| | | | | | | This is a purely mechanical change explicitly casting any parameters for printf style conversion. This cleans up the warnings emitted by gcc 4.8 on Linux. llvm-svn: 205607
* Use getpgid() with waitpid() in case the process pgid is not equal to its ↵Andrew MacPherson2014-04-021-1/+1
| | | | | | pid, as is the case with a forked subprocess. Also a couple of fixes for unit test failures from Todd Fiala. llvm-svn: 205405
* sanitise sign comparisonsSaleem Abdulrasool2014-04-022-6/+8
| | | | | | | | This is a mechanical change addressing the various sign comparison warnings that are identified by both clang and gcc. This helps cleanup some of the warning spew that occurs during builds. llvm-svn: 205390
* Add mips64 to the list of 64-bit Host architecturesEd Maste2014-04-011-0/+1
| | | | llvm-svn: 205333
* lldb arm64 import.Jason Molenda2014-03-291-2/+2
| | | | | | | | | | | | | | | | These changes were written by Greg Clayton, Jim Ingham, Jason Molenda. It builds cleanly against TOT llvm with xcodebuild. I updated the cmake files by visual inspection but did not try a build. I haven't built these sources on any non-Mac platforms - I don't think this patch adds any code that requires darwin, but please let me know if I missed something. In debugserver, MachProcess.cpp and MachTask.cpp were renamed to MachProcess.mm and MachTask.mm as they picked up some new Objective-C code needed to launch processes when running on iOS. llvm-svn: 205113
* Add the "lldb_complete" .editrc command back in case veteran users of LLDB ↵Greg Clayton2014-03-261-1/+2
| | | | | | | | had .editrc key mappings in their ~/.editrc. <rdar://problem/16279283> llvm-svn: 204870
* JITed functions can now have debug info and be debugged with debug and ↵Greg Clayton2014-03-241-3/+66
| | | | | | | | | | | | | | | | | | | source info: (lldb) b puts (lldb) expr -g -i0 -- (int)puts("hello") First we will stop at the entry point of the expression before it runs, then we can step over a few times and hit the breakpoint in "puts", then we can continue and finishing stepping and fininsh the expression. Main features: - New ObjectFileJIT class that can be easily created for JIT functions - debug info can now be enabled when parsing expressions - source for any function that is run throught the JIT is now saved in LLDB process specific temp directory and cleaned up on exit - "expr -g --" allows you to single step through your expression function with source code <rdar://problem/16382881> llvm-svn: 204682
* cleanup unreferenced functionsSaleem Abdulrasool2014-03-201-5/+0
| | | | | | | | | | | | | This is a mechanical cleanup of unused functions. In the case where the functions are referenced (in comment form), I've simply commented out the functions. A second pass to clean that up is warranted. The functions which are otherwise unused have been removed. Some of these were introduced in the initial commit and not in use prior to that point! NFC llvm-svn: 204310
* Replace some Windows specific string functions with std::string.Hafiz Abid Qadeer2014-03-121-4/+3
| | | | llvm-svn: 203654
* Moved a check in HostGetOpt.h.Hafiz Abid Qadeer2014-03-121-4/+0
| | | | | | It can be used in multiple files now. llvm-svn: 203652
* Replace some _MSC_VER with _WIN32.Hafiz Abid Qadeer2014-03-122-2/+2
| | | | | | | This allows to use some code for mingw which was previously only used for MSVC. llvm-svn: 203651
* Fix Mingw build error by using lower case name for windows header files.Hafiz Abid Qadeer2014-03-101-1/+1
| | | | llvm-svn: 203505
* Allow line numbers to be shown in multi-line expressions.Greg Clayton2014-03-071-0/+1
| | | | llvm-svn: 203185
* Check if the terminal is interactive and set the flags accordinglyDeepak Panickal2014-03-031-1/+7
| | | | llvm-svn: 202726
* Check call to fgetc for EINTR.Jim Ingham2014-02-271-20/+31
| | | | | | <rdar://problem/16140277> llvm-svn: 202426
* There’s no need to call posix_spawnp_setbinpref_np when we are launching ↵Jim Ingham2014-02-211-18/+25
| | | | | | | | in the shell. That only sets the architecture of the shell, we use “arch —arch” to actually pick the binary we actually want to launch’s architecture. <rdar://problem/16103187> llvm-svn: 201831
* Fix Windows build, broken by the inclusion of sys/ioctl.h and isatty()Deepak Panickal2014-02-171-1/+4
| | | | llvm-svn: 201522
* Fix the LLDB prompt for older Editline versions, specifically running on ↵Deepak Panickal2014-02-171-0/+5
| | | | | | Ubuntu 12.04 llvm-svn: 201521
* Avoid leaking namebuf in case of an early exitEnrico Granata2014-02-121-7/+5
| | | | llvm-svn: 201206
* Host: unconstify editline paramtersSaleem Abdulrasool2014-02-101-4/+8
| | | | | | | | | | | | | | 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
* Only set EL_PROMPT_ESC when existing - fix typoSylvestre Ledru2014-02-081-1/+1
| | | | llvm-svn: 201024
* Only set EL_PROMPT_ESC when existingSylvestre Ledru2014-02-081-0/+2
| | | | llvm-svn: 201023
* Fixed an issue where "command source" would not do the right thing:Greg Clayton2014-02-051-3/+52
| | | | | | | - empty lines in init files would repeat previous command and cause errors to be displayed - all options to control showing the command, its output, if it should stop on error or continue, weren't being obeyed. llvm-svn: 200860
* Fixing the Windows build for the changes brought in from the iohandler merge.Deepak Panickal2014-01-311-6/+2
| | | | llvm-svn: 200565
* Pressing ^D in a non-empty input terminates LLDB. This was due to the fact ↵Greg Clayton2014-01-301-1/+15
| | | | | | | | that we stack more than one editline instance on top of each other and we still expect CTRL+D to exit the editline instance, but it should only do so when the line is empty. Otherwise it should (and does) delete the character at the cursor. <rdar://problem/15944703> llvm-svn: 200489
* Merging the iohandler branch back into main. Greg Clayton2014-01-273-27/+721
| | | | | | | | | | | | The many many benefits include: 1 - Input/Output/Error streams are now handled as real streams not a push style input 2 - auto completion in python embedded interpreter 3 - multi-line input for "script" and "expression" commands now allow you to edit previous/next lines using up and down arrow keys and this makes multi-line input actually a viable thing to use 4 - it is now possible to use curses to drive LLDB (please try the "gui" command) We will need to deal with and fix any buildbot failures and tests and arise now that input/output and error are correctly hooked up in all cases. llvm-svn: 200263
* Candidate fix for bug 18592.Todd Fiala2014-01-231-1/+1
| | | | | | | | | This reverts Host.cpp LaunchProcess spawn behavior on FreeBSD to be like Linux (and unlike OS X) with regards to how default signal handlers and setup on the spawned process. FreeBSD does not reset default signal handlers on the spawned process after this change. llvm-svn: 199908
* Unify OS X/POSIX/Linux Host spawn support.Todd Fiala2014-01-231-66/+232
| | | | | | | | | | | | | | | This fixes a bug under Linux where spawning a process via Host::LaunchProcess was disabling all blockable signals on the launched process. This caused strange behavior when attempting to kill the lldb-gdbserver process, as the child generally would not die unless killed with a non-blockable signal (e.g. 'kill -9'). This change moves several functions out of macosx/Host.mm into common/Host.cpp. In addition, two functions that needed to work across common/Host.cpp and macosx/Host.mm were moved into the Host.h header file. llvm-svn: 199856
* Make lldb build with Makefiles on OS X.Todd Fiala2014-01-181-10/+14
| | | | | | | | | | | | | | | | | | This change does the following: * Adds Makefile build scripts to debug server. * Fixes a few small mistakes in the other makefiles. * Modifies generate-vers.pl slightly to also work for debugserver. * Changes the OS X, non-framework python search path from libdir to libdir/python2.X/site-packages where it is installed by the build system (also where it is installed on other operating systems). Patch by Keno Fischer. llvm-svn: 199543
* Added distribution info to ArchSpec and qHostInfo message.Todd Fiala2014-01-181-0/+6
| | | | | | | | | | | | | | | | | | | ArchSpec now contains an optional distribution_id, with getters and setters. Host::GetArchitecture () sets it on non-Apple platforms using Host::GetDistributionId (). The distribution_id is ignored during ArchSpec comparisons. The gdb remote qHostInfo message transmits it, if set, via the distribution_id={id-value} key/value pair. Updated gdb remote docs to reflect this change. As before, GetDistributionId () returns nothing on non-Linux platforms at this time. On Linux, it is returned only if the lsb_platform command is installed (in /bin or /usr/bin), and only if the distributor id key is returned by 'lsb_platform -i'. This id is lowercased, and whitespace is replaced with underscores. llvm-svn: 199539
* Undo change to triple behavior from r199510.Todd Fiala2014-01-171-7/+1
| | | | | | | | | The Linux distribution will be added to the ArchSpec class in an upcoming change. This change only undoes the change to the triple. The distribution retrieval logic and enabling of lldb-gdbserver for linux x86_64 builds is still in place. llvm-svn: 199520
* Enable Linux distribution in vendor portion of host triple.Todd Fiala2014-01-171-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change does the following: * enables building lldb-gdbserver on linux_x86-64 platforms. Note - it builds but it has several run-time issues where many gdb remote protocol features are not properly implemented yet. I'm working on these one at a time. * lldb-gdbserver: does not enable the eLaunchFlagDebug launch flag on Linux. Currently the POSIX launch routine will assert if that flag is passed in, presumably because that launch mode is not yet available. This prevents lldb-gdbserver from asserting the moment it launches the debuggee process. * Adds ConstString& Host::GetDistributionId () This method is defined to return an empty result on all platforms except for Linux. On Linux, it makes one attempt to execute 'lsb_release -i' (both /usr/bin/lsb_release, where it appears on ubuntu, and /bin/lsb_release, where it appears on fedora if the redhat-lsb package is installed). If lsb_release is not found in either of those locations, or if 'lsb_release -i' does not return the first line starting with "Distributor ID:\t", then the distribution id is empty. The method will lower-case the id and replace whitespace with underscores. * Modify Host::GetArchitecture () so that linux replaces an unknown vendor portion with the results of GetDistributionId () if that is non-empty. This shows up now in qHostInfo remote packet responses and on the lldb host side. Tested with ubuntu and fedora (the latter both with the default of not having lsb_release installed, and with having lsb_release installed via the redhat-lsb package). Examples of triples on Linux after this change: # x86_64 Unbuntu 12.04 LTS: x86_64-ubuntu-linux-gnu # x86_64 Fedora 20 Desktop with redhat-lsb package installed x86_64-fedora-linux-gnu # x86_64 Fedora 20 Desktop without redhat-lsb-core installed # (i.e. no /bin/lsb_release available) # same as before the change x86_64--linux-gnu Note I intend to have Android respond with: {arch}-android-linux when I get to implementing Android lldb-gdbserver support. llvm-svn: 199510
* Fixed the Visual Studio Windows buildDeepak Panickal2014-01-131-1/+1
| | | | llvm-svn: 199111
* Fixes an issue where a signum => name mapping function has multiple case ↵Sylvestre Ledru2013-12-131-0/+4
| | | | | | | | | statements that define to the same integral value on my Linux (Ubuntu 12.04, x86_64). It's for SIGIO and SIGPOLL. In the case that they are both defined the same. Patch by Todd Fiala (but typos are mine) llvm-svn: 197221
* Don't try to guess sys header conditions, and simply check if each signal is ↵Jean-Daniel Dupas2013-12-121-4/+6
| | | | | | | | | | defined. CC: lldb-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2394 llvm-svn: 197173
* FreeBSD and NetBSD have sa_len in struct sockaddrEd Maste2013-12-091-2/+2
| | | | llvm-svn: 196790
* Fix Debian GNU/kFreeBSD buildEd Maste2013-12-091-1/+1
| | | | | | Use the same LaunchProcessPosixSpawn as on FreeBSD and Linux. llvm-svn: 196742
* Replace all in_port_t with uint16_t to avoid compilation issues on different ↵Greg Clayton2013-12-061-4/+4
| | | | | | systems. llvm-svn: 196586
* Typo in commentsJean-Daniel Dupas2013-12-061-1/+1
| | | | llvm-svn: 196577
* Modified local spawning in debugserver processes to use a new ↵Greg Clayton2013-12-051-21/+47
| | | | | | | | | | | | | | | | | | --reverse-connect option so that debugserver actually connects back to LLDB instead of LLDB connecting to debugserver. This gets rid of our hacky "get_random_port()" which would grab a random port and tell debugserver to open that port. Now LLDB creates, binds, listens and accepts a connection by binding to port zero and sending the correctly bound port down as the host:port to connect back to. Fixed the "ConnectionFileDescriptor" to be able to correctly listen for connections from a specified host, localhost, or any host. Prior to this fix "listen://" only accepted the following format: listen://<port> But now it can accept: listen://<port> // Listen for connection from localhost on port <port> listen://<host>:<port> // Listen for connection from <host> and <port> listen://*:<port> // Listen for connection from any host on port <port> llvm-svn: 196547
* Added a new directory type for the "bool Host::GetLLDBPath (PathType ↵Greg Clayton2013-12-041-4/+43
| | | | | | | | | | path_type, FileSpec &file_spec)" function: ePathTypeLLDBTempSystemDir This will get the temporary directory on the current system. Removed a call to tmpnam() and replaced it with a call to mktemp() using a template that will be in the temp directory. llvm-svn: 196397
* Fix MSVC buildColin Riley2013-11-262-7/+9
| | | | | | Added _WIN32 guards to new platform features. Using correct SetErrorStringWithFormat within Host when LLDB_DISABLE_POSIX is defined. Also fixed an if defined block. llvm-svn: 195766
* Correct a standalone debug file pathEd Maste2013-11-251-4/+4
| | | | | | | | | | | | For a file /bin/ls with a .gnu_debuglink entry of "ls.debug" the path should be /usr/lib/debug/bin/ls.debug, not /usr/lib/debug/bin/ls. ref: https://sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html llvm.org/pr17903 http://llvm-reviews.chandlerc.com/D2169 llvm-svn: 195681
* Removed printf and puts calls that were left in accidentally.Greg Clayton2013-11-231-13/+0
| | | | llvm-svn: 195542
* Improved platform support.Greg Clayton2013-11-232-5/+100
| | | | | | | | | | | | Improved the detection of a valid GDB server where we actually can connect to a socket, but then it doesn't read or write anything (which happens with some USB mux software). Host::MakeDirectory() now can make as many intermediate directories as needed. The testsuite now has very initial support for remote test suite running. When running on a remote platform, the setUp function for the test will make a new directory and select it as the working directory on the remote host. Added a common function that can be used to create the short option string for getopt_long calls. llvm-svn: 195541
OpenPOWER on IntegriCloud