mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-20 01:50:24 +08:00
make_corefile_notes: have caller free returned memory
The various make_corefile_notes implementations for gdbarch as well as target currently make an xfree cleanup on the data they return. This causes problems when trying to put a TRY_CATCH around the make_corefile_notes call. Specifically, we get a stale cleanup error in restore_my_cleanups. Omit the make_cleanup and have the caller free the memory. gdb/ * fbsd-nat.c (fbsd_make_corefile_notes): Remove make_cleanup call. * gcore.c (write_gcore_file): Free memory returned from make_corefile_notes. * linux-tdep.c (linux_make_corefile_notes): Remove make_cleanup call. * procfs.c (procfs_make_note_section): Remove make_cleanup call.
This commit is contained in:
@ -1502,7 +1502,6 @@ linux_make_corefile_notes (struct gdbarch *gdbarch, bfd *obfd, int *note_size,
|
||||
note_data = linux_make_mappings_corefile_notes (gdbarch, obfd,
|
||||
note_data, note_size);
|
||||
|
||||
make_cleanup (xfree, note_data);
|
||||
return note_data;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user