llvm-project/lldb/source/Target
Greg Clayton 1b65488229 Added code that will allow completely customizable prompts for use in
replacing the "(lldb)" prompt, the "frame #1..." displays when doing
stack backtracing and the "thread #1....". This will allow you to see 
exactly the information that you want to see where you want to see it.
This currently isn't hookup up to the prompts yet, but it will be soon.

So what is the format of the prompts? Prompts can contain variables that
have access to the current program state. Variables are text that appears
in between a prefix of "${" and ends with a "}". Some of the interesting
variables include:

// The frame index (0, 1, 2, 3...)
${frame.index}

// common frame registers with generic names
${frame.pc}
${frame.sp}
${frame.fp}
${frame.ra}
${frame.flags}

// Access to any frame registers by name where REGNAME is any register name:
${frame.reg.REGNAME}

// The current compile unit file where the frame is located
${file.basename}
${file.fullpath}

// Function information
${function.name}
${function.pc-offset}

// Process info
${process.file.basename}
${process.file.fullpath}
${process.id}
${process.name}

// Thread info
${thread.id}
${thread.index}
${thread.name}
${thread.queue}
${thread.stop-reason}

// Target information
${target.arch}

// The current module for the current frame (the shared library or executable
// that contains the current frame PC value):
${module.file.basename}
${module.file.fullpath}

// Access to the line entry for where the current frame is when your thread
// is stopped:
${line.file.basename}
${line.file.fullpath}
${line.number}
${line.start-addr}
${line.end-addr}

Many times the information that you might have in your prompt might not be
available and you won't want it to print out if it isn't valid. To take care
of this you can enclose everything that must resolve into a scope. A scope
is starts with '{' and ends with '}'. For example in order to only display
the current file and line number when the information is available the format
would be:

"{ at {$line.file.basename}:${line.number}}"

Broken down this is:

start the scope: "{"

format whose content will only be displayed if all information is available:
        "at {$line.file.basename}:${line.number}"

end the scope: "}"

We currently can represent the infomration we see when stopped at a frame:

frame #0: 0x0000000100000e85 a.out`main + 4 at test.c:19

with the following format:

"frame #${frame.index}: ${frame.pc} {${module.file.basename}`}{${function.name}{${function.pc-offset}}{ at ${line.file.basename}:${line.number}}\n"

This breaks down to always print:

        "frame #${frame.index}: ${frame.pc} "

only print the module followed by a tick if we have a valid module:

        "{${module.file.basename}`}"
        
print the function name with optional offset:
        "{${function.name}{${function.pc-offset}}"

print the line info if it is available:
        
        "{ at ${line.file.basename}:${line.number}}"

then finish off with a newline:

        "\n"

Notice you can also put newlines ("\n") and tabs and everything else you
are used to putting in a format string when desensitized with the \ character.

Cleaned up some of the user settings controller subclasses. All of them 
do not have any global settings variables and were all implementing stubs
for the get/set global settings variable. Now there is a default version
in UserSettingsController that will do nothing.

llvm-svn: 114306
2010-09-19 02:33:57 +00:00
..
ABI.cpp
ExecutionContext.cpp Change "Current" as in GetCurrentThread, GetCurrentStackFrame, etc, to "Selected" i.e. GetSelectedThread. Selected makes more sense, since these are set by some user action (a selection). I didn't change "CurrentProcess" since this is always controlled by the target, and a given target can only have one process, so it really can't be selected. 2010-08-26 21:32:51 +00:00
Makefile Merged Eli Friedman's linux build changes where he added Makefile files that 2010-07-09 20:39:50 +00:00
ObjCObjectPrinter.cpp Move the "Object Description" into the ValueObject, and the add an API to 2010-09-10 23:12:17 +00:00
PathMappingList.cpp Minor warning/error fixes. 2010-06-09 09:32:42 +00:00
Process.cpp Added code that will allow completely customizable prompts for use in 2010-09-19 02:33:57 +00:00
RegisterContext.cpp The first part of an lldb native stack unwinder. 2010-09-10 07:49:16 +00:00
SectionLoadList.cpp Clear the section list when a our current process is destroyed. 2010-09-14 23:52:43 +00:00
StackFrame.cpp Moved the section load list up into the target so we can use the target 2010-09-14 23:36:40 +00:00
StackFrameList.cpp Added more API to lldb::SBBlock to allow getting the block 2010-09-07 04:20:48 +00:00
StackID.cpp Added a new bool parameter to many of the DumpStopContext() methods that 2010-09-02 21:44:10 +00:00
StopInfo.cpp Make breakpoint commands work again. Added a PerformAction to the stop info - actions are run when the 2010-08-10 00:59:59 +00:00
Target.cpp Clear the section list when a our current process is destroyed. 2010-09-14 23:52:43 +00:00
TargetList.cpp If the file the user specifies can't be found in the current directory, 2010-09-10 04:48:55 +00:00
Thread.cpp Added code that will allow completely customizable prompts for use in 2010-09-19 02:33:57 +00:00
ThreadList.cpp Cleaned up step logging a bit. 2010-09-03 22:45:01 +00:00
ThreadPlan.cpp Cleaned up step logging a bit. 2010-09-03 22:45:01 +00:00
ThreadPlanBase.cpp Abtracted the old "lldb_private::Thread::StopInfo" into an abtract class. 2010-08-04 01:40:35 +00:00
ThreadPlanCallFunction.cpp Moved the section load list up into the target so we can use the target 2010-09-14 23:36:40 +00:00
ThreadPlanRunToAddress.cpp Moved the section load list up into the target so we can use the target 2010-09-14 23:36:40 +00:00
ThreadPlanShouldStopHere.cpp
ThreadPlanStepInRange.cpp Step past prologues when we step into functions. 2010-09-16 00:58:09 +00:00
ThreadPlanStepInstruction.cpp Got a lot of the kinks worked out in the inline support after debugging more 2010-08-24 21:05:24 +00:00
ThreadPlanStepOut.cpp Got a lot of the kinks worked out in the inline support after debugging more 2010-08-24 21:05:24 +00:00
ThreadPlanStepOverBreakpoint.cpp Two changes in this checkin. Added a ThreadPlanKind so that I can do some reasoning based on the kind of thread plan 2010-06-19 04:45:32 +00:00
ThreadPlanStepOverRange.cpp Moved the section load list up into the target so we can use the target 2010-09-14 23:36:40 +00:00
ThreadPlanStepRange.cpp Step past prologues when we step into functions. 2010-09-16 00:58:09 +00:00
ThreadPlanStepThrough.cpp Two changes in this checkin. Added a ThreadPlanKind so that I can do some reasoning based on the kind of thread plan 2010-06-19 04:45:32 +00:00
ThreadPlanStepUntil.cpp Got a lot of the kinks worked out in the inline support after debugging more 2010-08-24 21:05:24 +00:00
ThreadSpec.cpp Change the Breakpoint & BreakpointLocation GetDescription methods so they call the BreakpointOptions::GetDescription rather 2010-06-18 01:00:58 +00:00
UnixSignals.cpp