[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-21 Thread Jason Molenda via lldb-commits
jasonmolenda wrote: re. TestStepOverWatchpoint.py this test case annoys me greatly. It wants to test that we get a watchpoint trap when stepping over a function that accesses the memory, and that we can stop on the watchpoint access when instruction stepping. It wants to test this for read

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-21 Thread Jason Molenda via lldb-commits
jasonmolenda wrote: @DavidSpickett pushed the fix for the `watch set expression` bug in ``` commit 35e3939cb06d19942a30fd39f1416f49a7b982a4 Author: Jason Molenda Date: Thu Sep 21 14:48:19 2023 -0700 watch set expression's default type was wrong with new modify type ```

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-21 Thread Jason Molenda via lldb-commits
jasonmolenda wrote: Ah, I see the bug where `watch set expression` ends up marked as `rw`. CommandObjectWatchpointSetExpression::DoExecute passes `OptionGroupWatchpoint::eWatchModify` as the type to Target::CreateWatchpoint (which takes that as a uint32_t). It passes that `uint32_t kind` to

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-21 Thread Jason Molenda via lldb-commits
jasonmolenda wrote: FWIW I've found that `watch set expression -s ` will ignore the size specified if there is a clang type of the expression, it seems. :( https://github.com/llvm/llvm-project/pull/66308 ___ lldb-commits mailing list

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-21 Thread Jason Molenda via lldb-commits
jasonmolenda wrote: Thanks @DavidSpickett for looking into these. Let me looked into the tagged ptr watchpoint issue right now, that sounds like a bug. One of the changes I made in the second landing of my patch was to the TestStepOverWatchpoint C file, which had three 1-byte globals, one

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-21 Thread David Spickett via lldb-commits
DavidSpickett wrote: Where the "commands" are: ``` watchpoint set expression -s 4 -- tagged_ptr watchpoint set variable global_var ``` They default to different types. https://github.com/llvm/llvm-project/pull/66308 ___ lldb-commits mailing list

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-21 Thread David Spickett via lldb-commits
DavidSpickett wrote: I've updated the tests and relanded but there is still some stuff to check. The tagged address test is working fine but the default watchpoint type is different between the 2 commands, which seems wrong at first glance. For the other one see

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-21 Thread David Spickett via lldb-commits
DavidSpickett wrote: I've reverted this due to failures on Arm/AArch64 Linux, well, one test failing, one passing unexpectedly. Likely they are expecting the watchpoint to go off even when not modified. If I can fix them I'll do that and reland this.

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-18 Thread Jason Molenda via lldb-commits
https://github.com/jasonmolenda closed https://github.com/llvm/llvm-project/pull/66308 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-18 Thread Jason Molenda via lldb-commits
https://github.com/jasonmolenda updated https://github.com/llvm/llvm-project/pull/66308 >From 1efbce9f3b754f45372f0098163e70c2118b57d9 Mon Sep 17 00:00:00 2001 From: Jason Molenda Date: Wed, 13 Sep 2023 17:38:31 -0700 Subject: [PATCH 1/4] [lldb] Add 'modify' type watchpoints, make it default

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-18 Thread Jason Molenda via lldb-commits
@@ -6,11 +6,7 @@ ) lldb::SBWatchpointOptions::SetWatchpointTypeRead; %feature("docstring", "Gets whether the watchpoint should stop on read accesses." ) lldb::SBWatchpointOptions::GetWatchpointTypeRead; -%feature("docstring", "Sets whether the watchpoint should stop on write

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-18 Thread Jason Molenda via lldb-commits
@@ -6,11 +6,7 @@ ) lldb::SBWatchpointOptions::SetWatchpointTypeRead; %feature("docstring", "Gets whether the watchpoint should stop on read accesses." ) lldb::SBWatchpointOptions::GetWatchpointTypeRead; -%feature("docstring", "Sets whether the watchpoint should stop on write

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-18 Thread via lldb-commits
jimingham wrote: That watchpoints can be inaccurate is probably news to a lot of debugger users, and knowing that might save somebody a fruitless hour wondering "how that variable could be being modified here..." But I don't think most folks are likely to see the API doc string. Might be

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-18 Thread Greg Clayton via lldb-commits
https://github.com/clayborg approved this pull request. Thanks for the changes! Looks great https://github.com/llvm/llvm-project/pull/66308 ___ lldb-commits mailing list lldb-commits@lists.llvm.org

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-18 Thread Greg Clayton via lldb-commits
@@ -6,11 +6,7 @@ ) lldb::SBWatchpointOptions::SetWatchpointTypeRead; %feature("docstring", "Gets whether the watchpoint should stop on read accesses." ) lldb::SBWatchpointOptions::GetWatchpointTypeRead; -%feature("docstring", "Sets whether the watchpoint should stop on write

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-18 Thread Greg Clayton via lldb-commits
https://github.com/clayborg edited https://github.com/llvm/llvm-project/pull/66308 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-18 Thread Jason Molenda via lldb-commits
https://github.com/jasonmolenda updated https://github.com/llvm/llvm-project/pull/66308 >From 1efbce9f3b754f45372f0098163e70c2118b57d9 Mon Sep 17 00:00:00 2001 From: Jason Molenda Date: Wed, 13 Sep 2023 17:38:31 -0700 Subject: [PATCH 1/3] [lldb] Add 'modify' type watchpoints, make it default

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-17 Thread Jason Molenda via lldb-commits
@@ -0,0 +1,44 @@ +//===-- SBWatchpointOptions.h ---*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-15 Thread Greg Clayton via lldb-commits
@@ -0,0 +1,44 @@ +//===-- SBWatchpointOptions.h ---*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-15 Thread Greg Clayton via lldb-commits
@@ -0,0 +1,67 @@ +//===-- SBWatchpointOptions.cpp ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-15 Thread Greg Clayton via lldb-commits
https://github.com/clayborg commented: Overall looks pretty solid. Just need to nail down the headerdoc for the "modify" accesors and clarify that it only works in combination with "write" and probably change the old API from "bool read, bool write" to be "bool read, bool modify" to clearly

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-15 Thread Greg Clayton via lldb-commits
https://github.com/clayborg edited https://github.com/llvm/llvm-project/pull/66308 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-15 Thread Jason Molenda via lldb-commits
https://github.com/jasonmolenda edited https://github.com/llvm/llvm-project/pull/66308 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-15 Thread Jason Molenda via lldb-commits
@@ -46,7 +46,9 @@ def test_unaligned_watchpoint(self): a_bytebuf_6 = frame.GetValueForVariablePath("a.bytebuf[6]") a_bytebuf_6_addr = a_bytebuf_6.GetAddress().GetLoadAddress(target) err = lldb.SBError() -wp =

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-15 Thread Jason Molenda via lldb-commits
https://github.com/jasonmolenda edited https://github.com/llvm/llvm-project/pull/66308 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-15 Thread Jason Molenda via lldb-commits
@@ -0,0 +1,67 @@ +//===-- SBWatchpointOptions.cpp ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-15 Thread Jason Molenda via lldb-commits
https://github.com/jasonmolenda edited https://github.com/llvm/llvm-project/pull/66308 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-15 Thread Jason Molenda via lldb-commits
https://github.com/jasonmolenda edited https://github.com/llvm/llvm-project/pull/66308 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-15 Thread Jason Molenda via lldb-commits
@@ -1326,23 +1326,35 @@ lldb::SBWatchpoint SBTarget::WatchAddress(lldb::addr_t addr, size_t size, SBError ) { LLDB_INSTRUMENT_VA(this, addr, size, read, write, error); + SBWatchpointOptions options; +

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-15 Thread Jason Molenda via lldb-commits
@@ -0,0 +1,44 @@ +//===-- SBWatchpointOptions.h ---*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-15 Thread Greg Clayton via lldb-commits
@@ -0,0 +1,44 @@ +//===-- SBWatchpointOptions.h ---*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-15 Thread Greg Clayton via lldb-commits
@@ -0,0 +1,67 @@ +//===-- SBWatchpointOptions.cpp ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-15 Thread Greg Clayton via lldb-commits
@@ -0,0 +1,44 @@ +//===-- SBWatchpointOptions.h ---*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-15 Thread Greg Clayton via lldb-commits
@@ -53,7 +53,10 @@ def fuzz_obj(obj): obj.GetByteOrder() obj.GetTriple() error = lldb.SBError() -obj.WatchAddress(123, 8, True, True, error) +wp_opts = lldb.SBWatchpointOptions() +wp_opts.SetWatchpointTypeRead(True) +

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-15 Thread Greg Clayton via lldb-commits
@@ -46,7 +46,9 @@ def test_unaligned_watchpoint(self): a_bytebuf_6 = frame.GetValueForVariablePath("a.bytebuf[6]") a_bytebuf_6_addr = a_bytebuf_6.GetAddress().GetLoadAddress(target) err = lldb.SBError() -wp =

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-15 Thread Greg Clayton via lldb-commits
@@ -1326,23 +1326,35 @@ lldb::SBWatchpoint SBTarget::WatchAddress(lldb::addr_t addr, size_t size, SBError ) { LLDB_INSTRUMENT_VA(this, addr, size, read, write, error); + SBWatchpointOptions options; +

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-15 Thread Greg Clayton via lldb-commits
@@ -0,0 +1,44 @@ +//===-- SBWatchpointOptions.h ---*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-15 Thread Jason Molenda via lldb-commits
https://github.com/jasonmolenda updated https://github.com/llvm/llvm-project/pull/66308 >From 1efbce9f3b754f45372f0098163e70c2118b57d9 Mon Sep 17 00:00:00 2001 From: Jason Molenda Date: Wed, 13 Sep 2023 17:38:31 -0700 Subject: [PATCH 1/2] [lldb] Add 'modify' type watchpoints, make it default

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-14 Thread Greg Clayton via lldb-commits
clayborg wrote: > You and Alex both preferred adding an Options class to pass in to this (and > future WatchpointCreate API) so I'll write that up for my next revision of > this PR, I didn't see your earlier message talking about your preference for > that when I ping'ed Alex on their

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-14 Thread via lldb-commits
jimingham wrote: I'm not sure I see the benefit of the SBWatchpointSpec including the way the watched region is specified. That's just moving the proliferation of API's from SBTarget::WatchpointCreate*() to the SBWatchpointSpec constructor. We'd have to have:

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-14 Thread Alex Langford via lldb-commits
bulbazord wrote: > > ``` > >SBWatchpoint SBTarget::WatchpointCreateByAddress(addr_t address, size_t > > size, uint32_t access_flags, SBError ); > > ``` > > > > > > > > > > > > > > > > > > > > > > > > with `eWatchpointAccess{Read,Write,Modify}` flags

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-14 Thread Jason Molenda via lldb-commits
jasonmolenda wrote: > > > ``` > > >SBWatchpoint SBTarget::WatchpointCreateByAddress(addr_t address, > > > size_t size, uint32_t access_flags, SBError ); > > > ``` > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > with

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-14 Thread Greg Clayton via lldb-commits
clayborg wrote: > > ``` > >SBWatchpoint SBTarget::WatchpointCreateByAddress(addr_t address, size_t > > size, uint32_t access_flags, SBError ); > > ``` > > > > > > > > > > > > > > > > > > > > > > > > with `eWatchpointAccess{Read,Write,Modify}` flags

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-14 Thread Jason Molenda via lldb-commits
jasonmolenda wrote: > ``` >SBWatchpoint SBTarget::WatchpointCreateByAddress(addr_t address, size_t > size, uint32_t access_flags, SBError ); > ``` > > with `eWatchpointAccess{Read,Write,Modify}` flags defined. @bulbazord what do you think about this suggestion? Would you still prefer an

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-14 Thread Greg Clayton via lldb-commits
clayborg wrote: > > > Just to be clear, I need to find a solution for > > > SBTarget::CreateWatchpoint before this PR is ready to land. I'm inclined > > > towards adding a third bool parameter 'modify', but I'm not sure that's > > > the best choice. > > > > > > Anytime we keep adding more

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-14 Thread Alex Langford via lldb-commits
@@ -3109,14 +3109,15 @@ static GDBStoppointType GetGDBStoppointType(Watchpoint *wp) { assert(wp); bool watch_read = wp->WatchpointRead(); bool watch_write = wp->WatchpointWrite(); + bool watch_modify = wp->WatchpointModify(); - // watch_read and watch_write cannot

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-14 Thread Alex Langford via lldb-commits
@@ -211,6 +212,35 @@ bool Watchpoint::CaptureWatchedValue(const ExecutionContext _ctx) { return (m_new_value_sp && m_new_value_sp->GetError().Success()); } +bool Watchpoint::WatchedValueReportable(const ExecutionContext _ctx) { + if (!m_watch_modify) +return true; +

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-14 Thread Jason Molenda via lldb-commits
jasonmolenda wrote: Maybe I should just use a flag param, and adopt the BreakpointCreate style naming convention, even if there's only this one API right now (we should provide all three so driver authors don't need to duplicate the work, especially for a variable path). e.g. ```

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-14 Thread Jason Molenda via lldb-commits
jasonmolenda wrote: > > Just to be clear, I need to find a solution for SBTarget::CreateWatchpoint > > before this PR is ready to land. I'm inclined towards adding a third bool > > parameter 'modify', but I'm not sure that's the best choice. > > Anytime we keep adding more options to an API

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-13 Thread Jason Molenda via lldb-commits
@@ -211,6 +212,35 @@ bool Watchpoint::CaptureWatchedValue(const ExecutionContext _ctx) { return (m_new_value_sp && m_new_value_sp->GetError().Success()); } +bool Watchpoint::WatchedValueReportable(const ExecutionContext _ctx) { + if (!m_watch_modify) +return true; +

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-13 Thread Jason Molenda via lldb-commits
@@ -0,0 +1,17 @@ +#include +int main() { + int value = 5; jasonmolenda wrote: Yeah, if this was compiled with any optimization at all, the body of the function becomes `mv x0, #0xa`; `ret` so I didn't try to defeat compiler cleverness.

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-13 Thread Jason Molenda via lldb-commits
@@ -211,6 +212,35 @@ bool Watchpoint::CaptureWatchedValue(const ExecutionContext _ctx) { return (m_new_value_sp && m_new_value_sp->GetError().Success()); } +bool Watchpoint::WatchedValueReportable(const ExecutionContext _ctx) { + if (!m_watch_modify) +return true; +

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-13 Thread Jason Molenda via lldb-commits
@@ -0,0 +1,17 @@ +#include +int main() { + int value = 5; + + value = 5; // break here + value = 5; + value = 5; + value = 5; + value = 5; + value = 5; + value = 10; + value = 10; jasonmolenda wrote: Good point. I figured existing watchpoint tests

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-13 Thread Jason Molenda via lldb-commits
@@ -211,6 +212,35 @@ bool Watchpoint::CaptureWatchedValue(const ExecutionContext _ctx) { return (m_new_value_sp && m_new_value_sp->GetError().Success()); } +bool Watchpoint::WatchedValueReportable(const ExecutionContext _ctx) { + if (!m_watch_modify) +return true; +

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-13 Thread Greg Clayton via lldb-commits
@@ -0,0 +1,17 @@ +#include +int main() { + int value = 5; + + value = 5; // break here + value = 5; + value = 5; + value = 5; + value = 5; + value = 5; + value = 10; + value = 10; clayborg wrote: We could change it back to 5 to ensure that the

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-13 Thread Greg Clayton via lldb-commits
@@ -0,0 +1,17 @@ +#include +int main() { + int value = 5; clayborg wrote: If you take the address of "value" then it will always be in memory. Here we might be just getting lucky that the compiler choses to put this on the stack at -O0.

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-13 Thread Greg Clayton via lldb-commits
@@ -211,6 +212,35 @@ bool Watchpoint::CaptureWatchedValue(const ExecutionContext _ctx) { return (m_new_value_sp && m_new_value_sp->GetError().Success()); } +bool Watchpoint::WatchedValueReportable(const ExecutionContext _ctx) { + if (!m_watch_modify) +return true; +

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-13 Thread Greg Clayton via lldb-commits
https://github.com/clayborg edited https://github.com/llvm/llvm-project/pull/66308 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-13 Thread Greg Clayton via lldb-commits
https://github.com/clayborg commented: Since users probably want a behavior like GDB by default, one idea is to just add a setting: ``` (llldb) settings show target.watchpoint-stop-on-write [always|changed] ``` When watchpoints are set, they just read the current value for this. Most of your

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-13 Thread Greg Clayton via lldb-commits
@@ -0,0 +1,17 @@ +#include +int main() { + int value = 5; + + value = 5; // break here + value = 5; + value = 5; + value = 5; + value = 5; + value = 5; + value = 10; + value = 10; clayborg wrote: Can we check that it stops when the value changes from

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-13 Thread Jonas Devlieghere via lldb-commits
https://github.com/JDevlieghere review_requested https://github.com/llvm/llvm-project/pull/66308 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-13 Thread Jonas Devlieghere via lldb-commits
https://github.com/JDevlieghere review_requested https://github.com/llvm/llvm-project/pull/66308 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-13 Thread Jonas Devlieghere via lldb-commits
@@ -211,6 +212,35 @@ bool Watchpoint::CaptureWatchedValue(const ExecutionContext _ctx) { return (m_new_value_sp && m_new_value_sp->GetError().Success()); } +bool Watchpoint::WatchedValueReportable(const ExecutionContext _ctx) { + if (!m_watch_modify) +return true; +

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-13 Thread Jonas Devlieghere via lldb-commits
@@ -211,6 +212,35 @@ bool Watchpoint::CaptureWatchedValue(const ExecutionContext _ctx) { return (m_new_value_sp && m_new_value_sp->GetError().Success()); } +bool Watchpoint::WatchedValueReportable(const ExecutionContext _ctx) { + if (!m_watch_modify) +return true; +

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-13 Thread Jonas Devlieghere via lldb-commits
@@ -982,6 +982,13 @@ class StopInfoWatchpoint : public StopInfo { m_should_stop = false; } } + +// Don't stop if the watched region value is unmodified, and +// this is a Modify-type watchpoint. +if (m_should_stop &&

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-13 Thread Jonas Devlieghere via lldb-commits
@@ -211,6 +212,35 @@ bool Watchpoint::CaptureWatchedValue(const ExecutionContext _ctx) { return (m_new_value_sp && m_new_value_sp->GetError().Success()); } +bool Watchpoint::WatchedValueReportable(const ExecutionContext _ctx) { + if (!m_watch_modify) +return true; +

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-13 Thread Jonas Devlieghere via lldb-commits
https://github.com/JDevlieghere edited https://github.com/llvm/llvm-project/pull/66308 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-13 Thread Jonas Devlieghere via lldb-commits
@@ -211,6 +212,35 @@ bool Watchpoint::CaptureWatchedValue(const ExecutionContext _ctx) { return (m_new_value_sp && m_new_value_sp->GetError().Success()); } +bool Watchpoint::WatchedValueReportable(const ExecutionContext _ctx) { + if (!m_watch_modify) +return true; +

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-13 Thread Jonas Devlieghere via lldb-commits
@@ -31,13 +31,15 @@ class OptionGroupWatchpoint : public OptionGroup { void OptionParsingStarting(ExecutionContext *execution_context) override; // Note: - // eWatchRead == LLDB_WATCH_TYPE_READ; and + // eWatchRead == LLDB_WATCH_TYPE_READ // eWatchWrite ==

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-13 Thread Jason Molenda via lldb-commits
jasonmolenda wrote: Just to be clear, I need to find a solution for SBTarget::CreateWatchpoint before this PR is ready to land. I'm inclined towards adding a third bool parameter 'modify', but I'm not sure that's the best choice. https://github.com/llvm/llvm-project/pull/66308

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-13 Thread via lldb-commits
llvmbot wrote: @llvm/pr-subscribers-lldb Changes Watchpoints in lldb can be either 'read', 'write', or 'read/write'. This is exposing the actual behavior of hardware watchpoints. gdb has a different behavior: a "write" type watchpoint only stops when the watched memory

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-13 Thread via lldb-commits
https://github.com/llvmbot labeled https://github.com/llvm/llvm-project/pull/66308 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-13 Thread Jason Molenda via lldb-commits
https://github.com/jasonmolenda review_requested https://github.com/llvm/llvm-project/pull/66308 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

2023-09-13 Thread Jason Molenda via lldb-commits
https://github.com/jasonmolenda created https://github.com/llvm/llvm-project/pull/66308: Watchpoints in lldb can be either 'read', 'write', or 'read/write'. This is exposing the actual behavior of hardware watchpoints. gdb has a different behavior: a "write" type watchpoint only stops when