2 * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved.
4 * This file is part of libFirm.
6 * This file may be distributed and/or modified under the terms of the
7 * GNU General Public License version 2 as published by the Free Software
8 * Foundation and appearing in the file LICENSE.GPL included in the
9 * packaging of this file.
11 * Licensees holding valid libFirm Professional Edition licenses may use
12 * this file in accordance with the libFirm Commercial License.
13 * Agreement provided with the Software.
15 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * @brief Stabs support.
23 * @author Michael Beck
45 #include "be_dbgout.h"
48 /* Non-Stab Symbol and Stab Symbol Types */
50 N_UNDF = 0x00, /**< 0: Undefined symbol */
51 N_ABS = 0x02, /**< 2: File scope absolute symbol */
52 N_TEXT = 0x04, /**< 4: File scope text symbol */
53 N_DATA = 0x06, /**< 6: File scope data symbol */
54 N_BSS = 0x08, /**< 8: File scope BSS symbol */
55 N_INDR = 0x0A, /**< 10: Symbol is indirected to another symbol */
56 N_FN_SEQ = 0x0C, /**< 12: Same as N_FN, for Sequent compilers */
57 N_COMM = 0x12, /**< 18: Common--visible after shared library dynamic link */
58 N_SETA = 0x14, /**< 20: Absolute set element */
59 N_SETT = 0x17, /**< 23: Text segment set element */
60 N_SETD = 0x18, /**< 24: Data segment set element */
61 N_SETB = 0x1A, /**< 26: BSS segment set element */
62 N_SETV = 0x1C, /**< 28: Pointer to set vector */
63 N_WARNING = 0x1E, /**< 30: Print a warning message during linking */
64 N_FN = 0x1F, /**< 31: File name of a `.o' file */
65 N_GSYM = 0x20, /**< 32: Global symbol */
66 N_FNAME = 0x22, /**< 34: Function name (for BSD Fortran) */
67 N_FUN = 0x24, /**< 36: Function name */
68 N_STSYM = 0x26, /**< 38: Data segment file-scope variable */
69 N_LCSYM = 0x28, /**< 40: BSS segment file-scope variable */
70 N_MAIN = 0x2A, /**< 42: Name of main routine */
71 N_ROSYM = 0x2C, /**< 44: Variable in .rodata section */
72 N_PC = 0x30, /**< 48: Global symbol (for Pascal) */
73 N_NSYMS = 0x32, /**< 50: Number of symbols (according to Ultrix V4.0) */
74 N_NOMAP = 0x34, /**< 52: No DST map */
75 N_OBJ = 0x38, /**< 56: Object file (Solaris2) */
76 N_OPT = 0x3C, /**< 60: Debugger options (Solaris2) */
77 N_RSYM = 0x40, /**< 64: Register variable */
78 N_M2C = 0x42, /**< 66: Modula-2 compilation unit */
79 N_SLINE = 0x44, /**< 68: Line number in text segment */
80 N_DSLINE = 0x46, /**< 70: Line number in data segment */
81 N_BSLINE = 0x48, /**< 72: Line number in bss segment */
82 N_BROWS = 0x48, /**< 72: Sun source code browser, path to `.cb' file */
83 N_DEFD = 0x4A, /**< 74: GNU Modula2 definition module dependency */
84 N_FLINE = 0x4C, /**< 76: Function start/body/end line numbers (Solaris2) */
85 N_EHDECL = 0x50, /**< 80: GNU C++ exception variable */
86 N_MOD2 = 0x50, /**< 80: Modula2 info "for imc" (according to Ultrix V4.0) */
87 N_CATCH = 0x54, /**< 84: GNU C++ catch clause */
88 N_SSYM = 0x60, /**< 96: Structure of union element */
89 N_ENDM = 0x62, /**< 98: Last stab for module (Solaris2) */
90 N_SO = 0x64, /**< 100: Path and name of source file */
91 N_LSYM = 0x80, /**< 128: Stack variable */
92 N_BINCL = 0x82, /**< 130: Beginning of an include file (Sun only) */
93 N_SOL = 0x84, /**< 132: Name of include file */
94 N_PSYM = 0xA0, /**< 160: Parameter variable */
95 N_EINCL = 0xA2, /**< 162: End of an include file */
96 N_ENTRY = 0xA4, /**< 164: Alternate entry point */
97 N_LBRAC = 0xC0, /**< 192: Beginning of a lexical block */
98 N_EXCL = 0xC2, /**< 194: Place holder for a deleted include file */
99 N_SCOPE = 0xC4, /**< 196: Modula2 scope information (Sun linker) */
100 N_RBRAC = 0xE0, /**< 224: End of a lexical block */
101 N_BCOMM = 0xE2, /**< 226: Begin named common block */
102 N_ECOMM = 0xE4, /**< 228: End named common block */
103 N_ECOML = 0xE8, /**< 232: Member of a common block */
104 N_WITH = 0xEA, /**< 234: Pascal with statement: type,,0,0,offset (Solaris2) */
105 N_NBTEXT = 0xF0, /**< 240: Gould non-base registers */
106 N_NBDATA = 0xF2, /**< 242: Gould non-base registers */
107 N_NBBSS = 0xF4, /**< 244: Gould non-base registers */
108 N_NBSTS = 0xF6, /**< 246: Gould non-base registers */
109 N_NBLCS = 0xF8, /**< 248: Gould non-base registers */
115 typedef struct stabs_handle {
116 dbg_handle base; /**< the base class */
117 FILE *f; /**< the file write to */
118 ir_entity *cur_ent; /**< current method entity */
119 const be_stack_layout_t *layout; /**< current stack layout */
120 unsigned next_type_nr; /**< next type number */
121 pmap *type_map; /**< a map from type to type number */
122 const char *main_file; /**< name of the main source file */
123 const char *curr_file; /**< name of the current source file */
127 * Returns the stabs type number of a Firm type.
129 static unsigned get_type_number(stabs_handle *h, ir_type *tp) {
134 /* map to the void type */
137 entry = pmap_find(h->type_map, tp);
139 num = h->next_type_nr++;
140 pmap_insert(h->type_map, tp, INT_TO_PTR(num));
142 num = PTR_TO_INT(entry->value);
145 } /* get_type_number */
148 * Map a given Type to void by assigned the type number 0.
150 static void map_to_void(stabs_handle *h, ir_type *tp) {
151 pmap_insert(h->type_map, tp, INT_TO_PTR(0));
155 * generate the void type.
157 static void gen_void_type(stabs_handle *h) {
158 fprintf(h->f, "\t.stabs\t\"void:t%u=%u\",%d,0,0,0\n", 0, 0, N_LSYM);
159 } /* gen_void_type */
161 typedef struct walker_env {
166 /* a type is not ready: put it on the wait queue */
167 #define SET_TYPE_NOT_READY(wq, tp) \
169 set_type_link(tp, (void *)1); \
174 #define SET_TYPE_READY(tp) set_type_link(tp, NULL)
176 /* check whether a type is ready */
177 #define IS_TYPE_READY(tp) (get_type_link(tp) == NULL)
179 #ifdef EXPLICITE_PTR_TYPES
180 #define SKIP_PTR(tp) tp
182 #define SKIP_PTR(tp) (is_Pointer_type(tp) ? get_pointer_points_to_type(tp) : tp)
186 * Generates a primitive type.
188 * @param h the stabs handle
191 static void gen_primitive_type(stabs_handle *h, ir_type *tp) {
192 ir_mode *mode = get_type_mode(tp);
196 if (mode == mode_T) {
197 /* firmcc, jack and the FirmJC compiler use mode_T for the void type.
198 Ignore it here as it's name is remapped to "void". */
203 if (0 && get_mode_size_bits(mode) & 7) {
204 /* this is a bitfield type, ignore it */
208 type_num = get_type_number(h, tp);
210 if (mode_is_int(mode) || mode_is_character(mode)) {
212 fprintf(h->f, "\t.stabs\t\"%s:t%u=r%u;", get_type_name(tp), type_num, type_num);
213 tarval_snprintf(buf, sizeof(buf), get_mode_min(mode));
214 fprintf(h->f, "%s;", buf);
215 tarval_snprintf(buf, sizeof(buf), get_mode_max(mode));
216 fprintf(h->f, "%s;\",%d,0,0,0\n", buf, N_LSYM);
217 } else if (mode_is_float(mode)) {
218 int size = get_type_size_bytes(tp);
219 fprintf(h->f, "\t.stabs\t\"%s:t%u=r1;%d;0;\",%d,0,0,0\n", get_type_name(tp), type_num, size, N_LSYM);
221 } /* gen_primitive_type */
224 * Generates an enum type
226 * @param h the stabs handle
229 static void gen_enum_type(stabs_handle *h, ir_type *tp) {
230 unsigned type_num = get_type_number(h, tp);
234 fprintf(h->f, "\t.stabs\t\"%s:T%u=e", get_type_name(tp), type_num);
235 for (i = 0, n = get_enumeration_n_enums(tp); i < n; ++i) {
236 ir_enum_const *ec = get_enumeration_const(tp, i);
239 tarval_snprintf(buf, sizeof(buf), get_enumeration_value(ec));
240 fprintf(h->f, "%s:%s,", get_enumeration_name(ec), buf);
242 fprintf(h->f, ";\",%d,0,0,0\n", N_LSYM);
243 } /* gen_enum_type */
246 * print a pointer type
248 void print_pointer_type(wenv_t *env, ir_type *tp, int local) {
249 stabs_handle *h = env->h;
250 unsigned type_num = local ? h->next_type_nr++ : get_type_number(h, tp);
251 ir_type *el_tp = get_pointer_points_to_type(tp);
252 unsigned el_num = get_type_number(h, el_tp);
254 fprintf(h->f, "%u=*%u", type_num, el_num);
258 * Generates a pointer type
260 * @param env the walker environment
263 static void gen_pointer_type(wenv_t *env, ir_type *tp) {
264 stabs_handle *h = env->h;
265 ir_type *el_tp = get_pointer_points_to_type(tp);
268 if (! IS_TYPE_READY(el_tp))
269 waitq_put(env->wq, el_tp);
271 fprintf(h->f, "\t.stabs\t\"%s:t", get_type_name(tp));
272 print_pointer_type(env, tp, 0);
273 fprintf(h->f, "\",%d,0,0,0\n", N_LSYM);
274 } /* gen_pointer_type */
277 * print an array type
279 static void print_array_type(wenv_t *env, ir_type *tp, int local) {
280 stabs_handle *h = env->h;
281 ir_type *etp = get_array_element_type(tp);
282 int i, n = get_array_n_dimensions(tp);
283 unsigned type_num = local ? h->next_type_nr++ : get_type_number(h, tp);
286 fprintf(h->f, "%u=a", type_num);
287 NEW_ARR_A(int, perm, n);
288 for (i = 0; i < n; ++i) {
289 perm[i] = get_array_order(tp, i);
292 for (i = 0; i < n; ++i) {
295 if (is_Const(get_array_lower_bound(tp, dim)) && is_Const(get_array_upper_bound(tp, dim))) {
296 long min = get_array_lower_bound_int(tp, dim);
297 long max = get_array_upper_bound_int(tp, dim);
299 /* FIXME r1 must be integer type, but seems to work for now */
300 fprintf(h->f, "r1;%ld;%ld;", min, max-1);
304 type_num = get_type_number(h, etp);
305 fprintf(h->f, "%d", type_num);
309 * Generates an array type
311 * @param env the walker environment
314 static void gen_array_type(wenv_t *env, ir_type *tp) {
315 stabs_handle *h = env->h;
316 ir_type *etp = get_array_element_type(tp);
319 if (! IS_TYPE_READY(etp))
320 waitq_put(env->wq, etp);
322 fprintf(h->f, "\t.stabs\t\"%s:t", get_type_name(tp));
324 print_array_type(env, tp, 0);
326 fprintf(h->f, "\",%d,0,0,0\n", N_LSYM);
327 } /* gen_array_type */
330 * Generates a struct/union type
332 * @param env the walker environment
335 static void gen_struct_union_type(wenv_t *env, ir_type *tp) {
336 stabs_handle *h = env->h;
337 unsigned type_num = get_type_number(h, tp);
342 if (is_Struct_type(tp)) {
344 if (get_type_mode(tp) != NULL) {
345 /* this is a bitfield type, ignore it safely */
349 else if (is_Union_type(tp))
352 fprintf(h->f, "\t.stabs\t\"%s:Tt%u=%c%d",
353 get_type_name(tp), type_num, desc, get_type_size_bytes(tp));
355 for (i = 0, n = get_compound_n_members(tp); i < n; ++i) {
356 ir_entity *ent = get_compound_member(tp, i);
357 ir_type *mtp = get_entity_type(ent);
360 if (! IS_TYPE_READY(mtp))
361 waitq_put(env->wq, mtp);
362 ofs = get_entity_offset(ent);
363 if (is_Struct_type(mtp) && get_type_mode(mtp) != NULL) {
364 /* this structure is a bitfield, skip */
367 for (i = 0, n = get_struct_n_members(mtp); i < n; ++i) {
368 ir_entity *ent = get_struct_member(mtp, i);
369 ir_type *tp = get_entity_type(ent);
372 type_num = get_type_number(h, tp);
373 size = get_type_size_bits(tp);
374 bofs = (ofs + get_entity_offset(ent)) * 8 + get_entity_offset_bits_remainder(ent);
376 /* name:type, bit offset from the start of the struct', number of bits in the element. */
377 fprintf(h->f, "%s:%u,%d,%d;", get_entity_name(ent), type_num, bofs, size);
381 fprintf(h->f, "%s:", get_entity_name(ent));
383 if (is_Array_type(mtp)) {
384 /* use a local array definition */
385 print_array_type(env, mtp, 1);
386 } else if (is_Pointer_type(mtp)) {
387 /* use local pointer definition */
388 print_pointer_type(env, mtp, 1);
390 type_num = get_type_number(h, mtp);
392 /* name:type, bit offset from the start of the struct', number of bits in the element. */
393 fprintf(h->f, "%u", type_num);
395 size = get_type_size_bits(mtp);
396 fprintf(h->f, ",%d,%d;", ofs * 8, size);
399 fprintf(h->f, ";\",%d,0,0,0\n", N_LSYM);
400 } /* gen_struct_type */
403 * Generates a method type
405 * @param env the walker environment
408 static void gen_method_type(wenv_t *env, ir_type *tp) {
409 stabs_handle *h = env->h;
410 unsigned type_num = get_type_number(h, tp);
412 unsigned res_type_num;
413 int i, n = get_method_n_ress(tp);
417 rtp = get_method_res_type(tp, 0);
418 if (! IS_TYPE_READY(rtp))
419 waitq_put(env->wq, rtp);
421 res_type_num = get_type_number(h, rtp);
423 fprintf(h->f, "\t.stabs\t\"%s:t%u=f%u", get_type_name(tp), type_num, res_type_num);
425 /* handle more than one return type */
426 for (i = 1; i < n; ++i) {
427 rtp = get_method_res_type(tp, i);
428 if (! IS_TYPE_READY(rtp))
429 waitq_put(env->wq, rtp);
430 res_type_num = get_type_number(h, rtp);
431 fprintf(h->f, ",%u", res_type_num);
433 fprintf(h->f, "\",%d,0,0,0\n", N_LSYM);
434 } /* gen_method_type */
437 * type-walker: generate declaration for simple types,
438 * put all other types on a wait queue
440 static void walk_type(type_or_ent *tore, void *ctx)
445 if (get_kind(tore) == k_type) {
446 tp = (ir_type *)tore;
448 /* ignore the unknown type */
449 if (tp == firm_unknown_type)
455 switch (get_type_tpop_code(tp)) {
457 if (tp == get_glob_type()) {
464 gen_struct_union_type(env, tp);
467 case tpo_enumeration:
468 gen_enum_type(env->h, tp);
472 gen_primitive_type(env->h, tp);
476 gen_method_type(env, tp);
480 gen_array_type(env, tp);
484 gen_pointer_type(env, tp);
488 /* the unknown type: ignore */
492 assert(! "Unknown tpop code");
497 * generate declaration for all types
499 static void finish_types(wenv_t *env)
504 while (! waitq_empty(wq)) {
506 if (IS_TYPE_READY(tp))
509 switch (get_type_tpop_code(tp)) {
511 gen_method_type(env, tp);
516 gen_struct_union_type(env, tp);
518 case tpo_enumeration:
519 gen_enum_type(env->h, tp);
522 gen_primitive_type(env->h, tp);
525 gen_array_type(env, tp);
528 gen_pointer_type(env, tp);
531 /* the unknown type: ignore */
535 assert(! "Unknown tpop code");
541 * generate all types.
543 static void gen_types(stabs_handle *h) {
547 env.wq = new_waitq();
548 type_walk(NULL, walk_type, &env);
554 /* -------------------------- I/F ----------------------------- */
557 * start a new source object (compilation unit)
559 static void stabs_so(dbg_handle *handle, const char *filename) {
560 stabs_handle *h = (stabs_handle *)handle;
561 h->main_file = h->curr_file = filename;
562 fprintf(h->f, "\t.stabs\t\"%s\",%d,0,0,.Ltext0\n", filename, N_SO);
566 * end an include file
568 static void stabs_include_end(dbg_handle *handle) {
569 stabs_handle *h = (stabs_handle *)handle;
570 h->curr_file = h->main_file;
571 } /* stabs_include_end */
574 * start an include file
576 static void stabs_include_begin(dbg_handle *handle, const char *filename) {
577 stabs_handle *h = (stabs_handle *)handle;
578 if (h->main_file != h->curr_file)
579 stabs_include_end(handle);
580 h->curr_file = filename;
581 fprintf(h->f, "\t.stabs\t\"%s\",%d,0,0,0\n", filename, N_SOL);
582 } /* stabs_include_begin */
587 static void stabs_main_program(dbg_handle *handle) {
588 stabs_handle *h = (stabs_handle *)handle;
589 ir_graph *irg = get_irp_main_irg();
591 fprintf(h->f, "\t.stabs\t\"%s\",%d,0,0,0\n", get_entity_name(get_irg_entity(irg)), N_MAIN);
593 } /* stabs_main_program */
596 * prints a line number
598 static void stabs_line(dbg_handle *handle, unsigned lineno, const char *address) {
599 stabs_handle *h = (stabs_handle *)handle;
600 fprintf(h->f, "\t.stabn\t%d, 0, %u, %s-%s\n", N_SLINE, lineno, address, get_entity_ld_name(h->cur_ent));
604 * dump the stabs for a method begin
606 static void stabs_method_begin(dbg_handle *handle, ir_entity *ent, const be_stack_layout_t *layout) {
607 stabs_handle *h = (stabs_handle *)handle;
610 int i, n, between_size;
615 /* create the method entry */
616 mtp = get_entity_type(ent);
617 if (is_lowered_type(mtp))
618 mtp = get_associated_type(mtp);
619 if (get_method_n_ress(mtp) > 0)
620 rtp = get_method_res_type(mtp, 0);
623 type_num = get_type_number(h, rtp);
624 fprintf(h->f, "\t.stabs\t\"%s:%c%u\",%u,0,0,%s\n",
625 get_entity_name(ent),
626 get_entity_visibility(ent) == visibility_external_visible ? 'F' : 'f',
629 get_entity_ld_name(ent));
631 /* create parameter entries */
632 between_size = get_type_size_bytes(layout->between_type);
633 for (i = 0, n = get_method_n_params(mtp); i < n; ++i) {
634 ir_type *ptp = get_method_param_type(mtp, i);
635 const char *name = get_method_param_name(mtp, i);
636 unsigned type_num = get_type_number(h, ptp);
639 ir_entity *stack_ent;
642 snprintf(buf, sizeof(buf), "arg%d", i);
645 /* check if this parameter has a stack entity. If it has, it
646 it transmitted on the stack, else in a register */
647 stack_ent = layout->param_map[i];
649 ofs = get_entity_offset(stack_ent) + between_size;
651 fprintf(h->f, "\t.stabs\t\"%s:p%u\",%d,0,0,%d\n", name, type_num, N_PSYM, ofs);
653 } /* stabs_method_begin */
656 * dump the stabs for a method end
658 static void stabs_method_end(dbg_handle *handle) {
659 stabs_handle *h = (stabs_handle *)handle;
660 ir_entity *ent = h->cur_ent;
661 const be_stack_layout_t *layout = h->layout;
662 const char *ld_name = get_entity_ld_name(ent);
663 int i, n, frame_size;
664 static unsigned scope_nr = 0;
666 /* create entries for automatic variables on the stack */
667 frame_size = get_type_size_bytes(layout->frame_type);
668 for (i = 0, n = get_compound_n_members(layout->frame_type); i < n; ++i) {
669 ir_entity *ent = get_compound_member(layout->frame_type, i);
674 /* ignore spill slots and other helper objects */
675 if (is_entity_compiler_generated(ent))
678 tp = get_entity_type(ent);
679 /* should not happen in backend but ... */
680 if (is_Method_type(tp))
682 type_num = get_type_number(h, tp);
683 ofs = -frame_size + get_entity_offset(ent);
685 fprintf(h->f, "\t.stabs\t\"%s:%u\",%d,0,0,%d\n",
686 get_entity_name(ent), type_num, N_LSYM, ofs);
688 /* we need a lexical block here */
689 fprintf(h->f, "\t.stabn\t%d,0,0,%s-%s\n", N_LBRAC, ld_name, ld_name);
690 fprintf(h->f, "\t.stabn\t%d,0,0,.Lscope%u-%s\n", N_RBRAC, scope_nr, ld_name);
691 fprintf(h->f, ".Lscope%u:\n", scope_nr);
696 } /* stabs_method_end */
701 static void stabs_types(dbg_handle *handle) {
702 stabs_handle *h = (stabs_handle *)handle;
704 /* allocate the zero for the void type */
711 * dump a variable in the global type
713 static void stabs_variable(dbg_handle *handle, struct obstack *obst, ir_entity *ent) {
714 stabs_handle *h = (stabs_handle *)handle;
715 unsigned tp_num = get_type_number(h, get_entity_type(ent));
718 if (get_entity_visibility(ent) == visibility_external_visible) {
719 /* a global variable */
720 snprintf(buf, sizeof(buf), "\t.stabs\t\"%s:G%u\",%d,0,0,0\n",
721 get_entity_name(ent), tp_num, N_GSYM);
722 } else { /* some kind of local */
723 ir_variability variability = get_entity_variability(ent);
726 if (variability == variability_uninitialized)
728 else if (variability == variability_constant)
730 snprintf(buf, sizeof(buf), "\t.stabs\t\"%s:S%u\",%d,0,0,%s\n",
731 get_entity_name(ent), tp_num, kind, get_entity_ld_name(ent));
733 buf[sizeof(buf) - 1] = '\0';
736 obstack_printf(obst, "%s", buf);
738 fprintf(h->f, "%s", buf);
739 } /* stabs_variable */
742 * Close the stabs handler.
744 static void stabs_close(dbg_handle *handle) {
745 stabs_handle *h = (stabs_handle *)handle;
746 pmap_destroy(h->type_map);
750 /** The stabs operations. */
751 static const debug_ops stabs_ops = {
764 /* Opens the NULL handler */
765 dbg_handle *be_nulldbg_open(void) {
767 } /* be_nulldbg_open */
769 /* Opens a stabs handler */
770 dbg_handle *be_stabs_open(FILE *out) {
771 stabs_handle *h = xmalloc(sizeof(*h));
773 h->base.ops = &stabs_ops;
778 h->type_map = pmap_create_ex(64);
785 /** close a debug handler. */
786 void be_dbg_close(dbg_handle *h) {
787 if (h && h->ops->close)
792 * start a new source object (compilation unit)
794 void be_dbg_so(dbg_handle *h, const char *filename) {
796 h->ops->so(h, filename);
800 * start an include file
802 void be_dbg_include_begin(dbg_handle *h, const char *filename) {
803 if (h && h->ops->include_begin)
804 h->ops->include_begin(h, filename);
805 } /* stabs_include_begin */
808 * end an include file
810 void be_dbg_include_end(dbg_handle *h) {
811 if (h && h->ops->include_end)
812 h->ops->include_end(h);
813 } /* stabs_include_end */
818 void be_dbg_main_program(dbg_handle *h) {
819 if (h && h->ops->main_program)
820 h->ops->main_program(h);
821 } /* be_dbg_main_program */
823 /** debug for a method begin */
824 void be_dbg_method_begin(dbg_handle *h, ir_entity *ent, const be_stack_layout_t *layout) {
825 if (h && h->ops->method_begin)
826 h->ops->method_begin(h, ent, layout);
827 } /* be_dbg_method_begin */
829 /** debug for a method end */
830 void be_dbg_method_end(dbg_handle *h) {
831 if (h && h->ops->method_end)
832 h->ops->method_end(h);
833 } /* be_dbg_method_end */
835 /** debug for line number */
836 void be_dbg_line(dbg_handle *h, unsigned lineno, const char *address) {
837 if (h && h->ops->line)
838 h->ops->line(h, lineno, address);
842 void be_dbg_types(dbg_handle *h) {
843 if (h && h->ops->types)
848 void be_dbg_variable(dbg_handle *h, struct obstack *obst, ir_entity *ent) {
849 if (h && h->ops->variable)
850 h->ops->variable(h, obst, ent);
851 } /* be_dbg_variable */