This revision was automatically updated to reflect the committed changes.
Closed by commit rL316773: New lldb python module for managing diagnostic
breakpoints (authored by dhinton).
Repository:
rL LLVM
https://reviews.llvm.org/D36347
Files:
cfe/trunk/utils/clangdiag.py
Index: cfe/trunk/ut
hintonda updated this revision to Diff 120629.
hintonda added a comment.
- Remove whitespace.
https://reviews.llvm.org/D36347
Files:
utils/clangdiag.py
Index: utils/clangdiag.py
===
--- /dev/null
+++ utils/clangdiag.py
@@ -0,0 +
hintonda updated this revision to Diff 120628.
hintonda added a comment.
- Add support for individual DiagID's, and print out number of breakpoints
added.
https://reviews.llvm.org/D36347
Files:
utils/clangdiag.py
Index: utils/clangdiag.py
looks good! Feel free to commit whenever, I'd definitely recommend posting
a PSA on cfe-dev@ (after you commit) so that people know about it. You
might also get some useful ideas for improvements that way too.
On Thu, Oct 26, 2017 at 9:52 PM Don Hinton wrote:
> On Thu, Oct 26, 2017 at 5:44 PM,
On Thu, Oct 26, 2017 at 5:44 PM, Zachary Turner wrote:
>
>
> On Thu, Oct 26, 2017 at 3:18 PM Don Hinton wrote:
>
>> On Thu, Oct 26, 2017 at 2:48 PM, Zachary Turner
>> wrote:
>>
>>> Seems fine, it would be nice if the workflow could be improved a little
>>> bit so that all you have to do is say
hintonda updated this revision to Diff 120538.
hintonda added a comment.
- Add ability to add breakpoints matching -W warnings.
https://reviews.llvm.org/D36347
Files:
utils/clangdiag.py
Index: utils/clangdiag.py
===
--- /dev/nul
On Thu, Oct 26, 2017 at 3:18 PM Don Hinton wrote:
> On Thu, Oct 26, 2017 at 2:48 PM, Zachary Turner
> wrote:
>
>> Seems fine, it would be nice if the workflow could be improved a little
>> bit so that all you have to do is say `clangdiag break
>> —error=“-Wcovered-switch”` or something . I think
hintonda updated this revision to Diff 120518.
hintonda added a comment.
- Maintain process id map for diagtool.
https://reviews.llvm.org/D36347
Files:
utils/clangdiag.py
Index: utils/clangdiag.py
===
--- /dev/null
+++ utils/cla
On Thu, Oct 26, 2017 at 2:48 PM, Zachary Turner wrote:
> Seems fine, it would be nice if the workflow could be improved a little
> bit so that all you have to do is say `clangdiag break
> —error=“-Wcovered-switch”` or something . I think that gives the most
> intuitive usage for people, even it’s
On Thu, Oct 26, 2017 at 3:00 PM, Greg Clayton via Phabricator <
revi...@reviews.llvm.org> wrote:
> clayborg added a comment.
>
> Each lldb.SBValue has accessors for the stuff in an execution context:
>
> ``
>
> lldb::SBTarget GetTarget();
> lldb::SBProcess GetProcess();
> lldb::SBThread GetT
clayborg added a comment.
Each lldb.SBValue has accessors for the stuff in an execution context:
``
lldb::SBTarget GetTarget();
lldb::SBProcess GetProcess();
lldb::SBThread GetThread();
lldb::SBFrame GetFrame();
You could keep a global map of process ID to diagtool if you want?
W
Seems fine, it would be nice if the workflow could be improved a little bit
so that all you have to do is say `clangdiag break
—error=“-Wcovered-switch”` or something . I think that gives the most
intuitive usage for people, even it’s a bit harder to implement.
I also think user shouldn’t really h
hintonda added a comment.
Is there a way to associate a particular diagtool variable to an exe_ctx?
https://reviews.llvm.org/D36347
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
hintonda updated this revision to Diff 120492.
hintonda added a comment.
- Remove debugging print statement, and enhance help message.
https://reviews.llvm.org/D36347
Files:
utils/clangdiag.py
Index: utils/clangdiag.py
===
--- /
hintonda added a comment.
In https://reviews.llvm.org/D36347#908186, @zturner wrote:
> Do I understand correctly that this will insert breakpoints on *all* clang
> diagnostics? That's not necessarily bad, but I was under the impression
> originally that it would let you pick the diagnostics yo
clayborg added a comment.
Looks good.
https://reviews.llvm.org/D36347
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
hintonda updated this revision to Diff 120459.
hintonda added a comment.
- Enhance diagtool option to check, reset, print out current value.
https://reviews.llvm.org/D36347
Files:
utils/clangdiag.py
Index: utils/clangdiag.py
===
clayborg accepted this revision.
clayborg added inline comments.
Comment at: utils/clangdiag.py:117
+disable(exe_ctx)
+else:
+getDiagtool(exe_ctx.GetTarget(), args.path[0])
hintonda wrote:
> clayborg wrote:
> > should probably verify that this
zturner added a comment.
Do I understand correctly that this will insert breakpoints on *all* clang
diagnostics? That's not necessarily bad, but I was under the impression
originally that it would let you pick the diagnostics you wanted to insert
breakpoints on.
Also, What is the workflow for
hintonda added a comment.
Thanks for the feedback (addressed below).
btw, where should this module go?
Since it's intended for clang, and clang based tool, developers, I put it in
`clang/utils`, but Zackery suggested `lldb/examples/python` might be a better
place. Please let me know if anyone
clayborg requested changes to this revision.
clayborg added a comment.
This revision now requires changes to proceed.
Very close. Thanks for making the changes. Just a few nits.
Comment at: utils/clangdiag.py:66
+def setDiagBreakpoint(frame, bp_loc, dict):
+id = frame.FindV
hintonda updated this revision to Diff 120360.
hintonda added a comment.
- Add diagtool option used to set arbitrary diagtool path.
https://reviews.llvm.org/D36347
Files:
utils/clangdiag.py
Index: utils/clangdiag.py
===
--- /dev
jingham added a comment.
Ack, my bad. I should remember not to rely on my memory...
I thought at one point I was going to do it that way, then got annoyed I'd have
to have "BreakpointDisableByName" etc... So apparently I made:
SBTarget.FindBreakpointByName
that takes a name & an SBBreakpoint
hintonda added inline comments.
Comment at: utils/clangdiag.py:83
+# Remove all diag breakpoints.
+bkpts = lldb.SBBreakpointList(target)
+target.FindBreakpointsByName("clang::Diagnostic", bkpts)
Can't use iterator because it gets invalidated and not a
hintonda updated this revision to Diff 120340.
hintonda edited the summary of this revision.
hintonda added a comment.
Herald added a subscriber: ilya-biryukov.
- Addressed comments.
https://reviews.llvm.org/D36347
Files:
utils/clangdiag.py
Index: utils/clangdiag.py
=
jingham added a comment.
Note, BTW, Enrico also added a form of the command add that allows you to use a
Python class to wrap the callable. That was in early 2015 so it's probably
safe to use as well by now. That's even more convenient, and obviates the need
for globals at all. One instance
clayborg added inline comments.
Comment at: utils/clangdiag.py:62
+
+def enable(debugger, args):
+# Always disable existing breakpoints
Pass exe_ctx or target into this instead of the debugger (see Jim's comment on
execution contexts below.
===
jingham added a comment.
Yes definitely use names for your breakpoints. It makes them easier to handle.
Note starting a month or two ago you can set names to not get deleted except
by an explicit gesture. That hasn't shown up in releases yet, but once you can
rely on its being there, you can
jingham requested changes to this revision.
jingham added a comment.
This revision now requires changes to proceed.
Use the form of the command that gets an SBExecutionContext, then you can avoid
having to cache the target at all.
Comment at: utils/clangdiag.py:98-100
+def the
hintonda added a comment.
Thanks for the quick feedback. I'll make all you suggested changes, but need
to think a little more about `diagtool`.
Comment at: utils/clangdiag.py:75-78
+diagtool = os.path.join(exe.GetDirectory(), 'diagtool')
+if not os.path.exists(diagtoo
clayborg added a comment.
Looks good. A little bit of cleanup. Let me know what you think of the comments.
Comment at: utils/clangdiag.py:17
+import os
+from subprocess import check_output as qx;
+
I would rather just do:
```
import subprocess
```
Then later
31 matches
Mail list logo