diff --git a/AUTHORS.md b/AUTHORS.md index 8ad0643..d35f237 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -1,9 +1,9 @@ # LLDBMI2 - An MI2 interface to LLDB -##Author +## Author Didier Bertrand -##Contributors -Eduard Matveev +## Contributors +Eduard Matveev (CMAKE) -Dmitriy Tarasov \ No newline at end of file +David Jenkins (Lazarus IDE) \ No newline at end of file diff --git a/README.md b/README.md index 5ad110c..52ca851 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ A simple MI interface to LLDB. +Usable with Eclipse IDE (C, C++) and Lazarus IDE (Pascal) + # Context Since Apple has withdrawn its support for GDB. The options to debug an application with CDT on Mac OS X are: @@ -10,7 +12,7 @@ Since Apple has withdrawn its support for GDB. The options to debug an applicati - Natural for Mac OS X, but limited for sharing projects or cross compiling on Linux or Windows. - Not adequate for multi language programs (eg: C with Java or Perl). 2. Install GNU GDB: - - Easy to install from H-mebrew or Macports. + - Easy to install from Homebrew or Macports. - Does not support Mac OS X dynamic libraries preventing from debugging code inside these libraries. 3. Install LLDB-MI: - This program is promising, but is not yet mature. diff --git a/src/engine.cpp b/src/engine.cpp index ab9cb03..1cdaf53 100755 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -220,7 +220,17 @@ fromCDT (STATE *pstate, const char *commandLine, int linesize) // from cdt if (strstr(cc.argv[nextarg],"%s")!=NULL) logprintf (LOG_VARS, "%%s -> %s\n", path); strlcpy (programpath, path, sizeof(programpath)); - target = pstate->debugger.CreateTargetWithFileAndArch (programpath, "x86_64"); + // check file type + int fd; + unsigned int magic = 0xfeedfacf; // x86_64 + if ((fd = open (programpath, O_RDONLY)) > 0) { + read (fd, (void *)&magic, sizeof(magic)); + close (fd); + } + if (magic==0xfeedface) + target = pstate->debugger.CreateTargetWithFileAndArch (programpath, "i386"); + else + target = pstate->debugger.CreateTargetWithFileAndArch (programpath, "x86_64"); if (!target.IsValid()) cdtprintf ("%d^error\n(gdb)\n", cc.sequence); else diff --git a/src/lldbmi2.cpp b/src/lldbmi2.cpp index 670536a..1550d80 100755 --- a/src/lldbmi2.cpp +++ b/src/lldbmi2.cpp @@ -25,8 +25,10 @@ void help (STATE *pstate) fprintf (stderr, "%s", pstate->lldbmi2Prompt); fprintf (stderr, "Description:\n"); fprintf (stderr, " A MI2 interface to LLDB\n"); - fprintf (stderr, "Author:\n"); - fprintf (stderr, " Didier Bertrand, 2015, 2016\n"); + fprintf (stderr, "Authors:\n"); + fprintf (stderr, " Didier Bertrand, 2015, 2016, 2018\n"); + fprintf (stderr, " Eduard Matveev, 2016\n"); + fprintf (stderr, " David Jenkins, 2018\n"); fprintf (stderr, "Syntax:\n"); fprintf (stderr, " lldbmi2 --version [options]\n"); fprintf (stderr, " lldbmi2 --interpreter mi2 [options]\n");