This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [rfc] Prompt memory management/cleanups
>>>>> "Pedro" == Pedro Alves <pedro@codesourcery.com> writes:
Pedro> You've asked for comments on the API, and IMO this makes for
Pedro> a weird API, because the caller of set_prompt needs to know
Pedro> whether set_prompt will take ownership of the pointer or not
Pedro> depending on where the pointer came from. I haven't looked
Pedro> at the callers -- that's why I asked what would need to
Pedro> change. :-)
The problem case is set_prompt(get_prompt()), but here the prompt code
already owns the pointer. I guess it is a little weird, but it still
falls under the general rule of "you have to call get_prompt again to
get the prompt after set_prompt".
Tom