From e1b3e0a69418786771aa901891e27129614bf7c5 Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Tue, 2 Apr 2002 20:15:08 +0000 Subject: [PATCH] Added a primitive guess of the executable's language. --- kdbg/main.cpp | 2 +- kdbg/mainwndbase.cpp | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/kdbg/main.cpp b/kdbg/main.cpp index 8e96a26..8c23dcd 100644 --- a/kdbg/main.cpp +++ b/kdbg/main.cpp @@ -57,7 +57,7 @@ int main(int argc, char** argv) static KCmdLineOptions options[] = { { "t ", I18N_NOOP("transcript of conversation with the debugger"), 0 }, { "r ", I18N_NOOP("remote debugging via "), 0 }, - { "l ", I18N_NOOP("specify language: C, XSLT"), "C"}, + { "l ", I18N_NOOP("specify language: C, XSLT"), ""}, { "x", I18N_NOOP("use language XSLT (deprecated)"), 0 }, { "+[program]", I18N_NOOP("path of executable to debug"), 0 }, { "+[core]", I18N_NOOP("a core file to use"), 0}, diff --git a/kdbg/mainwndbase.cpp b/kdbg/mainwndbase.cpp index b7d5bfe..271e08b 100644 --- a/kdbg/mainwndbase.cpp +++ b/kdbg/mainwndbase.cpp @@ -371,8 +371,15 @@ DebuggerDriver* DebuggerMainWndBase::driverFromLang(QCString lang) return driver; } +/** + * Try to guess the language to use from the contents of the file. + */ QCString DebuggerMainWndBase::driverNameFromFile(const QString& exe) { + /* Inprecise but simple test to see if file is in XSLT language */ + if (exe.right(4).lower() == ".xsl") + return "XSLT"; + return "GDB"; } -- 2.11.4.GIT