public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: Wenji Huang <wenji.huang@oracle.com>
To: fche@redhat.com
Cc: "systemtap@sourceware.org" <systemtap@sourceware.org>
Subject: Re: [RFC PATCH] Fix segmentation fault of listing kprocess.create
Date: Fri, 06 Nov 2009 01:08:00 -0000	[thread overview]
Message-ID: <4AF37691.6000601@oracle.com> (raw)
In-Reply-To: <y0mfx8txdpe.fsf@fche.csb>

fche@redhat.com wrote:
>>>          /* trick from visit_target_symbol_context */
>>>          target_symbol *tsym = new target_symbol;
>>>          token *t = new token;
>>>          tsym->tok = t;
>>>          tsym->base_name = "$";
>>>          tsym->base_name += arg_name;
> 
> Right, such an empty token should not exist.  (We may be able to
> remove this default constructor and force clients to fill in the
> fields immediately.)
> 
> When synthesizing new parse tree structures, the token pointer
> assigned to the new objects usually relates to the original
> script-level object that caused the synthesis.  So for example in a
> return probe that uses a saved entry-time $var, a whole new synthetic
> probe and global variables could all be assigned to the same "$var"
> token.
> 
> Perhaps the recently introduced saveargs() function should be supplied
> with an appropriate token*, for examples q.base_probe->tok.

The empty token is from my patch for 10820, sorry for the
error.  Maybe the following patch can fix that.

Regards,
Wenji

diff --git a/tapsets.cxx b/tapsets.cxx
index d2c3334..17e315e 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -2928,6 +2928,14 @@ dwarf_derived_probe::saveargs(dwarf_query& q, 
Dwarf_Die* scope_die, dwarf_var_ex
          /* trick from visit_target_symbol_context */
          target_symbol *tsym = new target_symbol;
          token *t = new token;
+        /* We hypothesize accessing the argument
+         * The source_loc will be base_loc since no real one  */
+        t->content = "$";
+        t->content += arg_name;
+        t->type = tok_identifier;
+        t->location.file = q.base_loc->tok->location.file;
+        t->location.column = q.base_loc->tok->location.column;
+        t->location.line = q.base_loc->tok->location.line;
          tsym->tok = t;
          tsym->base_name = "$";
          tsym->base_name += arg_name;

  reply	other threads:[~2009-11-06  1:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-05  5:03 Wenji Huang
2009-11-05  7:00 ` Wenji Huang
2009-11-05  7:36   ` Wenji Huang
2009-11-05 14:12     ` Frank Ch. Eigler
2009-11-06  1:08       ` Wenji Huang [this message]
2009-11-06 11:19         ` Frank Ch. Eigler
2009-11-07  0:14     ` Josh Stone

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4AF37691.6000601@oracle.com \
    --to=wenji.huang@oracle.com \
    --cc=fche@redhat.com \
    --cc=systemtap@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).