void print_date(int yPos) { for(int x = 0; x<128; x++) { for(int y=yPos; y<yPos+18; y++ ){ reset_pixel(x,y); } } /*int dayWidth = get_dayWidth(); int monthWidth = get_monthWidth(); int dateWidth = dayWidth + monthWidth + 6; //6=Punkt + Leerzeichen int xPosDate = (127 - dateWidth) / 2 + 1;*/ int xPosDate = get_dateXPos(); if ((yPos == POS_DATE_STD) && (day==14) && (month==1)){ uint8_t roseSymb[90]; for(int i=0; i<90; i++){ roseSymb[i] = pgm_read_byte(&rose[0][i]); } print_symbol(16, 45, roseSymb, (127 - ROSE_WIDTH) / 2 + 1, POS_DATE_STD); } else if ((yPos == POS_DATE_STD) && (day==4) && (month==7)) { int spruch [11]; convertString("Alles Liebe", spruch); int xSpruch = (127 - get_stringWidth(spruch, 11)) / 2 + 1; print_ASCIIString(xSpruch, POS_DATE_STD, spruch, 11); uint8_t herzSymb[32]; for(int i=0; i<32; i++){ herzSymb[i] = pgm_read_byte(&herz[0][i]); } print_symbol(16, 16, herzSymb, xSpruch - 16 - 4, POS_DATE_STD); print_symbol(16, 16, herzSymb, xSpruch + get_stringWidth(spruch, 11) + 4, POS_DATE_STD); } else { print_day(xPosDate, yPos); //Tag print_letter(alphaHeight, pgm_read_byte(&alphaWidth[54]), 54, xPosDate + get_dayWidth() + 1, yPos); //Punkt print_month(xPosDate + get_dayWidth() + 6, yPos); //Monat ..+6=Punkt+Leerzeichen } }
void dik_show_regs(struct pt_regs *regs, unsigned long *r9_15) { printk("pc = [<%016lx>] ra = [<%016lx>] ps = %04lx %s\n", regs->pc, regs->r26, regs->ps, print_tainted()); print_symbol("pc is at %s\n", regs->pc); print_symbol("ra is at %s\n", regs->r26 ); printk("v0 = %016lx t0 = %016lx t1 = %016lx\n", regs->r0, regs->r1, regs->r2); printk("t2 = %016lx t3 = %016lx t4 = %016lx\n", regs->r3, regs->r4, regs->r5); printk("t5 = %016lx t6 = %016lx t7 = %016lx\n", regs->r6, regs->r7, regs->r8); if (r9_15) { printk("s0 = %016lx s1 = %016lx s2 = %016lx\n", r9_15[9], r9_15[10], r9_15[11]); printk("s3 = %016lx s4 = %016lx s5 = %016lx\n", r9_15[12], r9_15[13], r9_15[14]); printk("s6 = %016lx\n", r9_15[15]); } printk("a0 = %016lx a1 = %016lx a2 = %016lx\n", regs->r16, regs->r17, regs->r18); printk("a3 = %016lx a4 = %016lx a5 = %016lx\n", regs->r19, regs->r20, regs->r21); printk("t8 = %016lx t9 = %016lx t10= %016lx\n", regs->r22, regs->r23, regs->r24); printk("t11= %016lx pv = %016lx at = %016lx\n", regs->r25, regs->r27, regs->r28); printk("gp = %016lx sp = %p\n", regs->gp, regs+1); #if 0 __halt(); #endif }
void __show_regs(struct pt_regs *regs) { int i, top_reg; u64 lr, sp; if (compat_user_mode(regs)) { lr = regs->compat_lr; sp = regs->compat_sp; top_reg = 12; } else { lr = regs->regs[30]; sp = regs->sp; top_reg = 29; } show_regs_print_info(KERN_DEFAULT); print_symbol("PC is at %s\n", instruction_pointer(regs)); print_symbol("LR is at %s\n", lr); printk("pc : [<%016llx>] lr : [<%016llx>] pstate: %08llx\n", regs->pc, lr, regs->pstate); printk("sp : %016llx\n", sp); for (i = top_reg; i >= 0; i--) { printk("x%-2d: %016llx ", i, regs->regs[i]); if (i % 2 == 0) printk("\n"); } printk("\n"); }
void set_timeParameter(int *timeParameter, int maxTime, bool timeType){ //timeParameter = {minute, hour, alarmMinute, alarmHour} while(!btn_drehenc_pushed) { if(rotary!=0) { cli(); *timeParameter += rotary; rotary = 0; *timeParameter = *timeParameter % maxTime; if(*timeParameter<0){ *timeParameter += maxTime; } seconds = 0; sei(); for(int x = timeXPos; x < timeXPos + hourWidth + minuteWidth + 2*SPACE_TO_DOTS + TIMEDOT_WIDTH; x++){ for(int y = 0; y < timeYPos + BIG_NUMBER_HEIGHT; y++) reset_pixel(x,y); } print_time(timeType); if(maxTime == 60) print_symbol(8,HERZ_KLEIN_WIDTH,herzKleinOffenSymb,timeXPos+hourWidth + 2*SPACE_TO_DOTS + TIMEDOT_WIDTH + minuteWidth/2-4, 2); else print_symbol(8,HERZ_KLEIN_WIDTH,herzKleinOffenSymb,timeXPos+hourWidth/2-4, 2); update_LCD(); } goodNight(); check_light(); } cli(); btn_drehenc_pushed = false; sei(); }
void test_char_rnn(char *cfgfile, char *weightfile, int num, char *seed, float temp, int rseed, char *token_file) { char **tokens = 0; if(token_file){ size_t n; tokens = read_tokens(token_file, &n); } srand(rseed); char *base = basecfg(cfgfile); fprintf(stderr, "%s\n", base); network net = parse_network_cfg(cfgfile); if(weightfile){ load_weights(&net, weightfile); } int inputs = get_network_input_size(net); int i, j; for(i = 0; i < net.n; ++i) net.layers[i].temperature = temp; int c = 0; int len = strlen(seed); float *input = calloc(inputs, sizeof(float)); /* fill_cpu(inputs, 0, input, 1); for(i = 0; i < 10; ++i){ network_predict(net, input); } fill_cpu(inputs, 0, input, 1); */ for(i = 0; i < len-1; ++i){ c = seed[i]; input[c] = 1; network_predict(net, input); input[c] = 0; print_symbol(c, tokens); } if(len) c = seed[len-1]; print_symbol(c, tokens); for(i = 0; i < num; ++i){ input[c] = 1; float *out = network_predict(net, input); input[c] = 0; for(j = 32; j < 127; ++j){ //printf("%d %c %f\n",j, j, out[j]); } for(j = 0; j < inputs; ++j){ if (out[j] < .0001) out[j] = 0; } c = sample_array(out, inputs); print_symbol(c, tokens); } printf("\n"); }
void print_symbol(symbol *s){ /* print_symbol() - diagnostic function to print a symbol. Not very good */ if (s->character != ROOT_NODE && s->character != INTERNAL_NODE ){ print_symbol(s->left); print_symbol(s->right); } if (s!=NULL) printf("%c\n",s->character); }
void print_menuSelection(int item, int numItems){ remove_menuSelection(old_selectedItem, numItems); if(item<numItems){ print_symbol(16,16, herzSymb,2,2+item*15); } else { print_symbol(16,16, herzSymb, 92, 2+3*15); } old_selectedItem = item; }
void leave(void) { section *sec; symbol *sym; if(outfile) { fclose(outfile); if (errors) remove(outname); } if(DEBUG) { fprintf(stdout,"Sections:\n"); for(sec=first_section; sec; sec=sec->next) print_section(stdout,sec); fprintf(stdout,"Symbols:\n"); for(sym=first_symbol; sym; sym=sym->next) { print_symbol(stdout,sym); fprintf(stdout,"\n"); } } if(errors) exit(EXIT_FAILURE); else exit(EXIT_SUCCESS); }
static void show_trace(unsigned long *stack, unsigned long *endstack) { unsigned long addr; int i; pr_debug("Call trace:"); i = 0; while (stack + 1 <= endstack) { addr = *stack++; /* * If the address is either in the text segment of the * kernel, or in the region which contains vmalloc'ed * memory, it *may* be the address of a calling * routine; if so, print it so that someone tracing * down the cause of the crash will be able to figure * out the call path that was taken. */ if (__kernel_text_address(addr)) { #ifndef CONFIG_KALLSYMS if (i % 5 == 0) pr_debug("\n "); #endif pr_debug(" [<%08lx>]", addr); print_symbol(" %s\n", addr); i++; } } pr_debug("\n"); }
static void __report_bad_irq(unsigned int irq, struct irq_desc *desc, irqreturn_t action_ret) { struct irqaction *action; if (action_ret != IRQ_HANDLED && action_ret != IRQ_NONE) { printk(KERN_ERR "irq event %d: bogus return value %x\n", irq, action_ret); } else { printk(KERN_ERR "irq %d: nobody cared (try booting with " "the \"irqpoll\" option)\n", irq); } dump_stack(); printk(KERN_ERR "handlers:\n"); action = desc->action; while (action) { printk(KERN_ERR "[<%p>]", action->handler); print_symbol(" (%s)", (unsigned long)action->handler); printk("\n"); action = action->next; } }
static void print_trace_warning_symbol(void *data, char *msg, unsigned long symbol) { printk(data); print_symbol(msg, symbol); printk("\n"); }
void show_regs(struct pt_regs * regs) { unsigned long cr0 = 0L, cr2 = 0L, cr3 = 0L, cr4 = 0L; printk("\n"); printk("Pid: %d, comm: %20s\n", current->pid, current->comm); printk("EIP: %04x:[<%08lx>] CPU: %d\n",0xffff & regs->xcs,regs->eip, smp_processor_id()); print_symbol("EIP is at %s\n", regs->eip); if (user_mode_vm(regs)) printk(" ESP: %04x:%08lx",0xffff & regs->xss,regs->esp); printk(" EFLAGS: %08lx %s (%s %.*s)\n", regs->eflags, print_tainted(), system_utsname.release, (int)strcspn(system_utsname.version, " "), system_utsname.version); printk("EAX: %08lx EBX: %08lx ECX: %08lx EDX: %08lx\n", regs->eax,regs->ebx,regs->ecx,regs->edx); printk("ESI: %08lx EDI: %08lx EBP: %08lx", regs->esi, regs->edi, regs->ebp); printk(" DS: %04x ES: %04x\n", 0xffff & regs->xds,0xffff & regs->xes); cr0 = read_cr0(); cr2 = read_cr2(); cr3 = read_cr3(); cr4 = read_cr4_safe(); printk("CR0: %08lx CR2: %08lx CR3: %08lx CR4: %08lx\n", cr0, cr2, cr3, cr4); show_trace(NULL, regs, ®s->esp); }
static void __init do_initcalls(void) { initcall_t *call; int count = preempt_count(); for (call = &__initcall_start; call < &__initcall_end; call++) { char *msg; if (initcall_debug) { printk(KERN_DEBUG "Calling initcall 0x%p", *call); print_symbol(": %s()", (unsigned long) *call); printk("\n"); } (*call)(); msg = NULL; if (preempt_count() != count) { msg = "preemption imbalance"; preempt_count() = count; } if (irqs_disabled()) { msg = "disabled interrupts"; local_irq_enable(); } if (msg) { printk("error in initcall at 0x%p: " "returned with %s\n", *call, msg); } } /* Make sure there is no pending stuff from the initcall sequence */ flush_scheduled_work(); }
void print_snoozeLogo(){ uint8_t snoozeSymb[9]; for(int i=0; i<9; i++){ snoozeSymb[i] = pgm_read_byte(&snoozePic[0][i]); } print_symbol(8,9, snoozeSymb,1,1); }
void print_alarmLogo() { uint8_t weckerSymb[18];//72 for(int i=0; i<18; i++){//72 weckerSymb[i] = pgm_read_byte(¬e[0][i]); } print_symbol(16,9,weckerSymb,1,1); }
void set_year(){ cli(); btn_drehenc_pushed = false; sei(); while(!btn_drehenc_pushed){ if(rotary != 0){ year += rotary; cli(); rotary = 0; sei(); if (year < 0) { year = 9999; } if(year > 9999){ year -= 10000; } for(int x = 0; x<128; x++){ for(int y = 30; y<40; y++) reset_pixel(x,y); } for(int x = 0; x<90; x++){ for(int y = YPOS_YEAR; y<YPOS_YEAR + 17; y++){ reset_pixel(x,y); } } print_year(); print_symbol(8, HERZ_KLEIN_WIDTH, herzKleinOffenSymb, get_yearXPos() + get_yearWidth() / 2 - 4, YPOS_YEAR - 10); update_LCD(); } goodNight(); check_light(); } goodNight(); check_light(); }
void set_month(){ cli(); btn_drehenc_pushed = false; sei(); while(!btn_drehenc_pushed){ if(rotary != 0){ month += rotary; cli(); rotary = 0; sei(); month = month % 12; if (month < 0) { month += 12; } if(day > pgm_read_byte(&daysPerMonth[month])){ day = pgm_read_byte(&daysPerMonth[month]); } for(int x = 0; x<128; x++){ for(int y = 0; y<10; y++) reset_pixel(x,y); } print_date(POS_DATE_SET); print_symbol(8, HERZ_KLEIN_WIDTH, herzKleinOffenSymb, get_dateXPos() + get_dayWidth() + get_monthWidth() / 2 - 4, POS_DATE_SET - 10); update_LCD(); } goodNight(); check_light(); } }
void print_menuItems(char item1[], char item2[], char item3[], char item4[]){ clear_pixelMatrix(); int xPosItem = 20; int yPosItem = 3; //Item1 int item1_ASCII [strlen(item1)]; convertString(item1, item1_ASCII); print_ASCIIString(xPosItem, yPosItem, item1_ASCII, sizeof(item1_ASCII)/sizeof(item1_ASCII[0])); yPosItem += 15; //Item2 int item2_ASCII [strlen(item2)]; convertString(item2, item2_ASCII); print_ASCIIString(xPosItem, yPosItem, item2_ASCII, sizeof(item2_ASCII)/sizeof(item2_ASCII[0])); yPosItem += 15; //Item3 int item3_ASCII [strlen(item3)]; convertString(item3, item3_ASCII); print_ASCIIString(xPosItem, yPosItem, item3_ASCII, sizeof(item3_ASCII)/sizeof(item3_ASCII[0])); yPosItem += 15; //Item4 int item4_ASCII [strlen(item4)]; convertString(item4, item4_ASCII); print_ASCIIString(xPosItem, yPosItem, item4_ASCII, sizeof(item4_ASCII)/sizeof(item4_ASCII[0])); //Haken print_symbol(16,17, hakenSymb,108,46); }
static void __init _do_initcalls(int count,initcall_t* strt,initcall_t* end) { initcall_t *call; for(call=strt;call<end;call++) { char *msg; if (initcall_debug) { printk(KERN_DEBUG "Calling initcall 0x%p", *call); print_symbol(": %s()", (unsigned long) *call); printk("\n"); } (*call)(); msg=NULL; if(preempt_count()!=count) { msg="preemption imbalance"; preempt_count()=count; } if(irqs_disabled()) { msg="disabled interrupts"; local_irq_enable(); } if(msg) { printk("error in initcall at 0x%p: " "returned with %s\n",*call, msg); } } }
int __kprobes __die(const char *str, struct pt_regs *regs, long err) { unsigned short ss; unsigned long sp; printk(KERN_EMERG "%s: %04lx [#%d] ", str, err & 0xffff, ++die_counter); #ifdef CONFIG_PREEMPT printk("PREEMPT "); #endif #ifdef CONFIG_SMP printk("SMP "); #endif #ifdef CONFIG_DEBUG_PAGEALLOC printk("DEBUG_PAGEALLOC"); #endif printk("\n"); sysfs_printk_last_file(); if (notify_die(DIE_OOPS, str, regs, err, current->thread.trap_no, SIGSEGV) == NOTIFY_STOP) return 1; show_registers(regs); /* Executive summary in case the oops scrolled away */ sp = (unsigned long) (®s->sp); savesegment(ss, ss); if (user_mode(regs)) { sp = regs->sp; ss = regs->ss & 0xffff; } printk(KERN_EMERG "EIP: [<%08lx>] ", regs->ip); print_symbol("%s", regs->ip); printk(" SS:ESP %04x:%08lx\n", ss, sp); return 0; }
static void print_mce(struct mce *m) { pr_emerg("CPU %d: Machine Check Exception: %16Lx Bank %d: %016Lx\n", m->extcpu, m->mcgstatus, m->bank, m->status); if (m->ip) { pr_emerg("RIP%s %02x:<%016Lx> ", !(m->mcgstatus & MCG_STATUS_EIPV) ? " !INEXACT!" : "", m->cs, m->ip); if (m->cs == __KERNEL_CS) print_symbol("{%s}", m->ip); pr_cont("\n"); } pr_emerg("TSC %llx ", m->tsc); if (m->addr) pr_cont("ADDR %llx ", m->addr); if (m->misc) pr_cont("MISC %llx ", m->misc); pr_cont("\n"); pr_emerg("PROCESSOR %u:%x TIME %llu SOCKET %u APIC %x\n", m->cpuvendor, m->cpuid, m->time, m->socketid, m->apicid); /* * Print out human-readable details about the MCE error, * (if the CPU has an implementation for that) */ atomic_notifier_call_chain(&x86_mce_decoder_chain, 0, m); }
/// Print all symbols stored in the storage where the symbol data /// is shown in bytes. /// @param out The output stream to print to void print_storage(std::ostream& out) const { for(uint32_t i = 0; i < SuperCoder::symbols(); ++i) { print_symbol(out, i); } }
int gnu_output_handler(cflow_output_command cmd, FILE *outfile, int line, void *data, void *handler_data) { switch (cmd) { case cflow_output_begin: if (emacs_option) { fprintf(outfile, ";; This file is generated by %s. -*- cflow -*-", PACKAGE_STRING); newline(); } break; case cflow_output_init: case cflow_output_end: case cflow_output_separator: break; case cflow_output_newline: fprintf(outfile, "\n"); break; case cflow_output_text: fprintf(outfile, "%s", (char*) data); break; case cflow_output_symbol: return print_symbol(outfile, line, data); } return 0; }
static void print_mce(struct mce *m) { int ret = 0; pr_emerg(HW_ERR "CPU %d: Machine Check Exception: %Lx Bank %d: %016Lx\n", m->extcpu, m->mcgstatus, m->bank, m->status); if (m->ip) { pr_emerg(HW_ERR "RIP%s %02x:<%016Lx> ", !(m->mcgstatus & MCG_STATUS_EIPV) ? " !INEXACT!" : "", m->cs, m->ip); if (m->cs == __KERNEL_CS) print_symbol("{%s}", m->ip); pr_cont("\n"); } pr_emerg(HW_ERR "TSC %llx ", m->tsc); if (m->addr) pr_cont("ADDR %llx ", m->addr); if (m->misc) pr_cont("MISC %llx ", m->misc); pr_cont("\n"); pr_emerg(HW_ERR "PROCESSOR %u:%x TIME %llu SOCKET %u APIC %x microcode %x\n", m->cpuvendor, m->cpuid, m->time, m->socketid, m->apicid, cpu_data(m->extcpu).microcode); ret = atomic_notifier_call_chain(&x86_mce_decoder_chain, 0, m); if (ret == NOTIFY_STOP) return; pr_emerg_ratelimited(HW_ERR "Run the above through 'mcelog --ascii'\n"); }
void show_registers(struct pt_regs *regs) { char *mode; mode = user_mode(regs) ? "User" : "Krnl"; printk("%s PSW : %p %p", mode, (void *) regs->psw.mask, (void *) regs->psw.addr); print_symbol(" (%s)\n", regs->psw.addr & PSW_ADDR_INSN); printk(" R:%x T:%x IO:%x EX:%x Key:%x M:%x W:%x " "P:%x AS:%x CC:%x PM:%x", mask_bits(regs, PSW_MASK_PER), mask_bits(regs, PSW_MASK_DAT), mask_bits(regs, PSW_MASK_IO), mask_bits(regs, PSW_MASK_EXT), mask_bits(regs, PSW_MASK_KEY), mask_bits(regs, PSW_MASK_MCHECK), mask_bits(regs, PSW_MASK_WAIT), mask_bits(regs, PSW_MASK_PSTATE), mask_bits(regs, PSW_MASK_ASC), mask_bits(regs, PSW_MASK_CC), mask_bits(regs, PSW_MASK_PM)); #ifdef CONFIG_64BIT printk(" EA:%x", mask_bits(regs, PSW_MASK_EA | PSW_MASK_BA)); #endif printk("\n%s GPRS: " FOURLONG, mode, regs->gprs[0], regs->gprs[1], regs->gprs[2], regs->gprs[3]); printk(" " FOURLONG, regs->gprs[4], regs->gprs[5], regs->gprs[6], regs->gprs[7]); printk(" " FOURLONG, regs->gprs[8], regs->gprs[9], regs->gprs[10], regs->gprs[11]); printk(" " FOURLONG, regs->gprs[12], regs->gprs[13], regs->gprs[14], regs->gprs[15]); show_code(regs); }
void print_object (STREAM stream, D instance, BOOL escape_p, int print_depth) { enum dylan_type_enum type = dylan_type(instance); switch (type) { case integer_type: print_integer(stream, instance, escape_p, print_depth); break; case character_type: print_character(stream, instance, escape_p, print_depth); break; case float_type: print_float (stream, instance, escape_p, print_depth); break; case dylan_boolean_type: print_boolean(stream, instance, escape_p, print_depth); break; case string_type: print_string (stream, instance, escape_p, print_depth); break; case vector_type: print_vector(stream, instance, escape_p, print_depth); break; case pair_type: print_pair(stream, instance, escape_p, print_depth); break; case empty_list_type: print_empty_list(stream, instance, escape_p, print_depth); break; case symbol_type: print_symbol(stream, instance, escape_p, print_depth); break; case simple_condition_type: print_simple_condition(stream, instance, escape_p, print_depth); break; case class_type: print_class(stream, instance, escape_p, print_depth); break; case function_type: print_function(stream, instance, escape_p, print_depth); break; case unknown_type: format(stream, "?%lx", instance); break; default: print_user_defined(stream, instance, escape_p, print_depth); break; } }
int posix_output_handler(cflow_output_command cmd, FILE *outfile, int line, void *data, void *handler_data) { switch (cmd) { case cflow_output_init: /* Additional check for consistency */ if (emacs_option) error(EX_USAGE, 0, _("--format=posix is not compatible with --emacs")); brief_listing = print_line_numbers = omit_symbol_names_option = 1; break; case cflow_output_begin: case cflow_output_end: case cflow_output_separator: break; case cflow_output_newline: fprintf(outfile, "\n"); break; case cflow_output_text: fprintf(outfile, "%s", (char*) data); break; case cflow_output_symbol: return print_symbol(outfile, line, data); } return 0; }
/* * If 99,900 of the previous 100,000 interrupts have not been handled * then assume that the IRQ is stuck in some manner. Drop a diagnostic * and try to turn the IRQ off. * * (The other 100-of-100,000 interrupts may have been a correctly * functioning device sharing an IRQ with the failing one) */ static void __report_bad_irq(unsigned int irq, struct irq_desc *desc, irqreturn_t action_ret) { struct irqaction *action; unsigned long flags; if (action_ret != IRQ_HANDLED && action_ret != IRQ_NONE) { printk(KERN_ERR "irq event %d: bogus return value %x\n", irq, action_ret); } else { printk(KERN_ERR "irq %d: nobody cared (try booting with " "the \"irqpoll\" option)\n", irq); } dump_stack(); printk(KERN_ERR "handlers:\n"); /* * We need to take desc->lock here. note_interrupt() is called * w/o desc->lock held, but IRQ_PROGRESS set. We might race * with something else removing an action. It's ok to take * desc->lock here. See synchronize_irq(). */ raw_spin_lock_irqsave(&desc->lock, flags); action = desc->action; while (action) { printk(KERN_ERR "[<%p>]", action->handler); print_symbol(" (%s)", (unsigned long)action->handler); printk("\n"); action = action->next; } raw_spin_unlock_irqrestore(&desc->lock, flags); }
void BytecodePrinter::print_constant(int i, outputStream* st) { int orig_i = i; if (!check_index(orig_i, i, st)) return; ConstantPool* constants = method()->constants(); constantTag tag = constants->tag_at(i); if (tag.is_int()) { st->print_cr(" " INT32_FORMAT, constants->int_at(i)); } else if (tag.is_long()) { st->print_cr(" " INT64_FORMAT, constants->long_at(i)); } else if (tag.is_float()) { st->print_cr(" %f", constants->float_at(i)); } else if (tag.is_double()) { st->print_cr(" %f", constants->double_at(i)); } else if (tag.is_string()) { const char* string = constants->string_at_noresolve(i); st->print_cr(" %s", string); } else if (tag.is_klass()) { st->print_cr(" %s", constants->resolved_klass_at(i)->external_name()); } else if (tag.is_unresolved_klass()) { st->print_cr(" <unresolved klass at %d>", i); } else if (tag.is_method_type()) { int i2 = constants->method_type_index_at(i); st->print(" <MethodType> %d", i2); print_symbol(constants->symbol_at(i2), st); } else if (tag.is_method_handle()) { int kind = constants->method_handle_ref_kind_at(i); int i2 = constants->method_handle_index_at(i); st->print(" <MethodHandle of kind %d>", kind, i2); print_field_or_method(-i, i2, st); } else { st->print_cr(" bad tag=%d at %d", tag.value(), i); } }
/* * show a stack trace from the specified stack pointer */ void show_trace(unsigned long *sp) { unsigned long *stack, addr, module_start, module_end; int i; printk(KERN_EMERG "\n" KERN_EMERG "Call Trace:"); stack = sp; i = 0; module_start = VMALLOC_START; module_end = VMALLOC_END; while (((long) stack & (THREAD_SIZE - 1)) != 0) { addr = *stack++; if (__kernel_text_address(addr)) { #if 1 printk(" [<%08lx>]", addr); print_symbol(" %s", addr); printk("\n"); #else if ((i % 6) == 0) printk("\n" KERN_EMERG " "); printk("[<%08lx>] ", addr); i++; #endif } } printk("\n"); }