This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 1/2] Remove munmap_listp_free_cleanup


On 09/15/2018 11:24 PM, Tom Tromey wrote:
> -static void
> -munmap_listp_free_cleanup (void *headp_voidp)
> +munmap_list::~munmap_list ()
>  {
> -  struct munmap_list **headp = (struct munmap_list **) headp_voidp;
> -
> -  munmap_list_free (*headp);
> +  for (auto &item : items)
> +    gdbarch_infcall_munmap (target_gdbarch (), item.addr, item.size);
>  }

I think we should wrap that in try/catch, because an infcall can be
aborted/throw, and we're in a destructor.

Thanks,
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]