YAP 7.1.0
stack.c File Reference

Get to know what is in your stack. More...

#include "Yap.h"
#include "Yapproto.h"
#include <heapgc.h>
#include "walkclause.h"

Go to the source code of this file.

Macros

#define IN_BLOCK(P, B, SZ)    ((CODEADDR)(P) >= (CODEADDR)(B) && (CODEADDR)(P) < (CODEADDR)(B) + (SZ))
 
#define ONLOCAL(ptr)    (CellPtr(ptr) > CellPtr(HR) && CellPtr(ptr) < CellPtr(LOCAL_LocalBase))
 
#define buf   bufp->buf_
 
#define lbuf   bufp->lbuf_
 
#define bufsize   bufp->bufsize_
 
#define lbufsz   bufp->lbufsz_
 
#define ADDBUF(CMD)
 
#define NOGC(t)   (t & ~(MBIT|RBIT))
 

Typedefs

typedef struct __cp_frame _copy_frame
 
typedef struct buf_struct_t buf_t
 

Functions

Term Yap_TermToIndicator (Term t, Term mod)
 
Term Yap_PredicateToIndicator (PredEntry *pe)
 
char * Yap_output_bug_location (yamop *yap_pc, int where_from, int psize)
 Used for debugging. More...
 
PredEntryYap_PredForChoicePt (choiceptr cp, op_numbers *op)
 Yap_v<<ChoicePt(): find out the predicate who generated a CP. More...
 
bool Yap_search_for_static_predicate_in_use (PredEntry *p, bool check_everything)
 
PredEntryYap_PredForCode (yamop *codeptr, find_pred_type hint, Int *cl)
 given an arbitrary code point codeptr search the database for the owner predicate pp identifying the corresponding clause More...
 
PredEntryYap_PredEntryForCode (yamop *codeptr, find_pred_type where_from, void **startp, void **endp)
 
ClauseUnionYap_find_owner_index (yamop *ipc, PredEntry *ap)
 
yap_error_descriptor_tset_clause_info (yap_error_descriptor_t *t, yamop *codeptr, PredEntry *pp)
 
yap_error_descriptor_tYap_prolog_add_culprit (yap_error_descriptor_t *t PASS_REGS)
 
Term Yap_all_calls (void)
 
void Yap_dump_code_area_for_profiler (void)
 
const char * Yap_dump_stack (void)
 
char * DumpActiveGoals (USES_REGS1)
 
char * DumpStack (USES_REGS1)
 
yap_error_descriptor_tYap_pc_add_location (yap_error_descriptor_t *t, void *pc0, void *b_ptr0, void *env0)
 
yap_error_descriptor_tYap_env_add_location (yap_error_descriptor_t *t, void *cp0, void *b_ptr0, void *env0, YAP_Int ignore_first)
 
void ShowTerm (Term *tp, int depth)
 
void Yap_ShowTerm (Term t)
 
void pp__ (Term *tp, int lvl, char *s0, char *s)
 
void pp (Term t)
 
bool Yap_JumpToEnv (void)
 
void Yap_InitStInfo (void)
 

Detailed Description

Get to know what is in your stack.

Author
VITOR SANTOS COSTA vsc@V.nosp@m.ITOR.nosp@m.s-Mac.nosp@m.Book.nosp@m.-Pro..nosp@m.loca.nosp@m.l
Date
Tue Sep 8 23:33:02 2015

Definition in file stack.c.

Macro Definition Documentation

◆ ADDBUF

#define ADDBUF (   CMD)
Value:
{ \
while (true) { \
size_t sz = CMD; \
if (sz < lbufsz-256) { \
lbuf += sz; \
lbufsz -= sz; \
break; \
} \
char *nbuf = realloc(buf, bufsize += 1024); \
lbuf = nbuf + (lbuf-buf); \
buf = nbuf; \
lbufsz += 1024; \
} \
}

Definition at line 1760 of file stack.c.

◆ buf

#define buf   bufp->buf_

Definition at line 1754 of file stack.c.

◆ bufsize

#define bufsize   bufp->bufsize_

Definition at line 1756 of file stack.c.

◆ IN_BLOCK

#define IN_BLOCK (   P,
  B,
  SZ 
)     ((CODEADDR)(P) >= (CODEADDR)(B) && (CODEADDR)(P) < (CODEADDR)(B) + (SZ))

Definition at line 77 of file stack.c.

◆ lbuf

#define lbuf   bufp->lbuf_

Definition at line 1755 of file stack.c.

◆ lbufsz

#define lbufsz   bufp->lbufsz_

Definition at line 1757 of file stack.c.

