gdb sources

Daniel Jacobowitz drow@false.org
Fri Sep 12 15:36:00 GMT 2008


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



More information about the Gdb mailing list