Need information on "set endian" on a tanning machine

Can any one tell or show the difference in the behavior of any program before and after I "install an infinite bit" in gdb on a Solaris machine?

I want to know the effect of changing it.

Thanks!

0
source share
2 answers

You should not set endianness when debugging (as opposed to remote).

However, you can observe the bad consequences of this:

(This is on a Linux / x86 machine, but I expect you to get similar results on Solaris / x86 and Solaris / SPARC).

int main()
{
  int x = 0x1020304;
  return x;
}


gdb -q a.out
Reading symbols from /tmp/a.out...done.
(gdb) b 4
Breakpoint 1 at 0x804835c: file t.c, line 4.
(gdb) r

Breakpoint 1, main () at t.c:4
4     return x;
(gdb) show endian
The target endianness is set automatically (currently little endian)
(gdb) p &x
$1 = (int *) 0xffffce60
(gdb) p/x *(int*)0xffffce60
$2 = 0x1020304
(gdb) set endian big
The target is assumed to be big endian
(gdb) p/x *(int*)0xffffce60
$3 = 0x4030201
+4
source

, , gdb, Employed Russian.

+2

All Articles