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] call observer_notify_new_objfile after the attach command


On 07/09/2014 02:51 PM, Adrian Sendroiu wrote:
> When debugging a remote bare-metal target which implements the gdb protocol,
> using target extended-remote + attach, gdb will not send the qSymbol packet,
> even if a file was previously specified using file or symbol-file.
> 
> Normally gdb would call remote_check_symbols in several places: the solib
> inferior hook, the add_vsyscall_page hook or if the executable file changed
> in the time passed between the file and the attach commands. Since none of these
> conditions hold in the above scenario (no shared libraries are used and no
> vsyscall page is present), gdb won't send a qSymbol packet.
> 
> To fix this problem this patch calls observer_notify_new_objfile after the attach
> command is completed, if such a symbol file is present.

But, if no new objfile was (re)loaded, then why call the new_objfile
observer?  That's a bit backwards as it makes the core assume
what a particular observer wants to do with the event/subject.  If
remote.c is interested in doing something when the attach is complete,
then we can look for such a hook.  And it turns out one already
exists -- target_post_attach.  So it seems like remote.c should call
remote_check_symbols from its target_post_attach method ?
That's not that different in principle from the remote_check_symbols
call in remote_start_remote.

-- 
Pedro Alves


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