[Bug breakpoints/18727] New: Add if to catch syscall to automate getting condition id
ciro.santilli at gmail dot com
sourceware-bugzilla@sourceware.org
Tue Jul 28 09:58:00 GMT 2015
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.
More information about the Gdb-prs
mailing list