added core debug api
added missing setstring function --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%4060
This commit is contained in:
parent
2665d13475
commit
28736ae60c
@ -168,6 +168,11 @@ typedef int (*SPVM_EXEC)(struct sp_context_s *,
|
|||||||
uint32_t,
|
uint32_t,
|
||||||
cell_t *res);
|
cell_t *res);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Breaks into a debugger
|
||||||
|
*/
|
||||||
|
typedef int (*SPVM_DEBUGBREAK)(struct sp_context_s *);
|
||||||
|
|
||||||
#define SP_CONTEXT_DEBUG (1<<0) /* in debug mode */
|
#define SP_CONTEXT_DEBUG (1<<0) /* in debug mode */
|
||||||
#define SP_CONTEXT_INHERIT_MEMORY (1<<1) /* inherits memory pointers */
|
#define SP_CONTEXT_INHERIT_MEMORY (1<<1) /* inherits memory pointers */
|
||||||
#define SP_CONTEXT_INHERIT_CODE (1<<2) /* inherits code pointers */
|
#define SP_CONTEXT_INHERIT_CODE (1<<2) /* inherits code pointers */
|
||||||
@ -179,11 +184,13 @@ typedef int (*SPVM_EXEC)(struct sp_context_s *,
|
|||||||
*/
|
*/
|
||||||
typedef struct sp_context_s
|
typedef struct sp_context_s
|
||||||
{
|
{
|
||||||
/* parent information */
|
/* general/parent information */
|
||||||
void *base; /* base of generated code and memory */
|
void *base; /* base of generated code and memory */
|
||||||
sp_plugin_t *plugin; /* pointer back to parent information */
|
sp_plugin_t *plugin; /* pointer back to parent information */
|
||||||
struct sp_context_s *parent; /* pointer to parent context */
|
struct sp_context_s *parent; /* pointer to parent context */
|
||||||
uint32_t flags; /* context flags */
|
uint32_t flags; /* context flags */
|
||||||
|
SPVM_DEBUGBREAK dbreak; /* debug break function */
|
||||||
|
void *user; /* user specific pointer */
|
||||||
/* execution specific data */
|
/* execution specific data */
|
||||||
SPVM_EXEC exec; /* execution base */
|
SPVM_EXEC exec; /* execution base */
|
||||||
cell_t pri; /* PRI register */
|
cell_t pri; /* PRI register */
|
||||||
|
@ -193,6 +193,10 @@
|
|||||||
RelativePath="..\sp_vm.h"
|
RelativePath="..\sp_vm.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\sp_vm_debug.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\include\sp_vm_types.h"
|
RelativePath="..\..\include\sp_vm_types.h"
|
||||||
>
|
>
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
#include <malloc.h>
|
||||||
#include "sp_vm.h"
|
#include "sp_vm.h"
|
||||||
|
|
||||||
#define CELLBOUNDMAX (INT_MAX/sizeof(cell_t))
|
#define CELLBOUNDMAX (INT_MAX/sizeof(cell_t))
|
||||||
|
@ -186,6 +186,19 @@ int SP_LocalToString(sp_context_t *ctx,
|
|||||||
char *buffer,
|
char *buffer,
|
||||||
size_t maxlength);
|
size_t maxlength);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Converts a physical string to a local address.
|
||||||
|
* Note that SourcePawn does not support packed strings.
|
||||||
|
* @param ctx Context pointer
|
||||||
|
* @param local_addr Local address in plugin.
|
||||||
|
* @param chars Number of chars to write, including NULL terminator.
|
||||||
|
* @param source Source string to copy.
|
||||||
|
*/
|
||||||
|
int SP_StringToLocal(sp_context_t *ctx,
|
||||||
|
cell_t local_addr,
|
||||||
|
size_t chars,
|
||||||
|
const char *source);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pushes a cell onto the stack. Increases the parameter count by one.
|
* Pushes a cell onto the stack. Increases the parameter count by one.
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user