All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Murray <andrew.murray@arm.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: smatch@vger.kernel.org
Subject: [PATCH 2/4] smdb.py: fix param tracking now that we use $ instead of p
Date: Mon,  8 Jul 2019 12:22:19 +0100	[thread overview]
Message-ID: <20190708112221.22983-3-andrew.murray@arm.com> (raw)
In-Reply-To: <20190708112221.22983-1-andrew.murray@arm.com>

Since d8084fee2b7c the data source of a parameter is now stored with the
notation: $0 instead of p0 (where the $ or p indicates that the data source
of the parameter is from the callers function parameters, the value next to
it is the parameter number).

Let's update the smdb script to reflect this.

Fixes: d8084fee2b7c ("data_source: change how parameter data source information is recorded")
Signed-off-by: Andrew Murray <andrew.murray@arm.com>
---
 smatch_data/db/smdb.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/smatch_data/db/smdb.py b/smatch_data/db/smdb.py
index 1e089b4804bd..9025a95070b5 100755
--- a/smatch_data/db/smdb.py
+++ b/smatch_data/db/smdb.py
@@ -574,8 +574,8 @@ def trace_param_helper(func, param, indent = 0):
     sources = trace_callers(func, param)
     for path in sources:
 
-        if len(path[1]) and path[1][0] == 'p' and path[1][1] == ' ':
-            p = int(path[1][2:])
+        if len(path[1]) and path[1][0] == '$':
+            p = int(re.findall('\d+', path[1][1:])[0])
             trace_param_helper(path[0], p, indent + 2)
         elif len(path[0]) and path[0][0] == '%':
             print "  %s%s" %(" " * indent, path[1])
-- 
2.21.0

  parent reply	other threads:[~2019-07-08 11:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-08 11:22 [PATCH 0/4] Miscellaneous fixes Andrew Murray
2019-07-08 11:22 ` [PATCH 1/4] smdb.py: fix handling of capped ranges Andrew Murray
2019-07-08 11:22 ` Andrew Murray [this message]
2019-07-08 11:22 ` [PATCH 3/4] user_data: Recognize uaccess for non-x86 architectures Andrew Murray
2019-07-08 11:22 ` [PATCH 4/4] kchecker: remove debug Andrew Murray
2019-07-17 10:18 ` [PATCH 0/4] Miscellaneous fixes Dan Carpenter
2019-10-07 14:20   ` Andrew Murray

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=20190708112221.22983-3-andrew.murray@arm.com \
    --to=andrew.murray@arm.com \
    --cc=dan.carpenter@oracle.com \
    --cc=smatch@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.