public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* [RFC] The never ending 32-bit vs. 64-bit blues
@ 2005-11-07 22:45 Mark Kettenis
  2005-11-07 22:50 ` Jim Ingham
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Mark Kettenis @ 2005-11-07 22:45 UTC (permalink / raw)
  To: gdb

In the past we have had a lot of bug reports from people trying to
debug 64-bit programs with a native 32-bit gdb.  As far as I know we
don't support any native configuration that allows this.  I've never
quite managed to come up with a satisfactory solution to deal with
this.  Here's an attempt to deal with it by making configure complain.

Any opinions about this?

Mark


Index: configure.ac
===================================================================
RCS file: /cvs/src/src/gdb/configure.ac,v
retrieving revision 1.24
diff -u -p -r1.24 configure.ac
--- configure.ac	25 Jul 2005 15:08:40 -0000	1.24
+++ configure.ac	7 Nov 2005 22:34:19 -0000
@@ -34,6 +34,19 @@ AM_PROG_CC_STDC
 AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/..)
 AC_CANONICAL_SYSTEM
 
+# Sanity check; refuse to build a native GDB for a 64-bit target with
+# a 32-bit compiler.
+AC_CHECK_SIZEOF(void *)
+if test "${target}" = "${host}"; then
+  case "$host_cpu" in
+  hppa64|mips64*|powerpc64|sparc64|x86_64)
+    if test $ac_cv_sizeof_void_p != 8; then
+      AC_MSG_ERROR(
+[building native target ${host} with a 32-bit compiler is not supported])
+    fi
+  esac
+fi
+
 dnl List of object files and targets accumulated by configure.
 
 CONFIG_OBS=

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC] The never ending 32-bit vs. 64-bit blues
  2005-11-07 22:45 [RFC] The never ending 32-bit vs. 64-bit blues Mark Kettenis
@ 2005-11-07 22:50 ` Jim Ingham
  2005-11-07 22:52 ` David Lecomber
  2005-11-07 22:59 ` Daniel Jacobowitz
  2 siblings, 0 replies; 4+ messages in thread
From: Jim Ingham @ 2005-11-07 22:50 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: gdb

Just as a point of information, Apple's PPC gdb (built 32 bit) can  
debug both 32 and 64 bit PPC apps.  We have a 32 bit native gdb with  
a 32 bit and a 64 bit gdbarch.  Seems to work okay so far.

Jim

On Nov 7, 2005, at 2:45 PM, Mark Kettenis wrote:

> In the past we have had a lot of bug reports from people trying to
> debug 64-bit programs with a native 32-bit gdb.  As far as I know we
> don't support any native configuration that allows this.  I've never
> quite managed to come up with a satisfactory solution to deal with
> this.  Here's an attempt to deal with it by making configure complain.
>
> Any opinions about this?
>
> Mark
>
>
> Index: configure.ac
> ===================================================================
> RCS file: /cvs/src/src/gdb/configure.ac,v
> retrieving revision 1.24
> diff -u -p -r1.24 configure.ac
> --- configure.ac    25 Jul 2005 15:08:40 -0000    1.24
> +++ configure.ac    7 Nov 2005 22:34:19 -0000
> @@ -34,6 +34,19 @@ AM_PROG_CC_STDC
>  AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/..)
>  AC_CANONICAL_SYSTEM
>
> +# Sanity check; refuse to build a native GDB for a 64-bit target with
> +# a 32-bit compiler.
> +AC_CHECK_SIZEOF(void *)
> +if test "${target}" = "${host}"; then
> +  case "$host_cpu" in
> +  hppa64|mips64*|powerpc64|sparc64|x86_64)
> +    if test $ac_cv_sizeof_void_p != 8; then
> +      AC_MSG_ERROR(
> +[building native target ${host} with a 32-bit compiler is not  
> supported])
> +    fi
> +  esac
> +fi
> +
>  dnl List of object files and targets accumulated by configure.
>
>  CONFIG_OBS=
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC] The never ending 32-bit vs. 64-bit blues
  2005-11-07 22:45 [RFC] The never ending 32-bit vs. 64-bit blues Mark Kettenis
  2005-11-07 22:50 ` Jim Ingham
@ 2005-11-07 22:52 ` David Lecomber
  2005-11-07 22:59 ` Daniel Jacobowitz
  2 siblings, 0 replies; 4+ messages in thread
From: David Lecomber @ 2005-11-07 22:52 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: gdb

On Mon, 2005-11-07 at 23:45 +0100, Mark Kettenis wrote:
> In the past we have had a lot of bug reports from people trying to
> debug 64-bit programs with a native 32-bit gdb.  As far as I know we
> don't support any native configuration that allows this.  I've never
> quite managed to come up with a satisfactory solution to deal with
> this.  Here's an attempt to deal with it by making configure complain.
> 

Hi Mark,

AIX's can only be run within a 32-bit debugger, even for 64-bit apps --
ie. their ptrace only be called in 32-bit mode.

Cheers
d.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC] The never ending 32-bit vs. 64-bit blues
  2005-11-07 22:45 [RFC] The never ending 32-bit vs. 64-bit blues Mark Kettenis
  2005-11-07 22:50 ` Jim Ingham
  2005-11-07 22:52 ` David Lecomber
@ 2005-11-07 22:59 ` Daniel Jacobowitz
  2 siblings, 0 replies; 4+ messages in thread
From: Daniel Jacobowitz @ 2005-11-07 22:59 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: gdb

On Mon, Nov 07, 2005 at 11:45:49PM +0100, Mark Kettenis wrote:
> In the past we have had a lot of bug reports from people trying to
> debug 64-bit programs with a native 32-bit gdb.  As far as I know we
> don't support any native configuration that allows this.  I've never
> quite managed to come up with a satisfactory solution to deal with
> this.  Here's an attempt to deal with it by making configure complain.
> 
> Any opinions about this?

For the situation as you've stated it, I don't agree.  Not only did
Richard post some PPC Linux patches to make this work, I'll have
patches for it for MIPS Linux shortly; I've done all the kernel bits
already and most of the testing.

The patch as you've posted it, however, isn't really very useful for
that goal.  But it does seem useful for another.  When you build a
32-bit PowerPC debugger you should be configuring it for powerpc-linux;
if you configure it for powerpc64-linux but use -m32, you're likely to
get pretty surprising results.  So I have no problem with the patch
itself :-)

-- 
Daniel Jacobowitz
CodeSourcery, LLC

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-11-07 22:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-07 22:45 [RFC] The never ending 32-bit vs. 64-bit blues Mark Kettenis
2005-11-07 22:50 ` Jim Ingham
2005-11-07 22:52 ` David Lecomber
2005-11-07 22:59 ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).