+2013-11-14 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ Fix dwfl_attach_state machine->elf.
+ * dwfl_frame.c (dwfl_attach_state): Change parameter machine to elf.
+ Call ebl_openbackend instead of ebl_openbackend_machine.
+ * libdwfl.h (dwfl_attach_state): Change parameter machine to elf.
+ Update the function description.
+ * linux-core-attach.c (__libdwfl_attach_state_for_core): Pass CORE to
+ dwfl_attach_state.
+ * linux-pid-attach.c (__libdwfl_attach_state_for_pid): Pass NULL to
+ dwfl_attach_state.
+
2013-11-06 Jan Kratochvil <jan.kratochvil@redhat.com>
Provide __libdwfl_module_getsym to get dwfl_file *.
}
bool
-dwfl_attach_state (Dwfl *dwfl, int machine, pid_t pid,
+dwfl_attach_state (Dwfl *dwfl, Elf *elf, pid_t pid,
const Dwfl_Thread_Callbacks *thread_callbacks, void *arg)
{
if (thread_callbacks == NULL || thread_callbacks->next_thread == NULL
}
Ebl *ebl;
bool ebl_close;
- if (machine != EM_NONE)
+ if (elf != NULL)
{
- ebl = ebl_openbackend_machine (machine);
+ ebl = ebl_openbackend (elf);
ebl_close = true;
}
else
} Dwfl_Thread_Callbacks;
/* PID is the process id associated with the DWFL state. Architecture of DWFL
- modules is specified by MACHINE. Use EM_NONE to detect architecture from
- DWFL. If EBL is NULL the function will detect it from arbitrary Dwfl_Module
- of DWFL. DWFL_ARG is the callback backend state. DWFL_ARG will be provided
- to the callbacks. *THREAD_CALLBACKS function pointers must remain valid
- during lifetime of DWFL. Function returns true on success,
- false otherwise. */
-bool dwfl_attach_state (Dwfl *dwfl, int machine, pid_t pid,
+ modules is specified by ELF, ELF must remain valid during DWFL lifetime.
+ Use NULL ELF to detect architecture from DWFL, the function will then detect
+ it from arbitrary Dwfl_Module of DWFL. DWFL_ARG is the callback backend
+ state. DWFL_ARG will be provided to the callbacks. *THREAD_CALLBACKS
+ function pointers must remain valid during lifetime of DWFL. Function
+ returns true on success, false otherwise. */
+bool dwfl_attach_state (Dwfl *dwfl, Elf *elf, pid_t pid,
const Dwfl_Thread_Callbacks *thread_callbacks,
void *dwfl_arg)
__nonnull_attribute__ (1, 4);
core_arg->note_data = note_data;
core_arg->thread_note_offset = 0;
core_arg->ebl = ebl;
- if (! INTUSE(dwfl_attach_state) (dwfl, ebl_get_elfmachine (ebl), pid,
- &core_thread_callbacks, core_arg))
+ if (! INTUSE(dwfl_attach_state) (dwfl, core, pid, &core_thread_callbacks,
+ core_arg))
{
free (core_arg);
ebl_closebackend (ebl);
}
pid_arg->dir = dir;
pid_arg->tid_attached = 0;
- if (! INTUSE(dwfl_attach_state) (dwfl, EM_NONE, pid, &pid_thread_callbacks,
+ if (! INTUSE(dwfl_attach_state) (dwfl, NULL, pid, &pid_thread_callbacks,
pid_arg))
{
closedir (dir);