◆ NOGC

#define NOGC (   t)    (t & ~(MBIT|RBIT))

Definition at line 2394 of file stack.c.

◆ ONLOCAL

#define ONLOCAL (   ptr)     (CellPtr(ptr) > CellPtr(HR) && CellPtr(ptr) < CellPtr(LOCAL_LocalBase))

Definition at line 1665 of file stack.c.

Function Documentation

◆ DumpActiveGoals()

char * DumpActiveGoals ( USES_REGS1  )

Definition at line 2090 of file stack.c.

◆ DumpStack()

char * DumpStack ( USES_REGS1  )

Definition at line 2135 of file stack.c.

◆ pp()

void pp ( Term  t)

Definition at line 2488 of file stack.c.

◆ pp__()

void pp__ ( Term *  tp,
int  lvl,
char *  s0,
char *  s 
)

Definition at line 2446 of file stack.c.

◆ set_clause_info()

yap_error_descriptor_t * set_clause_info ( yap_error_descriptor_t t,
yamop codeptr,
PredEntry pp 
)

Definition at line 1139 of file stack.c.

◆ ShowTerm()

void ShowTerm ( Term *  tp,
int  depth 
)

Definition at line 2344 of file stack.c.

◆ Yap_all_calls()

Term Yap_all_calls ( void  )

Definition at line 1261 of file stack.c.

◆ Yap_dump_code_area_for_profiler()

void Yap_dump_code_area_for_profiler ( void  )

Definition at line 1383 of file stack.c.

◆ Yap_dump_stack()

const char * Yap_dump_stack ( void  )

Definition at line 1842 of file stack.c.

◆ Yap_env_add_location()

yap_error_descriptor_t * Yap_env_add_location ( yap_error_descriptor_t t,
void *  cp0,
void *  b_ptr0,
void *  env0,
YAP_Int  ignore_first 
)

Definition at line 2256 of file stack.c.

◆ Yap_find_owner_index()

ClauseUnion * Yap_find_owner_index ( yamop ipc,
PredEntry ap 
)

Definition at line 1018 of file stack.c.

◆ Yap_InitStInfo()

void Yap_InitStInfo ( void  )

Definition at line 2575 of file stack.c.

◆ Yap_JumpToEnv()

bool Yap_JumpToEnv ( void  )

Definition at line 2542 of file stack.c.

◆ Yap_output_bug_location()

char * Yap_output_bug_location ( yamop yap_pc,
int  where_from,
int  psize 
)

Used for debugging.

Definition at line 2146 of file stack.c.

◆ Yap_pc_add_location()

yap_error_descriptor_t * Yap_pc_add_location ( yap_error_descriptor_t t,
void *  pc0,
void *  b_ptr0,
void *  env0 
)

Definition at line 2233 of file stack.c.

◆ Yap_PredEntryForCode()

PredEntry * Yap_PredEntryForCode ( yamop codeptr,
find_pred_type  where_from,
void **  startp,
void **  endp 
)

Definition at line 941 of file stack.c.

◆ Yap_PredForChoicePt()

PredEntry * Yap_PredForChoicePt ( choiceptr  cp,
op_numbers *  op 
)

Yap_v<<ChoicePt(): find out the predicate who generated a CP.

Parameters
cpthe choice point
opthe YAAM instruction to process next
Returns
A predixate structure or NULL

usually pretty straightforward, it can fall in trouble with 8 OR-P or tabling

Definition at line 307 of file stack.c.

◆ Yap_PredForCode()

PredEntry * Yap_PredForCode ( yamop codeptr,
find_pred_type  hint,
Int *  cl 
)

given an arbitrary code point codeptr search the database for the owner predicate pp identifying the corresponding clause

Definition at line 730 of file stack.c.

◆ Yap_PredicateToIndicator()

Term Yap_PredicateToIndicator ( PredEntry pe)

Definition at line 139 of file stack.c.

◆ Yap_prolog_add_culprit()

yap_error_descriptor_t * Yap_prolog_add_culprit ( yap_error_descriptor_t *t  PASS_REGS)

Definition at line 1198 of file stack.c.

◆ Yap_search_for_static_predicate_in_use()

bool Yap_search_for_static_predicate_in_use ( PredEntry p,
bool  check_everything 
)

Definition at line 336 of file stack.c.

◆ Yap_ShowTerm()

void Yap_ShowTerm ( Term  t)

Definition at line 2385 of file stack.c.

◆ Yap_TermToIndicator()

Term Yap_TermToIndicator ( Term  t,
Term  mod 
)

Definition at line 116 of file stack.c.