This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: gdb sources
- From: Daniel Jacobowitz <drow at false dot org>
- To: André Pönitz <apoenitz at trolltech dot com>
- Cc: gdb at sources dot redhat dot com
- Date: Fri, 12 Sep 2008 11:35:34 -0400
- Subject: Re: gdb sources
- References: <200809121713.09226.apoenitz@trolltech.com>
On Fri, Sep 12, 2008 at 05:12:50PM +0200, André Pönitz wrote:
> In one branch, p points to a literal, in the other to the heap.
> shell_escape() does not seem to release any memory (would
> also be wrong in the literal case...), so if the else branch is
> taken it's a leak, no?
Yes, looks like a leak.
> (2) Most of the "strings" in gdb are "char *", even if they are
> conceptionally "const char *" (i.e. coming from literal, or not
> intended to be changed). Why? In some places "const" is also
> used, so the reason can't be "gdb supports compilers that
> don't know about 'const'". Is it "just legacy"? If so, would patches
> replacing "char *" by "const char *" if appropriate be welcome?
Yes, constifying patches are welcome. It's just that gdb _used_ to
support compilers that didn't know const, and may even predate
const in places.
> (3) Most of the declarations in command.h are repeated in
> cli/cli-decode.h even though cli-decode.h #include's command.h.
> Couldn't the duplicates just be removed?
Probably; I don't know the history of it.
--
Daniel Jacobowitz
CodeSourcery