Data Structures | Macros | Functions
debugger.c File Reference
#include "nvim/ascii.h"
#include "nvim/charset.h"
#include "nvim/debugger.h"
#include "nvim/eval.h"
#include "nvim/ex_docmd.h"
#include "nvim/ex_getln.h"
#include "nvim/fileio.h"
#include "nvim/getchar.h"
#include "nvim/globals.h"
#include "nvim/os/os.h"
#include "nvim/pos.h"
#include "nvim/regexp.h"
#include "nvim/screen.h"
#include "nvim/types.h"
#include "nvim/vim.h"

Data Structures

struct  debuggy
 

Macros

#define CMD_CONT   1
 
#define CMD_NEXT   2
 
#define CMD_STEP   3
 
#define CMD_FINISH   4
 
#define CMD_QUIT   5
 
#define CMD_INTERRUPT   6
 
#define CMD_BACKTRACE   7
 
#define CMD_FRAME   8
 
#define CMD_UP   9
 
#define CMD_DOWN   10
 
#define BREAKP(idx)   (((struct debuggy *)dbg_breakp.ga_data)[idx])
 
#define DEBUGGY(gap, idx)   (((struct debuggy *)gap->ga_data)[idx])
 
#define DBG_FUNC   1
 
#define DBG_FILE   2
 
#define DBG_EXPR   3
 

Functions

void do_debug (char_u *cmd)
 
void ex_debug (exarg_T *eap)
 ":debug". More...
 
void dbg_check_breakpoint (exarg_T *eap)
 
bool dbg_check_skipped (exarg_T *eap)
 
void ex_breakadd (exarg_T *eap)
 ":breakadd". Also used for ":profile". More...
 
void ex_debuggreedy (exarg_T *eap)
 ":debuggreedy". More...
 
void ex_breakdel (exarg_T *eap)
 ":breakdel" and ":profdel". More...
 
void ex_breaklist (exarg_T *eap)
 ":breaklist". More...
 
linenr_T dbg_find_breakpoint (bool file, char_u *fname, linenr_T after)
 
bool has_profiling (bool file, char_u *fname, bool *fp)
 
void dbg_breakpoint (char_u *name, linenr_T lnum)
 Called when a breakpoint was encountered. More...
 

Detailed Description

Vim script debugger functions

Macro Definition Documentation

◆ BREAKP

#define BREAKP (   idx)    (((struct debuggy *)dbg_breakp.ga_data)[idx])

◆ CMD_BACKTRACE

#define CMD_BACKTRACE   7

◆ CMD_CONT

#define CMD_CONT   1

◆ CMD_DOWN

#define CMD_DOWN   10

◆ CMD_FINISH

#define CMD_FINISH   4

◆ CMD_FRAME

#define CMD_FRAME   8

◆ CMD_INTERRUPT

#define CMD_INTERRUPT   6

◆ CMD_NEXT

#define CMD_NEXT   2

◆ CMD_QUIT

#define CMD_QUIT   5

◆ CMD_STEP

#define CMD_STEP   3

◆ CMD_UP

#define CMD_UP   9

◆ DBG_EXPR

#define DBG_EXPR   3

◆ DBG_FILE

#define DBG_FILE   2

◆ DBG_FUNC

#define DBG_FUNC   1

◆ DEBUGGY

#define DEBUGGY (   gap,
  idx 
)    (((struct debuggy *)gap->ga_data)[idx])

Function Documentation

◆ dbg_breakpoint()

void dbg_breakpoint ( char_u name,
linenr_T  lnum 
)

Called when a breakpoint was encountered.

◆ dbg_check_breakpoint()

void dbg_check_breakpoint ( exarg_T eap)

Go to debug mode when a breakpoint was encountered or "ex_nesting_level" is at or below the break level. But only when the line is actually executed. Return true and set breakpoint_name for skipped commands that decide to execute something themselves. Called from do_one_cmd() before executing a command.

◆ dbg_check_skipped()

bool dbg_check_skipped ( exarg_T eap)

Go to debug mode if skipped by dbg_check_breakpoint() because eap->skip was set.

Returns
true when the debug mode is entered this time.

◆ dbg_find_breakpoint()

linenr_T dbg_find_breakpoint ( bool  file,
char_u fname,
linenr_T  after 
)

Find a breakpoint for a function or sourced file. Returns line number at which to break; zero when no matching breakpoint.

Parameters
filetrue for a file, false for a function
fnamefile or function name
afterafter this line number

◆ do_debug()

void do_debug ( char_u cmd)

Debug mode. Repeatedly get Ex commands, until told to continue normal execution.

◆ ex_breakadd()

void ex_breakadd ( exarg_T eap)

":breakadd". Also used for ":profile".

◆ ex_breakdel()

void ex_breakdel ( exarg_T eap)

":breakdel" and ":profdel".

◆ ex_breaklist()

void ex_breaklist ( exarg_T eap)

":breaklist".

◆ ex_debug()

void ex_debug ( exarg_T eap)

":debug".

◆ ex_debuggreedy()

void ex_debuggreedy ( exarg_T eap)

":debuggreedy".

◆ has_profiling()

bool has_profiling ( bool  file,
char_u fname,
bool fp 
)
Parameters
filetrue for a file, false for a function
fnamefile or function name
fp[out]forceit
Returns
true if profiling is on for a function or sourced file.