This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA]: Fix gdb.base/long_long.exp for targets with 2-byte pointers
- To: Stephane Carrez <Stephane dot Carrez at worldnet dot fr>
- Subject: Re: [RFA]: Fix gdb.base/long_long.exp for targets with 2-byte pointers
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Wed, 06 Jun 2001 10:56:18 -0400
- Cc: gdb-patches at sources dot redhat dot com
- References: <3B07B07A.9D5B4987@worldnet.fr>
> +# Detect targets with 2-byte pointers.
> +
> +set sizeof_ptr 4
> +send_gdb "print sizeof(void*)\n"
> +gdb_expect {
> + -re ".* = 2.*$gdb_prompt $" { set sizeof_ptr 2 }
> + -re ".*$gdb_prompt $" { }
> + default { }
> +}
> +
Just an FYI, from sizeof.exp:
proc get_sizeof { type default } {
global gdb_prompt
send_gdb "print/d sizeof (${type})\n"
gdb_expect {
-re "\\$\[0-9\]* = (\[0-9\]*).*$gdb_prompt $" {
set size $expect_out(1,string)
pass "get sizeof ${type} ($size)"
}
timeout {
set size ${default}
fail "get sizeof ${type} (timeout)"
}
}
return ${size}
}
you may want to use something similar.
These patches are really Fernando's.
Andrew