mirror of
https://github.com/tobast/libunwind-eh_elf.git
synced 2025-04-01 20:02:17 +02:00
dwarf:Drop dwarf_create_state_record.
In dwarf_make_proc_info, fix a leak in the case that create_state_record fails.
This commit is contained in:
parent
3775cdd997
commit
59ecb24ca2
2 changed files with 9 additions and 19 deletions
|
@ -398,7 +398,6 @@ struct dwarf_callback_data
|
||||||
#define dwarf_extract_proc_info_from_fde \
|
#define dwarf_extract_proc_info_from_fde \
|
||||||
UNW_OBJ (dwarf_extract_proc_info_from_fde)
|
UNW_OBJ (dwarf_extract_proc_info_from_fde)
|
||||||
#define dwarf_find_save_locs UNW_OBJ (dwarf_find_save_locs)
|
#define dwarf_find_save_locs UNW_OBJ (dwarf_find_save_locs)
|
||||||
#define dwarf_create_state_record UNW_OBJ (dwarf_create_state_record)
|
|
||||||
#define dwarf_make_proc_info UNW_OBJ (dwarf_make_proc_info)
|
#define dwarf_make_proc_info UNW_OBJ (dwarf_make_proc_info)
|
||||||
#define dwarf_read_encoded_pointer UNW_OBJ (dwarf_read_encoded_pointer)
|
#define dwarf_read_encoded_pointer UNW_OBJ (dwarf_read_encoded_pointer)
|
||||||
#define dwarf_step UNW_OBJ (dwarf_step)
|
#define dwarf_step UNW_OBJ (dwarf_step)
|
||||||
|
@ -441,8 +440,6 @@ extern int dwarf_extract_proc_info_from_fde (unw_addr_space_t as,
|
||||||
int is_debug_frame,
|
int is_debug_frame,
|
||||||
void *arg);
|
void *arg);
|
||||||
extern int dwarf_find_save_locs (struct dwarf_cursor *c);
|
extern int dwarf_find_save_locs (struct dwarf_cursor *c);
|
||||||
extern int dwarf_create_state_record (struct dwarf_cursor *c,
|
|
||||||
dwarf_state_record_t *sr);
|
|
||||||
extern int dwarf_make_proc_info (struct dwarf_cursor *c);
|
extern int dwarf_make_proc_info (struct dwarf_cursor *c);
|
||||||
extern int dwarf_read_encoded_pointer (unw_addr_space_t as,
|
extern int dwarf_read_encoded_pointer (unw_addr_space_t as,
|
||||||
unw_accessors_t *a,
|
unw_accessors_t *a,
|
||||||
|
|
|
@ -925,14 +925,6 @@ dwarf_find_save_locs (struct dwarf_cursor *c)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The proc-info must be valid for IP before this routine can be
|
|
||||||
called. */
|
|
||||||
HIDDEN int
|
|
||||||
dwarf_create_state_record (struct dwarf_cursor *c, dwarf_state_record_t *sr)
|
|
||||||
{
|
|
||||||
return create_state_record_for (c, sr, c->ip);
|
|
||||||
}
|
|
||||||
|
|
||||||
HIDDEN int
|
HIDDEN int
|
||||||
dwarf_make_proc_info (struct dwarf_cursor *c)
|
dwarf_make_proc_info (struct dwarf_cursor *c)
|
||||||
{
|
{
|
||||||
|
@ -940,18 +932,19 @@ dwarf_make_proc_info (struct dwarf_cursor *c)
|
||||||
if (c->as->caching_policy == UNW_CACHE_NONE
|
if (c->as->caching_policy == UNW_CACHE_NONE
|
||||||
|| get_cached_proc_info (c) < 0)
|
|| get_cached_proc_info (c) < 0)
|
||||||
#endif
|
#endif
|
||||||
|
/* Need to check if current frame contains
|
||||||
|
args_size, and set cursor appropriately. Only
|
||||||
|
needed for unw_resume */
|
||||||
dwarf_state_record_t sr;
|
dwarf_state_record_t sr;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
/* Lookup it up the slow way... */
|
/* Lookup it up the slow way... */
|
||||||
if ((ret = fetch_proc_info (c, c->ip, 0)) < 0)
|
ret = fetch_proc_info (c, c->ip, 0);
|
||||||
return ret;
|
if (ret >= 0)
|
||||||
/* Also need to check if current frame contains
|
ret = create_state_record_for (c, &sr, c->ip);
|
||||||
args_size, and set cursor appropriatly. Only
|
|
||||||
needed for unw_resume */
|
|
||||||
if ((ret = dwarf_create_state_record (c, &sr)) < 0)
|
|
||||||
return ret;
|
|
||||||
put_unwind_info (c, &c->pi);
|
put_unwind_info (c, &c->pi);
|
||||||
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
c->args_size = sr.args_size;
|
c->args_size = sr.args_size;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Add table
Reference in a new issue