[40/41] gdbinit.in: add break-on-saved-diagnostic

Message ID 20200108090302.2425-41-dmalcolm@redhat.com
State New
Headers show
Series
  • v5 of analyzer patch kit
Related show

Commit Message

David Malcolm Jan. 8, 2020, 9:03 a.m.
Needs review (or potentially falls under the "obvious" rule, at a
stretch).

This patch adds a "break-on-saved-diagnostic" command to gdbinit.in,
useful for debugging when a diagnostic is queued by the analyzer.

gcc/ChangeLog:
	* gdbinit.in (break-on-saved-diagnostic): New command.
---
 gcc/gdbinit.in | 10 ++++++++++
 1 file changed, 10 insertions(+)

-- 
2.21.0

Comments

Jeff Law Jan. 10, 2020, 4:12 p.m. | #1
On Wed, 2020-01-08 at 04:03 -0500, David Malcolm wrote:
> Needs review (or potentially falls under the "obvious" rule, at a

> stretch).

> 

> This patch adds a "break-on-saved-diagnostic" command to gdbinit.in,

> useful for debugging when a diagnostic is queued by the analyzer.

> 

> gcc/ChangeLog:

> 	* gdbinit.in (break-on-saved-diagnostic): New command.

OK
jeff
>

Patch

diff --git a/gcc/gdbinit.in b/gcc/gdbinit.in
index 4a5b682451b7..c5b020c2180e 100644
--- a/gcc/gdbinit.in
+++ b/gcc/gdbinit.in
@@ -219,6 +219,16 @@  is emitted (as opposed to those warnings that are suppressed by
 command-line options).
 end
 
+define break-on-saved-diagnostic
+break diagnostic_manager::add_diagnostic
+end
+
+document break-on-saved-diagnostic
+Put a breakpoint on diagnostic_manager::add_diagnostic, called within
+the analyzer whenever a diagnostic is saved for later de-duplication and
+possible emission.
+end
+
 define reload-gdbhooks
 python import imp; imp.reload(gdbhooks)
 end