本文整理汇总了C++中DUMP函数的典型用法代码示例。如果您正苦于以下问题:C++ DUMP函数的具体用法?C++ DUMP怎么用?C++ DUMP使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DUMP函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: x87_fwait
void x87_fwait( struct x86_function *p )
{
DUMP();
emit_1ub(p, 0x9b);
}
示例2: write_points
void write_points(const char *fname, DATA *d, DPOINT *where, double *est,
int n_outfl) {
static FILE *f = NULL;
#ifdef HAVE_LIBGIS
static Site *site = NULL;
static int dim = 2;
int i;
#endif
if (! grass()) {
if (where == NULL) {
if (fname != NULL) {
f = efopen(fname, "w");
write_ascii_header(f, d, n_outfl);
} else
efclose(f);
} else {
if (f == NULL)
ErrMsg(ER_NULL, "write_points(): f");
output_line(f, d, where, est, n_outfl);
}
} else {
#ifdef HAVE_LIBGIS
if (where == NULL) {
if (fname != NULL) { /* initialize: */
DUMP("opening grass sites list\n");
if (d->mode & Z_BIT_SET)
dim++;
if ((f = G_sites_open_new((char *) fname)) == NULL)
G_fatal_error("%s: cannot open sites file %f for writing\n",
G_program_name());
site = G_site_new_struct(CELL_TYPE, dim, 0, n_outfl);
} else { /* close: */
DUMP("closing grass sites list\n");
fclose(f);
dim = 2;
G_site_free_struct(site);
site = NULL;
}
} else {
assert(site != NULL);
assert(d != NULL);
/* fill site: */
site->east = where->x;
site->north = where->y;
if (d->mode & Z_BIT_SET)
site->dim[0] = where->z;
if (d->mode & S_BIT_SET)
site->ccat = where->u.stratum + strata_min;
else
site->ccat = GET_INDEX(where) + 1;
for (i = 0; i < n_outfl; i++) {
if (is_mv_double(&(est[i]))) {
site->dbl_att[i] = -9999.0;
if (DEBUG_DUMP)
printlog(" [%d]:mv ", i);
} else {
site->dbl_att[i] = est[i];
if (DEBUG_DUMP)
printlog(" value[%d]: %g ", i, site->dbl_att[i]);
}
}
if (DEBUG_DUMP)
printlog("\n");
G_site_put(f, site);
}
#else
ErrMsg(ER_IMPOSVAL, "gstat/grass error: libgis() not linked");
#endif
}
}
示例3: __attribute__
void __attribute__((__no_instrument_function__)) __cyg_profile_func_exit(void *this_func, void *call_site) {
DUMP(this_func, call_site);
}
示例4: caml_dump_r
CAMLprim value caml_dump_r(CAML_R, value string){
DUMP("%s", String_val(string));
return Val_unit;
}
示例5: filename
NS_IMETHODIMP
nsStatusReporterManager::DumpReports()
{
static unsigned number = 1;
nsresult rv;
nsCString filename("status-reports-");
filename.AppendInt(getpid());
filename.Append('-');
filename.AppendInt(number++);
filename.AppendLiteral(".json");
// Open a file in NS_OS_TEMP_DIR for writing.
// The file is initialized as "incomplete-status-reports-pid-number.json" in the
// begining, it will be rename as "status-reports-pid-number.json" in the end.
nsCOMPtr<nsIFile> tmpFile;
rv = nsDumpUtils::OpenTempFile(NS_LITERAL_CSTRING("incomplete-") +
filename,
getter_AddRefs(tmpFile),
NS_LITERAL_CSTRING("status-reports"));
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
nsCOMPtr<nsIFileOutputStream> ostream =
do_CreateInstance("@mozilla.org/network/file-output-stream;1");
rv = ostream->Init(tmpFile, -1, -1, 0);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
//Write the reports to the file
DUMP(ostream, "{\n\"subject\":\"about:service reports\",\n");
DUMP(ostream, "\"reporters\": [ ");
nsCOMPtr<nsISimpleEnumerator> e;
bool more, first = true;
EnumerateReporters(getter_AddRefs(e));
while (NS_SUCCEEDED(e->HasMoreElements(&more)) && more) {
nsCOMPtr<nsISupports> supports;
e->GetNext(getter_AddRefs(supports));
nsCOMPtr<nsIStatusReporter> r = do_QueryInterface(supports);
nsCString process;
rv = r->GetProcess(process);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
nsCString name;
rv = r->GetName(name);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
nsCString description;
rv = r->GetDescription(description);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
if (first) {
first = false;
} else {
DUMP(ostream, ",");
}
rv = DumpReport(ostream, process, name, description);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
}
DUMP(ostream, "\n]\n}\n");
rv = ostream->Close();
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
// Rename the status reports file
nsCOMPtr<nsIFile> srFinalFile;
rv = NS_GetSpecialDirectory(NS_OS_TEMP_DIR, getter_AddRefs(srFinalFile));
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
#ifdef ANDROID
rv = srFinalFile->AppendNative(NS_LITERAL_CSTRING("status-reports"));
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
#endif
rv = srFinalFile->AppendNative(filename);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
rv = srFinalFile->CreateUnique(nsIFile::NORMAL_FILE_TYPE, 0600);
//.........这里部分代码省略.........
示例6: zix_tree_insert
ZIX_API ZixStatus
zix_tree_insert(ZixTree* t, void* e, ZixTreeIter** ti)
{
DEBUG_PRINTF("**** INSERT %ld\n", (intptr_t)e);
int cmp = 0;
ZixTreeNode* n = t->root;
ZixTreeNode* p = NULL;
// Find the parent p of e
while (n) {
p = n;
cmp = t->cmp(e, n->data, t->cmp_data);
if (cmp < 0) {
n = n->left;
} else if (cmp > 0) {
n = n->right;
} else if (t->allow_duplicates) {
n = n->right;
} else {
if (ti) {
*ti = n;
}
DEBUG_PRINTF("%ld EXISTS!\n", (intptr_t)e);
return ZIX_STATUS_EXISTS;
}
}
// Allocate a new node n
if (!(n = (ZixTreeNode*)malloc(sizeof(ZixTreeNode)))) {
return ZIX_STATUS_NO_MEM;
}
memset(n, '\0', sizeof(ZixTreeNode));
n->data = e;
n->balance = 0;
if (ti) {
*ti = n;
}
bool p_height_increased = false;
// Make p the parent of n
n->parent = p;
if (!p) {
t->root = n;
} else {
if (cmp < 0) {
assert(!p->left);
assert(p->balance == 0 || p->balance == 1);
p->left = n;
--p->balance;
p_height_increased = !p->right;
} else {
assert(!p->right);
assert(p->balance == 0 || p->balance == -1);
p->right = n;
++p->balance;
p_height_increased = !p->left;
}
}
DUMP(t);
// Rebalance if necessary (at most 1 rotation)
assert(!p || p->balance == -1 || p->balance == 0 || p->balance == 1);
if (p && p_height_increased) {
int height_change = 0;
for (ZixTreeNode* i = p; i && i->parent; i = i->parent) {
if (i == i->parent->left) {
if (--i->parent->balance == -2) {
zix_tree_rebalance(t, i->parent, &height_change);
break;
}
} else {
assert(i == i->parent->right);
if (++i->parent->balance == 2) {
zix_tree_rebalance(t, i->parent, &height_change);
break;
}
}
if (i->parent->balance == 0) {
break;
}
}
}
DUMP(t);
++t->size;
#ifdef ZIX_TREE_VERIFY
if (!verify(t, t->root)) {
return ZIX_STATUS_ERROR;
}
#endif
return ZIX_STATUS_SUCCESS;
}
示例7: caml_deserialize_and_run_in_this_thread
/* Return 0 on success and non-zero on failure. */
static int caml_deserialize_and_run_in_this_thread(caml_global_context *parent_context, char *blob, int index, sem_t *semaphore, /*out*/caml_global_context **to_context)
{
#ifdef HAS_MULTICONTEXT
/* Make a new empty context, and use it to deserialize the blob into. */
CAML_R = caml_make_empty_context(); // ctx also becomes the thread-local context
//DUMPROOTS("splitting: from new thread");
CAMLparam0();
CAMLlocal1(function);
//FDUMPROOTS("splitting: from new thread after GC-protecting locals");
int did_we_fail;
caml_initialize_context_thread_support_r(ctx);
ctx->caml_start_code = parent_context->caml_start_code;
ctx->caml_code_size = parent_context->caml_code_size;
ctx->caml_saved_code = parent_context->caml_saved_code;
#ifdef THREADED_CODE
ctx->caml_instr_table = parent_context->caml_instr_table;
ctx->caml_instr_base = parent_context->caml_instr_base;
#endif // #ifdef THREADED_CODE
#ifndef NATIVE_CODE
DUMP();
caml_init_code_fragments_r(ctx); // this is needed for caml_install_globals_and_data_as_c_byte_array_r
DUMP();
ctx->caml_prim_table = parent_context->caml_prim_table;
ctx->caml_prim_name_table = parent_context->caml_prim_name_table;
#endif // #ifdef THREADED_CODE
*to_context = ctx;
caml_install_globals_and_data_as_c_byte_array_r(ctx, blob, &function);
DUMP("Done with the blob: index=%i\n", index);
/* /\* We're done with the blob: unpin it via the semaphore, so that it */
/* can be destroyed when all split threads have deserialized. *\/ */
/* //fprintf(stderr, "W5.5context %p] [thread %p] (index %i) EEEEEEEEEEEEEEEEEEEEEEEEEE\n", ctx, (void*)(pthread_self()), index); fflush(stderr); caml_release_global_lock(); */
/* DUMP("About to V the semaphore. index=%i\n", index); */
/* sem_post(semaphore); */
#ifndef NATIVE_CODE
DUMP();
caml_init_exceptions_r(ctx);
DUMP();
//caml_debugger_r(ctx, PROGRAM_START);
#endif // #ifndef NATIVE_CODE
DUMP();
ctx->caml_exe_name = parent_context->caml_exe_name;
ctx->caml_main_argv = parent_context->caml_main_argv;
DUMP();
/* We're done with the blob: unpin it via the semaphore, so that it
can be destroyed when all split threads have deserialized. */
//fprintf(stderr, "W5.5context %p] [thread %p] (index %i) EEEEEEEEEEEEEEEEEEEEEEEEEE\n", ctx, (void*)(pthread_self()), index); fflush(stderr); caml_release_global_lock();
//SLEEP("before V'ing the semaphore.", 3);
DUMP("About to V the semaphore. index=%i\n", index);
//int sem_post_result = sem_post(semaphore);
//assert(sem_post_result == 0);
caml_v_semaphore(semaphore);
/* Now do the actual work, in a function which correctly GC-protects its locals: */
did_we_fail = caml_run_function_this_thread_r(ctx, function, index);
DUMP("$$$$$$$$$$$$$$$ ran the Caml code in a child context");
if(did_we_fail){
//DUMP("the Caml code failed"); // !!!!!!!!!!!!!!!!!!!!!!!!!!! What shall we do in this case?
//volatile int a = 1; a /= 0; /*die horribly*/
DUMP("the Caml code failed");
assert(0); // What shall we do in this case?
}
/* One less user for this context; the main thread is done: */
caml_unpin_context_r(ctx);
CAMLreturnT(int, did_we_fail);
/* /\* We're done. But we can't destroy the context yet, until it's */
/* joined: the object must remain visibile to the OCaml code, and */
/* for accessing the pthread_t objecet from the C join code. *\/ */
/* CAMLreturnT(int, did_we_fail); */
#endif // #ifdef HAS_MULTICONTEXT
assert(0); // this must be unreachable if multi-context is disabled
}
示例8: x87_fscale
void x87_fscale( struct x86_function *p )
{
DUMP();
emit_2ub(p, 0xd9, 0xfd);
}
示例9: x87_fsincos
void x87_fsincos( struct x86_function *p )
{
DUMP();
emit_2ub(p, 0xd9, 0xfb);
}
示例10: x87_fchs
void x87_fchs( struct x86_function *p )
{
DUMP();
emit_2ub(p, 0xd9, 0xe0);
}
示例11: x87_fprndint
void x87_fprndint( struct x86_function *p )
{
DUMP();
emit_2ub(p, 0xd9, 0xfc);
}
示例12: x87_fabs
void x87_fabs( struct x86_function *p )
{
DUMP();
emit_2ub(p, 0xd9, 0xe1);
}
示例13: x87_ftst
void x87_ftst( struct x86_function *p )
{
DUMP();
emit_2ub(p, 0xd9, 0xe4);
}
示例14: x87_fnclex
void x87_fnclex( struct x86_function *p )
{
DUMP();
emit_2ub(p, 0xdb, 0xe2);
}
示例15: XI_VERIFY
int
nsComponentsDlg::Show(int aDirection)
{
int err = OK;
int customSTIndex = 0, i;
int numRows = 0;
int currRow = 0;
GtkWidget *hbox = NULL;
XI_VERIFY(gCtx);
XI_VERIFY(gCtx->notebook);
if (mWidgetsInit == FALSE)
{
customSTIndex = gCtx->sdlg->GetNumSetupTypes();
sCustomST = gCtx->sdlg->GetSetupTypeList();
for (i=1; i<customSTIndex; i++)
sCustomST = sCustomST->GetNext();
DUMP(sCustomST->GetDescShort());
// create a new table and add it as a page of the notebook
mTable = gtk_table_new(5, 1, FALSE);
gtk_notebook_append_page(GTK_NOTEBOOK(gCtx->notebook), mTable, NULL);
mPageNum = gtk_notebook_get_current_page(GTK_NOTEBOOK(gCtx->notebook));
gtk_widget_show(mTable);
// 1st row: a label (msg0)
// insert a static text widget in the first row
GtkWidget *msg0 = gtk_label_new(mMsg0);
hbox = gtk_hbox_new(FALSE, 0);
gtk_box_pack_start(GTK_BOX(hbox), msg0, FALSE, FALSE, 0);
gtk_widget_show(hbox);
gtk_table_attach(GTK_TABLE(mTable), hbox, 0, 1, 1, 2,
static_cast<GtkAttachOptions>(GTK_FILL | GTK_EXPAND),
GTK_FILL, 20, 20);
gtk_widget_show(msg0);
// 2nd row: a CList with a check box for each row (short desc)
GtkWidget *list = NULL;
GtkWidget *scrollwin = NULL;
GtkStyle *style = NULL;
GdkBitmap *ch_mask = NULL;
GdkPixmap *checked = NULL;
GdkBitmap *un_mask = NULL;
GdkPixmap *unchecked = NULL;
gchar *dummy[2] = { " ", " " };
nsComponent *currComp = sCustomST->GetComponents()->GetHead();
GtkWidget *descLongTable = NULL;
GtkWidget *frame = NULL;
scrollwin = gtk_scrolled_window_new(NULL, NULL);
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrollwin),
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
list = gtk_clist_new(2);
gtk_clist_set_selection_mode(GTK_CLIST(list), GTK_SELECTION_BROWSE);
gtk_clist_column_titles_hide(GTK_CLIST(list));
gtk_clist_set_column_auto_resize(GTK_CLIST(list), 0, TRUE);
gtk_clist_set_column_auto_resize(GTK_CLIST(list), 1, TRUE);
// determine number of rows we'll need
numRows = sCustomST->GetComponents()->GetLengthVisible();
for (i = 0; i < numRows; i++)
gtk_clist_append(GTK_CLIST(list), dummy);
style = gtk_widget_get_style(gCtx->window);
checked = gdk_pixmap_create_from_xpm_d(gCtx->window->window, &ch_mask,
&style->bg[GTK_STATE_NORMAL], (gchar **)check_on_xpm);
unchecked = gdk_pixmap_create_from_xpm_d(gCtx->window->window, &un_mask,
&style->bg[GTK_STATE_NORMAL], (gchar **)check_off_xpm);
while ((currRow < numRows) && currComp) // paranoia!
{
if (!currComp->IsInvisible())
{
if (currComp->IsSelected())
gtk_clist_set_pixmap(GTK_CLIST(list), currRow, 0,
checked, ch_mask);
else
gtk_clist_set_pixmap(GTK_CLIST(list), currRow, 0,
unchecked, un_mask);
gtk_clist_set_text(GTK_CLIST(list), currRow, 1,
currComp->GetDescShort());
currRow++;
}
currComp = currComp->GetNext();
}
// by default, first row selected upon Show()
sCurrRowSelected = 0;
gtk_signal_connect(GTK_OBJECT(list), "select_row",
GTK_SIGNAL_FUNC(RowSelected), NULL);
gtk_signal_connect(GTK_OBJECT(list), "key_press_event",
GTK_SIGNAL_FUNC(KeyPressed), NULL);
gtk_container_add(GTK_CONTAINER(scrollwin), list);
gtk_widget_show(list);
gtk_widget_show(scrollwin);
//.........这里部分代码省略.........