[PATCH] Error when gdb_is_target_1 is called without running gdb instance

Keith Seitz keiths@redhat.com
Mon Feb 28 15:41:26 GMT 2022


On 2/25/22 08:44, Tom Tromey wrote:
>>>>>> "Keith" == Keith Seitz via Gdb-patches <gdb-patches@sourceware.org> writes:
> 
> Keith> This patch adds appropriate warning comments to these procs and
> Keith> causes gdb_is_target_1 to issue a Tcl error if it is called without a
> Keith> gdb instance already running.  This should prevent unwitting callers
> Keith> from using this at the wrong time.
> 
> Looks good.
> 
> This is one thing I really like about the mythical internal AdaCore test
> suite: in it, when you start gdb, you get an object back, and so
> something like this would be a method on the object -- impossible to
> call without it.

I think that's a great way to deal with issues like this. I wonder if
we could piecemeal implement a holistic change such as this, though?
Given the size of our test suite, that would be a *lot* of auditing!

 From where I sit, though, there are "bigger fish" to go after. :-(

Thank you for the review, I've pushed this change.

Keith



More information about the Gdb-patches mailing list