aboutsummaryrefslogtreecommitdiff
path: root/options.c
diff options
context:
space:
mode:
authorPetr Machata <pmachata@redhat.com>2012-04-04 02:20:21 +0200
committerPetr Machata <pmachata@redhat.com>2012-04-19 01:35:47 +0200
commitda3edbf059fe6c6d010b47ac50876783b4ed49ce (patch)
treec705b4531ae0a7a3cb65106954c9defe1ad74084 /options.c
parentb5f80ac8982c40f79915ce1e1cb9bf8650ac5fe7 (diff)
downloadltrace-da3edbf059fe6c6d010b47ac50876783b4ed49ce.tar.gz
Elementary support for -x
- this is applied across libraries. Syntax for the -x option is the same as for -e - this fails on symbol aliases. E.g. there are several symbols named like strlen in libc: strlen, __GI_strlen, and perhaps others. This needs to be taken into account, and symbol aliases shouldn't be enabled if they were added under a different name already
Diffstat (limited to 'options.c')
-rw-r--r--options.c31
1 files changed, 2 insertions, 29 deletions
diff --git a/options.c b/options.c
index d4e16a8..0e8d106 100644
--- a/options.c
+++ b/options.c
@@ -48,10 +48,6 @@ int opt_T = 0; /* show the time spent inside each call */
/* List of pids given to option -p: */
struct opt_p_t *opt_p = NULL; /* attach to process with a given pid */
-/* List of global function names given to -x: */
-struct opt_x_t *opt_x = NULL;
-unsigned int opt_x_cnt = 0;
-
/* List of filenames give to option -F: */
struct opt_F_t *opt_F = NULL; /* alternate configuration file(s) */
@@ -581,31 +577,8 @@ process_options(int argc, char **argv) {
/* Fall Thru */
case 'x':
- {
- struct opt_x_t *p = opt_x;
-
- /* First, check for duplicate. */
- while (p && strcmp(p->name, optarg)) {
- p = p->next;
- }
- if (p) {
- break;
- }
-
- /* If not duplicate, add to list. */
- p = malloc(sizeof(struct opt_x_t));
- if (!p) {
- perror("ltrace: malloc");
- exit(1);
- }
- opt_x_cnt++;
- p->name = optarg;
- p->found = 0;
- p->next = opt_x;
- p->hash = ~(0UL);
- opt_x = p;
- break;
- }
+ parse_filter_chain(optarg, &options.static_filter);
+ break;
default:
err_usage();