diff options
author | Andrew Burgess <aburgess@redhat.com> | 2023-03-15 16:06:30 +0000 |
---|---|---|
committer | Andrew Burgess <aburgess@redhat.com> | 2024-03-31 11:12:35 +0100 |
commit | 32f5a9896d1a1b9a3d953062a2c89a493291a2e3 (patch) | |
tree | b16adfc6d087016122b004776ca2693f1222ca1f /gdb/breakpoint.c | |
parent | daeda14191c1710ce967259a47ef4e0a3fb6eebf (diff) | |
download | binutils-32f5a9896d1a1b9a3d953062a2c89a493291a2e3.zip binutils-32f5a9896d1a1b9a3d953062a2c89a493291a2e3.tar.gz binutils-32f5a9896d1a1b9a3d953062a2c89a493291a2e3.tar.bz2 |
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.
Diffstat (limited to 'gdb/breakpoint.c')
-rw-r--r-- | gdb/breakpoint.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 053d17d..0da666d 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -9220,6 +9220,12 @@ create_breakpoint (struct gdbarch *gdbarch, gdb_assert (inferior == -1 || inferior > 0); gdb_assert (thread == -1 || inferior == -1); + /* If PARSE_EXTRA is true then the thread and inferior details will be + parsed from the EXTRA_STRING, the THREAD and INFERIOR arguments + should be -1. */ + gdb_assert (!parse_extra || thread == -1); + gdb_assert (!parse_extra || inferior == -1); + gdb_assert (ops != NULL); /* If extra_string isn't useful, set it to NULL. */ |