This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC-v4] Fix .text section offset for windows DLL (was Calling __stdcall functions in the inferior)
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: Pierre Muller <pierre dot muller at ics-cnrs dot unistra dot fr>, 'Pedro Alves' <palves at redhat dot com>, 'Eli Zaretskii' <eliz at gnu dot org>, gdb-patches at sourceware dot org
- Date: Mon, 26 Nov 2012 21:58:28 +0100
- Subject: Re: [RFC-v4] Fix .text section offset for windows DLL (was Calling __stdcall functions in the inferior)
- References: <20121024194517.GK3555@adacore.com> <011901cdb2ab$48076b90$d81642b0$@muller@ics-cnrs.unistra.fr> <20121105171121.GA2972@adacore.com> <50991f5f.8382440a.1100.ffff82abSMTPIN_ADDED@mx.google.com> <509ABA17.30507@redhat.com> <000301cdbd96$f5cd9f10$e168dd30$@muller@ics-cnrs.unistra.fr> <20121122173019.GF9964@adacore.com> <009801cdcb5f$38ecd830$aac68890$@muller@ics-cnrs.unistra.fr> <20121126172227.GB3089@adacore.com> <87ip8sgqj0.fsf@fleche.redhat.com>
> Here, 'entry' is used to look in the hash table, but it is not entered
> into the hash table itself. For that you have to go into the subsequent
> "*slot == NULL" code; and there it allocates a new entry on the
> objfile's obstack. There are two cases, but e.g.:
>
> *slot = obstack_alloc (&objfile->objfile_obstack,
> offsetof (struct demangled_name_entry,
> demangled)
> + demangled_len + 1);
Ah, I got tricked by the INSERT, but looking at the htab_find_slot
documentation, indeed, it clearly explains that the data still needs
to be set. I wasn't able to to determine from just reading the code
where we might be creating a dangling pointer.
> I think there's no need; this is what the 'copy_name=1' case is for.
Right. We just need to dig deeper to figure out what it's not working
for Pierre... I don't think we want to check in his patch where
the xmalloc'ed name does not have a corresponding xfree...
Thanks, Tom.
--
Joel