This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PING2] : [RFC/RFA] PING: skip __main
> From: "Pierre Muller" <muller@ics.u-strasbg.fr>
> Date: Fri, 30 May 2008 16:46:28 +0200
>
> + target_read_memory (pc, &op, 1);
> + if (op == 0xe8)
> + {
> + gdb_byte buf[4];
> +
> + if (target_read_memory (pc + 1, buf, sizeof buf) == 0)
> + {
> + CORE_ADDR call_dest = pc + 5 + extract_unsigned_integer (buf, 4);
> Just one small question about this line:
> I fear that this line is incorrect,
> shouldn't we use extract_signed_integer here?
>
> The address is relative to pc+5 meaning that
> if main is at a higher address than __main,
> buf will contain a negative 4byte integer.
You're absolutely right. Can you make that change and retest?