This is the mail archive of the
mailing list for the GDB project.
Re: [PATCH] arm reversible : <phase_2_complete>
- From: Tom Tromey <tromey at redhat dot com>
- To: Petr HluzÃn <petr dot hluzin at gmail dot com>
- Cc: paawan oza <paawan1982 at yahoo dot com>, "gdb-patches\ at sourceware dot org" <gdb-patches at sourceware dot org>, chandra krishnappa <chandra_roadking at yahoo dot com>
- Date: Mon, 07 Nov 2011 08:38:45 -0700
- Subject: Re: [PATCH] arm reversible : <phase_2_complete>
- References: <firstname.lastname@example.org> <email@example.com> <firstname.lastname@example.org> <email@example.com> <1316327455.23344.YahooMailNeo@web112509.mail.gq1.yahoo.com> <1316404058.27177.YahooMailNeo@web112502.mail.gq1.yahoo.com> <firstname.lastname@example.org> <1318650316.91503.YahooMailNeo@web112508.mail.gq1.yahoo.com> <CAC=yr6D+d-Q4Yzfm6AoWSYgb4+Bopubg4wFDX9QDSUUFFcFtWg@mail.gmail.com> <email@example.com> <CAC=yr6BAsuR-_Z6dbqYBXkKESCX7CkKOuUAYYtRFcT6==Mo5Gw@mail.gmail.com>
>>>>> "Petr" == Petr HluzÃn <firstname.lastname@example.org> writes:
Petr> How strong is the "can't happen" requirement? Is programmer required
Petr> to prove the assertion cannot be triggered? The difficulty in general
Petr> case would be equivalent to proving a code is bug-free - i.e. it is
Petr> impossible. At my job we try to verify an assumption until we have a
Petr> sort-of-proof or the search becomes difficult and no clue/indication
Petr> to the contrary has been found yet.
Petr> I am asking because GDB code contains surprisingly few assertions.
I don't think there is a hard-and-fast rule in gdb. I am not completely
I think in gdb it is best to error instead of assert if there is any
doubt. That's because I think when people turn to gdb they are already
a bit frustrated, and then if gdb itself fails, this is extremely
irritating. That's certainly been the case for me in the past.
I realize you can sort of recover from internal_error (and hence
assertions). But my impression is that internal_error is treated like
"not an exception-thrower" in gdb, leading to cleanup problems and the
Petr> Anyway, the patch had used assertions correctly because expression
Petr> `bits (X, 21, 24)' yields value in range 0..15 for any value of X - no
Petr> matter how bogus X value. Yes, all 2^32 values map to 0..15. The
Petr> assertions satisfy the guideline. (This is not even the hard-to-prove
Petr> case I was speculating above.)
Yeah, my review was wrong here.