Commit 5783e15
Philippe Waroquiers
(re-)fix the regcache leaks when detaching from an executable.
Commit 799efbe was supposed to fix
the below leak. However, for this fix to work, it is critical to
save the ptid before detach.
This commit (pushed as OBVIOUS, as the change was already reviewed/approved)
saves the ptid before the detach, as in the original reviewed patch
(see https://sourceware.org/ml/gdb-patches/2019-02/msg00263.html).
Re-tested on debian/amd64, natively and under valgrind.
==7426== 1,123 (72 direct, 1,051 indirect) bytes in 1 blocks are definitely lost in loss record 2,872 of 3,020
==7426== at 0x4C2C4CC: operator new(unsigned long) (vg_replace_malloc.c:344)
==7426== by 0x5BD1E1: get_thread_arch_aspace_regcache(ptid_t, gdbarch*, address_space*) (regcache.c:330)
==7426== by 0x5BD39A: get_thread_regcache (regcache.c:366)
==7426== by 0x5BD39A: get_current_regcache() (regcache.c:372)
==7426== by 0x4B1EB4: get_current_frame() (frame.c:1588)
...1 parent 83bfc77 commit 5783e15
1 file changed
+8
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2013 | 2013 | | |
2014 | 2014 | | |
2015 | 2015 | | |
| 2016 | + | |
| 2017 | + | |
| 2018 | + | |
| 2019 | + | |
| 2020 | + | |
2016 | 2021 | | |
2017 | 2022 | | |
2018 | 2023 | | |
| |||
2033 | 2038 | | |
2034 | 2039 | | |
2035 | 2040 | | |
2036 | | - | |
2037 | | - | |
2038 | | - | |
2039 | | - | |
| 2041 | + | |
2040 | 2042 | | |
2041 | 2043 | | |
2042 | | - | |
2043 | | - | |
| 2044 | + | |
| 2045 | + | |
2044 | 2046 | | |
2045 | 2047 | | |
2046 | 2048 | | |
| |||
0 commit comments