On Wed, 2011-10-12 at 15:01 -0600, Tom Tromey wrote:
Dave> Thanks. Should be fixed as of
b6496b518378d67067f42c15057664643943b9b1
Thanks, that helped.
I got a bunch more errors this time. Probably they were there all
along, I just stopped at the first one.
Yes, I've been running into similar behavior when running the checker
against the plugin.
I've appended a short summary of all of them -- I did some
simple
uniquification, but it didn't collapse everything possible. Many
problems seem to be missing exprcodes, there is just a single spot in
absinterp.py that gives that error.
Many thanks for doing this. Various replies inline below.
I also get some false errors. E.g.:
../../archer/gdb/arm-tdep.c: In function ‘gdb_print_insn_arm’:
../../archer/gdb/arm-tdep.c:8381:10: error: comparison against uninitialized data:
gcc.VarDecl(31027) at ../../archer/gdb/arm-tdep.c:8381
The code here is:
static struct coff_symbol_struct csym;
static struct bfd fake_bfd;
static bfd_target fake_target;
if (csym.native == NULL)
{
... since csym is static, it is 0-initialized.
Ooops; thanks. I've fixed this in
fcc1a57b50dae09868451e229242ebe4d81198a5
http://git.fedorahosted.org/git/?p=gcc-python-plugin.git;a=commitdiff;h=f...
As noted in that commit, it doesn't yet attempt to track the state of
such static variables across multiple function calls - it assumes an
UnknownValue at the top of the function each time, hence it will report
on some impossible paths (e.g. in the test case in my commit) - but at
least it ought to fix that false warning above.
Or another example:
../../archer/gdb/arm-linux-tdep.c: In function ‘arm_linux_cleanup_svc’:
../../archer/gdb/arm-linux-tdep.c:874:18: error: comparison against uninitialized data:
gcc.VarDecl('apparent_pc.15') at ../../archer/gdb/arm-linux-tdep.c:874
../../archer/gdb/arm-linux-tdep.c:868:13: note: when treating unknown struct
displaced_step_closure * from ../../archer/gdb/arm-linux-tdep.c:866 as non-NULL at:
CORE_ADDR from = dsc->insn_addr;
../../archer/gdb/arm-linux-tdep.c:867:1: note: graphical error report for function
'arm_linux_cleanup_svc' written out to
'arm-linux-tdep.c.arm_linux_cleanup_svc-refcount-errors.html'
Here the code is:
CORE_ADDR from = dsc->insn_addr;
ULONGEST apparent_pc;
int within_scratch;
regcache_cooked_read_unsigned (regs, ARM_PC_REGNUM, &apparent_pc);
within_scratch = (apparent_pc >= dsc->scratch_base
&& apparent_pc < (dsc->scratch_base
+ DISPLACED_MODIFIED_INSNS * 4 + 4));
regcache_cooked_read_unsigned sets apparent_pc, so it isn't
uninitialized.
This is a different bug, which (I hope) I've fixed in
496bf276623d6930fe8cfbc42a837cbc62bfe519
http://git.fedorahosted.org/git/?p=gcc-python-plugin.git;a=commitdiff;h=4...
How would you like to proceed? You can check out and build gdb
pretty
easily... that might be the simplest. Otherwise I can provide context
for all of the appended, but that will take some time.
What recipe are you using to check out and configure the code?
There is a third way, which is to try compiling GCC's own test suite,
using GCC with the cpychecker code. That ought to achieve a much higher
level of coverage than I've been getting up till now. I may have a look
at this tomorrow.
BTW, is the code you're compiling purely C ?
In the meantime, here are some notes on the other errors you reported:
AttributeError: 'NoneType' object has no attribute
'loc'
I'm not sure of the context for this one ^^^^
NotImplementedError: Don't know how to cope with exprcode:
<type 'gcc.AbsExpr'> (<type 'gcc.AbsExpr'>)
NotImplementedError: Don't know how to cope with exprcode: <type
'gcc.BitFieldRef'> (<type 'gcc.BitFieldRef'>)
NotImplementedError: Don't know how to cope with exprcode: <type
'gcc.BitNotExpr'> (<type 'gcc.BitNotExpr'>)
NotImplementedError: Don't know how to cope with exprcode: <type
'gcc.Constructor'> (<type 'gcc.Constructor'>)
NotImplementedError: Don't know how to cope with exprcode: <type
'gcc.MaxExpr'> (<type 'gcc.MaxExpr'>)
NotImplementedError: Don't know how to cope with exprcode: <type
'gcc.MinExpr'> (<type 'gcc.MinExpr'>)
NotImplementedError: Don't know how to cope with exprcode: <type
'gcc.NegateExpr'> (<type 'gcc.NegateExpr'>)
NotImplementedError: Don't know how to cope with exprcode: <type
'gcc.TruncModExpr'> (<type 'gcc.TruncModExpr'>)
NotImplementedError: Don't know how to cope with exprcode: <type
'gcc.TruthXorExpr'> (<type 'gcc.TruthXorExpr'>)
Re the
above, I'm not sure of the context for the 'gcc.Constructor' one.
I think I can figure out the other ones.
NotImplementedError: Don't know how to cope with
gcc.GimplePredict() (// predicted unlikely by continue predictor.)
^^^ not sure
where this is coming from
NotImplementedError: Don't know how to cope with type conversion
of: ConcreteValue(gcctype='int',
loc=gcc.Location(file='../../archer/gdb/arm-tdep.c', line=7719), value=1) ((int)1
from ../../archer/gdb/arm-tdep.c:7719)
... snip various similar ones...
^^^ I'm running into these myself, FWIW
TypeError: struct gdbarch_info / <gcc.RecordType object
TypeError: struct srcdest / <gcc.RecordType object
^^^ not sure what happened
here
TypeError: type "const void" does not have a
"sizeof"
TypeError: type "void" does not have a "sizeof"
^^^ not sure
what happened here
Thanks again for the feedback
Dave