#include "lldb/Core/Address.h"
#include "lldb/Core/Debugger.h"
+#include "lldb/Core/Language.h"
#include "lldb/Core/Module.h"
#include "lldb/Core/Stream.h"
#include "lldb/Core/StreamString.h"
ENTRY_CHILDREN ("ansi" , Invalid , None , g_ansi_entries),
ENTRY ("current-pc-arrow" , CurrentPCArrow , CString ),
ENTRY_CHILDREN ("file" , File , CString , g_file_child_entries),
+ ENTRY ("language" , Lang , CString),
ENTRY_CHILDREN ("frame" , Invalid , None , g_frame_child_entries),
ENTRY_CHILDREN ("function" , Invalid , None , g_function_child_entries),
ENTRY_CHILDREN ("line" , Invalid , None , g_line_child_entries),
ENUM_TO_CSTR(ScriptTarget);
ENUM_TO_CSTR(ModuleFile);
ENUM_TO_CSTR(File);
+ ENUM_TO_CSTR(Lang);
ENUM_TO_CSTR(FrameIndex);
ENUM_TO_CSTR(FrameRegisterPC);
ENUM_TO_CSTR(FrameRegisterSP);
}
return false;
+ case Entry::Type::Lang:
+ if (sc)
+ {
+ CompileUnit *cu = sc->comp_unit;
+ if (cu)
+ {
+ Language lang(cu->GetLanguage());
+ const char *lang_name = lang.AsCString();
+ if (lang_name)
+ {
+ s.PutCString(lang_name);
+ return true;
+ }
+ }
+ }
+ return false;
+
case Entry::Type::FrameIndex:
if (exe_ctx)
{
self.format_string = m.group(1)
# Change the default format to print function.name rather than function.name-with-args
- format_string = "frame #${frame.index}: ${frame.pc}{ ${module.file.basename}`${function.name}{${function.pc-offset}}}{ at ${line.file.fullpath}:${line.number}}\n"
+ format_string = "frame #${frame.index}: ${frame.pc}{ ${module.file.basename}`${function.name}{${function.pc-offset}}}{ at ${line.file.fullpath}:${line.number}}{, lang=${language}}\n"
self.runCmd("settings set frame-format %s" % format_string)
# Immediately test the setting.
<tr valign=top><td><b>Variable Name</b></td><td><b>Description</b></td></tr>
<tr valign=top><td><b>file.basename</b></td><td>The current compile unit file basename for the current frame.</td></tr>
<tr valign=top><td><b>file.fullpath</b></td><td>The current compile unit file fullpath for the current frame.</td></tr>
+ <tr valign=top><td><b>language</b></td><td>The current compile unit language for the current frame.</td></tr>
<tr valign=top><td><b>frame.index</b></td><td>The frame index (0, 1, 2, 3...)</td></tr>
<tr valign=top><td><b>frame.pc</b></td><td>The generic frame register for the program counter.</td></tr>
<tr valign=top><td><b>frame.sp</b></td><td>The generic frame register for the stack pointer.</td></tr>