RE: [PING2] : [RFC/RFA] PING: skip __main

Pierre Muller
2008-05-30T15:13:12Z

I restarted a testsuite, but I
won't expect any change because
main seems to be at a lower address than __main
in the few executables I tested, meaning that
the value in buf will be positive anyhow.

Pierre Muller
Pascal language support maintainer for GDB

-----Message d'origine-----
De : gdb-patches-owner@sourceware.org
[mailto:gdb-patches-owner@sourceware.org] De la part de Mark Kettenis
Envoyé : Friday, May 30, 2008 4:58 PM
À : muller@ics.u-strasbg.fr
Cc : pedro@codesourcery.com; drow@false.org; gdb-patches@sourceware.org
Objet : 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?