This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] i386-tdep.c, check target_read_memory for error.


Jan Kratochvil wrote:
On Fri, 04 Mar 2011 22:37:52 +0100, Michael Snyder wrote:
Call error if target_read_memory fails.
[...]
- target_read_memory (pc, &op, 1);
+ if (target_read_memory (pc, &op, 1))
+ error (_("Couldn't read memory at pc (%s)"), + paddress (gdbarch, pc));

There is the function `read_memory' for such purpose.

I don't understand the objection. target_read_memory may fail and return an error code. Coverity reports that the return value is checked in 78 out of 97 calling instances. So what's wrong with checking it now?



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]