This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Patch - Crash while printing static variables without global symbols.
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: SÅawomir Wojtasiak <slawomir dot wojtasiak at fcml-lib dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 26 Feb 2015 11:02:04 +0000
- Subject: Re: Patch - Crash while printing static variables without global symbols.
- Authentication-results: sourceware.org; auth=none
- References: <1424899530 dot 21149 dot 17 dot camel at fcml-lib dot com>
SÅawomir Wojtasiak <slawomir.wojtasiak@fcml-lib.com> writes:
> I've found a bug related to the variable printing functionality for C++
> language. The bug showed itself when GDB tried to print a static
> variable and global symbol describing that variable wasn't found in
> object files. I've added a simple sanity checking just to prevent
> accessing an empty pointer in such a case, by skipping
> 'cp_print_static_field' (gdb/cp-varprint.c:329) function.
Thanks for your patch, however the way you post your patch isn't
friendly to people to review it. You can use 'git send-email'
to send your patch to gdb-patches@, instead of sending a .tgz, so that
people can read your patch in their mailer, and review it easily.
Could you please provide a reproducer, a cpp file, and steps cause gdb
crash, and after your patch, the crash disappeared? We can convert it
to a dejagnu test case for gdb later.
>
> Attached archive consists of the following files:
> 0001-This-fix-prevents-crashes-while-accessing-static-var.patch - commit
> as git format-path
>
> 0001-This-fix-prevents-crashes-while-accessing-static-var.diff - plain
> diff.
>
> ChangeLog - Change log entry.
We include changelog entry in the git commit message too, please take a
look at https://sourceware.org/gdb/wiki/ContributionChecklist
--
Yao (éå)