aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.trace
ModeNameSize
-rw-r--r--actions-changed.c1205logplain
-rw-r--r--actions-changed.exp4757logplain
-rw-r--r--actions.c4946logplain
-rw-r--r--actions.exp11337logplain
-rw-r--r--ax.exp5884logplain
-rw-r--r--backtrace.exp10531logplain
-rw-r--r--change-loc-1.c867logplain
-rw-r--r--change-loc-2.c814logplain
-rw-r--r--change-loc.c1203logplain
-rw-r--r--change-loc.exp11520logplain
-rw-r--r--change-loc.h851logplain
-rw-r--r--circ.c1575logplain
-rw-r--r--circ.exp8563logplain
-rw-r--r--collection.c7720logplain
-rw-r--r--collection.exp25373logplain
-rw-r--r--deltrace.exp6710logplain
-rw-r--r--disconnected-tracing.c905logplain
-rw-r--r--disconnected-tracing.exp4207logplain
-rw-r--r--entry-values.c1094logplain
-rw-r--r--entry-values.exp7022logplain
-rw-r--r--ftrace-lock.c2240logplain
-rw-r--r--ftrace-lock.exp2640logplain
-rw-r--r--ftrace.c1331logplain
-rw-r--r--ftrace.exp5469logplain
-rw-r--r--infotrace.exp4319logplain
-rw-r--r--mi-trace-frame-collected.exp5956logplain
-rw-r--r--mi-trace-unavailable.exp7566logplain
-rw-r--r--mi-traceframe-changed.exp4306logplain
-rw-r--r--mi-tracepoint-changed.exp7439logplain
-rw-r--r--mi-tsv-changed.exp6200logplain
-rw-r--r--no-attach-trace.c886logplain
-rw-r--r--no-attach-trace.exp1585logplain
-rw-r--r--packetlen.exp2259logplain
-rw-r--r--passc-dyn.exp3888logplain
-rw-r--r--passcount.exp8420logplain
-rw-r--r--pending.c1192logplain
-rw-r--r--pending.exp15825logplain
-rw-r--r--pendshr1.c844logplain
-rw-r--r--pendshr2.c845logplain
-rw-r--r--pr16508.exp1814logplain
-rw-r--r--qtro.c839logplain
-rw-r--r--qtro.exp4300logplain
-rw-r--r--range-stepping.c1872logplain
-rw-r--r--range-stepping.exp2546logplain
-rw-r--r--read-memory.c1075logplain
-rw-r--r--read-memory.exp4941logplain
-rw-r--r--report.exp12472logplain
-rw-r--r--save-trace.exp5428logplain
-rw-r--r--signal.c1365logplain
-rw-r--r--signal.exp5953logplain
-rw-r--r--stap-trace.c1580logplain
-rw-r--r--stap-trace.exp3257logplain
-rw-r--r--status-stop.c1097logplain
-rw-r--r--status-stop.exp3125logplain
-rw-r--r--strace.c1097logplain
-rw-r--r--strace.exp10982logplain
-rw-r--r--tfile.c7021logplain
-rw-r--r--tfile.exp5398logplain
-rw-r--r--tfind.exp12170logplain
-rw-r--r--trace-break.c1102logplain
-rw-r--r--trace-break.exp13354logplain
-rw-r--r--trace-buffer-size.c871logplain
-rw-r--r--trace-buffer-size.exp3597logplain
-rw-r--r--trace-common.h1772logplain
-rw-r--r--trace-condition.c1186logplain
-rw-r--r--trace-condition.exp12668logplain
-rw-r--r--trace-enable-disable.c991logplain
-rw-r--r--trace-enable-disable.exp3775logplain
-rw-r--r--trace-mt.c1175logplain
-rw-r--r--trace-mt.exp4033logplain
-rw-r--r--trace-unavailable.c1008logplain
-rw-r--r--tracecmd.exp5411logplain
-rw-r--r--tracefile-pseudo-reg.c1339logplain
-rw-r--r--tracefile-pseudo-reg.exp2095logplain
-rw-r--r--tspeed.c4969logplain
-rw-r--r--tspeed.exp3280logplain
-rw-r--r--tstatus.exp5802logplain
-rw-r--r--tsv.exp6172logplain
-rw-r--r--unavailable-dwarf-piece.c1762logplain
-rw-r--r--unavailable-dwarf-piece.exp8436logplain
-rw-r--r--unavailable.cc8515logplain
-rw-r--r--unavailable.exp24514logplain
-rw-r--r--while-dyn.exp2606logplain
-rw-r--r--while-stepping.exp5038logplain
opt">= LDPR_UNKNOWN; continue; } /* Determine resolution from blhe type and symbol's original type. */ if (blhe->type == bfd_link_hash_undefined || blhe->type == bfd_link_hash_undefweak) { syms[n].resolution = LDPR_UNDEF; continue; } if (blhe->type != bfd_link_hash_defined && blhe->type != bfd_link_hash_defweak && blhe->type != bfd_link_hash_common) { /* We should not have a new, indirect or warning symbol here. */ einfo ("%P%F: %s: plugin symbol table corrupt (sym type %d)", called_plugin->name, blhe->type); } /* We need to know if the sym is referenced from non-IR files. */ ironly = !bfd_hash_lookup (non_ironly_hash, syms[n].name, FALSE, FALSE); /* If it was originally undefined or common, then it has been resolved; determine how. */ if (syms[n].def == LDPK_UNDEF || syms[n].def == LDPK_WEAKUNDEF || syms[n].def == LDPK_COMMON) { asection *owner_sec = (blhe->type == bfd_link_hash_common) ? blhe->u.c.p->section : blhe->u.def.section; if (owner_sec->owner == link_info.output_bfd) syms[n].resolution = LDPR_RESOLVED_EXEC; else if (owner_sec->owner == abfd) syms[n].resolution = (ironly) ? LDPR_PREVAILING_DEF_IRONLY : LDPR_PREVAILING_DEF; else if (is_ir_dummy_bfd (owner_sec->owner)) syms[n].resolution = LDPR_RESOLVED_IR; else if (owner_sec->owner->flags & DYNAMIC) syms[n].resolution = LDPR_RESOLVED_DYN; else syms[n].resolution = LDPR_RESOLVED_EXEC; continue; } /* Was originally def, or weakdef. Does it prevail? If the owner is the original dummy bfd that supplied it, then this is the definition that has prevailed. */ if (blhe->u.def.section->owner == link_info.output_bfd) syms[n].resolution = LDPR_PREEMPTED_REG; else if (blhe->u.def.section->owner == abfd) { syms[n].resolution = (ironly) ? LDPR_PREVAILING_DEF_IRONLY : LDPR_PREVAILING_DEF; continue; } /* Was originally def, weakdef, or common, but has been pre-empted. */ syms[n].resolution = is_ir_dummy_bfd (blhe->u.def.section->owner) ? LDPR_PREEMPTED_IR : LDPR_PREEMPTED_REG; } return LDPS_OK; } /* Add a new (real) input file generated by a plugin. */ static enum ld_plugin_status add_input_file (const char *pathname) { ASSERT (called_plugin); if (!lang_add_input_file (xstrdup (pathname), lang_input_file_is_file_enum, NULL)) return LDPS_ERR; return LDPS_OK; } /* Add a new (real) library required by a plugin. */ static enum ld_plugin_status add_input_library (const char *pathname) { ASSERT (called_plugin); if (!lang_add_input_file (xstrdup (pathname), lang_input_file_is_l_enum, NULL)) return LDPS_ERR; return LDPS_OK; } /* Set the extra library path to be used by libraries added via add_input_library. */ static enum ld_plugin_status set_extra_library_path (const char *path) { ASSERT (called_plugin); ldfile_add_library_path (xstrdup (path), FALSE); return LDPS_OK; } /* Issue a diagnostic message from a plugin. */ static enum ld_plugin_status message (int level, const char *format, ...) { va_list args; va_start (args, format); switch (level) { case LDPL_INFO: vfinfo (stdout, format, args, FALSE); break; case LDPL_WARNING: vfinfo (stdout, format, args, TRUE); break; case LDPL_FATAL: case LDPL_ERROR: default: { char *newfmt = ACONCAT ((level == LDPL_FATAL ? "%F" : "%X", format, NULL)); vfinfo (stderr, newfmt, args, TRUE); } break; } va_end (args); return LDPS_OK; } /* Helper to size leading part of tv array and set it up. */ static size_t set_tv_header (struct ld_plugin_tv *tv) { size_t i; /* Version info. */ static const unsigned int major = (unsigned)(BFD_VERSION / 100000000UL); static const unsigned int minor = (unsigned)(BFD_VERSION / 1000000UL) % 100; if (!tv) return tv_header_size; for (i = 0; i < tv_header_size; i++) { tv[i].tv_tag = tv_header_tags[i]; #define TVU(x) tv[i].tv_u.tv_ ## x switch (tv[i].tv_tag) { case LDPT_MESSAGE: TVU(message) = message; break; case LDPT_API_VERSION: TVU(val) = LD_PLUGIN_API_VERSION; break; case LDPT_GNU_LD_VERSION: TVU(val) = major * 100 + minor; break; case LDPT_LINKER_OUTPUT: TVU(val) = link_info.relocatable ? LDPO_REL : (link_info.shared ? LDPO_DYN : LDPO_EXEC); break; case LDPT_OUTPUT_NAME: TVU(string) = output_filename; break; case LDPT_REGISTER_CLAIM_FILE_HOOK: TVU(register_claim_file) = register_claim_file; break; case LDPT_REGISTER_ALL_SYMBOLS_READ_HOOK: TVU(register_all_symbols_read) = register_all_symbols_read; break; case LDPT_REGISTER_CLEANUP_HOOK: TVU(register_cleanup) = register_cleanup; break; case LDPT_ADD_SYMBOLS: TVU(add_symbols) = add_symbols; break; case LDPT_GET_INPUT_FILE: TVU(get_input_file) = get_input_file; break; case LDPT_RELEASE_INPUT_FILE: TVU(release_input_file) = release_input_file; break; case LDPT_GET_SYMBOLS: TVU(get_symbols) = get_symbols; break; case LDPT_ADD_INPUT_FILE: TVU(add_input_file) = add_input_file; break; case LDPT_ADD_INPUT_LIBRARY: TVU(add_input_library) = add_input_library; break; case LDPT_SET_EXTRA_LIBRARY_PATH: TVU(set_extra_library_path) = set_extra_library_path; break; default: /* Added a new entry to the array without adding a new case to set up its value is a bug. */ FAIL (); } #undef TVU } return tv_header_size; } /* Append the per-plugin args list and trailing LDPT_NULL to tv. */ static void set_tv_plugin_args (plugin_t *plugin, struct ld_plugin_tv *tv) { plugin_arg_t *arg = plugin->args; while (arg) { tv->tv_tag = LDPT_OPTION; tv->tv_u.tv_string = arg->arg; arg = arg->next; tv++; } tv->tv_tag = LDPT_NULL; tv->tv_u.tv_val = 0; } /* Load up and initialise all plugins after argument parsing. */ int plugin_load_plugins (void) { struct ld_plugin_tv *my_tv; unsigned int max_args = 0; plugin_t *curplug = plugins_list; /* If there are no plugins, we need do nothing this run. */ if (!curplug) return 0; /* First pass over plugins to find max # args needed so that we can size and allocate the tv array. */ while (curplug) { if (curplug->n_args > max_args) max_args = curplug->n_args; curplug = curplug->next; } /* Allocate tv array and initialise constant part. */ my_tv = xmalloc ((max_args + 1 + tv_header_size) * sizeof *my_tv); set_tv_header (my_tv); /* Pass over plugins again, activating them. */ curplug = plugins_list; while (curplug) { enum ld_plugin_status rv; ld_plugin_onload onloadfn = dlsym (curplug->dlhandle, "onload"); if (!onloadfn) onloadfn = dlsym (curplug->dlhandle, "_onload"); if (!onloadfn) return set_plugin_error (curplug->name); set_tv_plugin_args (curplug, &my_tv[tv_header_size]); called_plugin = curplug; rv = (*onloadfn) (my_tv); called_plugin = NULL; if (rv != LDPS_OK) return set_plugin_error (curplug->name); curplug = curplug->next; } /* Since plugin(s) inited ok, assume they're going to want symbol resolutions, which needs us to track which symbols are referenced by non-IR files using the linker's notice callback. */ link_info.notice_all = TRUE; return 0; } /* Call 'claim file' hook for all plugins. */ int plugin_call_claim_file (const struct ld_plugin_input_file *file, int *claimed) { plugin_t *curplug = plugins_list; *claimed = FALSE; if (no_more_claiming) return 0; while (curplug && !*claimed) { if (curplug->claim_file_handler) { enum ld_plugin_status rv; called_plugin = curplug; rv = (*curplug->claim_file_handler) (file, claimed); called_plugin = NULL; if (rv != LDPS_OK) set_plugin_error (curplug->name); } curplug = curplug->next; } return plugin_error_p () ? -1 : 0; } /* Call 'all symbols read' hook for all plugins. */ int plugin_call_all_symbols_read (void) { plugin_t *curplug = plugins_list; /* Disable any further file-claiming. */ no_more_claiming = TRUE; /* If --allow-multiple-definition is in effect, we need to disable it, as the plugin infrastructure relies on the multiple_definition callback to swap out the dummy IR-only BFDs for new real ones when it starts opening the files added during this callback. */ plugin_cached_allow_multiple_defs = link_info.allow_multiple_definition; link_info.allow_multiple_definition = FALSE; while (curplug) { if (curplug->all_symbols_read_handler) { enum ld_plugin_status rv; called_plugin = curplug; rv = (*curplug->all_symbols_read_handler) (); called_plugin = NULL; if (rv != LDPS_OK) set_plugin_error (curplug->name); } curplug = curplug->next; } return plugin_error_p () ? -1 : 0; } /* Call 'cleanup' hook for all plugins. */ int plugin_call_cleanup (void) { plugin_t *curplug = plugins_list; while (curplug) { if (curplug->cleanup_handler && !curplug->cleanup_done) { enum ld_plugin_status rv; curplug->cleanup_done = TRUE; called_plugin = curplug; rv = (*curplug->cleanup_handler) (); called_plugin = NULL; if (rv != LDPS_OK) set_plugin_error (curplug->name); dlclose (curplug->dlhandle); } curplug = curplug->next; } return plugin_error_p () ? -1 : 0; } /* Lazily init the non_ironly hash table. */ static void init_non_ironly_hash (void) { if (non_ironly_hash == NULL) { non_ironly_hash = (struct bfd_hash_table *) xmalloc (sizeof (struct bfd_hash_table)); if (!bfd_hash_table_init_n (non_ironly_hash, bfd_hash_newfunc, sizeof (struct bfd_hash_entry), 61)) einfo (_("%P%F: bfd_hash_table_init failed: %E\n")); } } /* To determine which symbols should be resolved LDPR_PREVAILING_DEF and which LDPR_PREVAILING_DEF_IRONLY, we notice all the symbols as the linker adds them to the linker hash table. If we see a symbol being referenced from a non-IR file, we add it to the non_ironly hash table. If we can't find it there at get_symbols time, we know that it was referenced only by IR files. We have to notice_all symbols, because we won't necessarily know until later which ones will be contributed by IR files. */ bfd_boolean plugin_notice (struct bfd_link_info *info ATTRIBUTE_UNUSED, const char *name, bfd *abfd, asection *section, bfd_vma value ATTRIBUTE_UNUSED) { bfd_boolean is_ref = bfd_is_und_section (section); bfd_boolean is_dummy = is_ir_dummy_bfd (abfd); init_non_ironly_hash (); /* We only care about refs, not defs, indicated by section pointing to the undefined section (according to the bfd linker notice callback interface definition). */ if (is_ref && !is_dummy) { /* This is a ref from a non-IR file, so note the ref'd symbol in the non-IR-only hash. */ if (!bfd_hash_lookup (non_ironly_hash, name, TRUE, TRUE)) einfo (_("%P%X: %s: hash table failure adding symbol %s"), abfd->filename, name); } else if (!is_ref && is_dummy) { /* No further processing since this is a def from an IR dummy BFD. */ return FALSE; } /* Continue with cref/nocrossref/trace-sym processing. */ return TRUE; } /* When we add new object files to the link at all symbols read time, these contain the real code and symbols generated from the IR files, and so duplicate all the definitions already supplied by the dummy IR-only BFDs that we created at claim files time. We use the linker's multiple-definitions callback hook to fix up the clash, discarding the symbol from the IR-only BFD in favour of the symbol from the real BFD. We return true if this was not-really-a-clash because we've fixed it up, or anyway if --allow-multiple-definition was in effect (before we disabled it to ensure we got called back). */ bfd_boolean plugin_multiple_definition (struct bfd_link_info *info, const char *name, bfd *obfd, asection *osec ATTRIBUTE_UNUSED, bfd_vma oval ATTRIBUTE_UNUSED, bfd *nbfd, asection *nsec, bfd_vma nval) { if (is_ir_dummy_bfd (obfd)) { struct bfd_link_hash_entry *blhe = bfd_link_hash_lookup (info->hash, name, FALSE, FALSE, FALSE); if (!blhe) einfo (_("%P%X: %s: can't find IR symbol '%s'"), nbfd->filename, name); else if (blhe->type != bfd_link_hash_defined) einfo (_("%P%x: %s: bad IR symbol type %d"), name, blhe->type); /* Replace it with new details. */ blhe->u.def.section = nsec; blhe->u.def.value = nval; return TRUE; } return plugin_cached_allow_multiple_defs; }