gdb: create_breakpoint: add asserts and additional comments

This commit extends the asserts on create_breakpoint (in the header
file), and adds some additional assertions into the definition.

The new assert confirms that when the thread and inferior information
is going to be parsed from the extra_string, then the thread and
inferior arguments should be -1.  That is, the caller of
create_breakpoint should not try to create a thread/inferior specific
breakpoint by *both* specifying thread/inferior *and* asking to parse
the extra_string, it's one or the other.

There should be no user visible changes after this commit.
This commit is contained in:
Andrew Burgess
2023-03-15 16:06:30 +00:00
parent daeda14191
commit 32f5a9896d
2 changed files with 22 additions and 0 deletions

View File

@@ -1610,6 +1610,22 @@ enum breakpoint_create_flags
the FORCE_CONDITION parameter is ignored and the corresponding argument
is parsed from EXTRA_STRING.
The THREAD should be a global thread number, the created breakpoint will
only apply for that thread. If the breakpoint should apply for all
threads then pass -1. However, if PARSE_EXTRA is non-zero then the
THREAD parameter is ignored and an optional thread number will be parsed
from EXTRA_STRING.
The INFERIOR should be a global inferior number, the created breakpoint
will only apply for that inferior. If the breakpoint should apply for
all inferiors then pass -1. However, if PARSE_EXTRA is non-zero then
the INFERIOR parameter is ignored and an optional inferior number will
be parsed from EXTRA_STRING.
At most one of THREAD and INFERIOR should be set to a value other than
-1; breakpoints can be thread specific, or inferior specific, but not
both.
If INTERNAL is non-zero, the breakpoint number will be allocated
from the internal breakpoint count.