public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug breakpoints/18727] New: Add if to catch syscall to automate getting condition id
@ 2015-07-28  9:58 ciro.santilli at gmail dot com
  0 siblings, 0 replies; only message in thread
From: ciro.santilli at gmail dot com @ 2015-07-28  9:58 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=18727

            Bug ID: 18727
           Summary: Add if to catch syscall to automate getting condition
                    id
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: breakpoints
          Assignee: unassigned at sourceware dot org
          Reporter: ciro.santilli at gmail dot com
  Target Milestone: ---

I want to set a condition on a `catch syscall`, e.g.: break whenever write is
called with a given string to stdout
http://stackoverflow.com/questions/8235436/how-can-i-monitor-whats-being-put-into-the-standard-out-buffer-and-break-when-a

    catch syscall write
    condition 2 $rdi == 1 && strcmp((char *)$rsi, "a\n") == 0

The problem is that I wasn't able to automate getting the breakpoint number,
`2` in this example.

I currently need to manually read the number from stdout at creation time, or
`info breakpoints`.

With break, I can just use `break WHERE if COND`, which does not depend on the
explicit breakpoint number.

If it is not currently possible, would you consider a patch that adds `if` to
`catch syscall`?

Other possibilities include:

- make condition target the last `catch` by default, much like commands
- store the ID of the last set catchpoint in a magic convenience var

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-07-28  9:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-28  9:58 [Bug breakpoints/18727] New: Add if to catch syscall to automate getting condition id ciro.santilli at gmail dot com

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).