Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: sperati <Sperati@cris.com>
Subject: UNSOLICITED JUNK E-MAIL. RETRUN TO SENDER.
Date: Mon, 2 Jun 1997 11:41:03 -0400 (EDT)	[thread overview]
Message-ID: <354586788bf5754b1eff92366e470c4c.axp-list@archive.invalid> (raw)
In-Reply-To: <Pine.LNX.3.95.970601210529.5006A-100000@naphta.mb.jhu.edu>

On Sun, 1 Jun 1997, Jeff Odom wrote:

> Date: Sun, 1 Jun 1997 21:15:18 -0400 (EDT)
> From: Jeff Odom <zeus@jhu.edu>
> Reply-To: axp-list@redhat.com
> To: axp-list@redhat.com
> Subject: fix for gdb
> Resent-Date: 2 Jun 1997 01:15:23 -0000
> Resent-From: axp-list@redhat.com
> Resent-cc: recipient list not shown: ;
> 
> It seems that gdb still has a problem stepping over calls to malloc().
> This is not isolated to only dynamic binaries, but includes static ones as
> well.  After spending a while tracing through the code, I found the
> offending code. This segment, taken from the gdb-4.16axp.patch.gz, seems
> to break calls to malloc():
> 
> diff -urN gdb-4.16/gdb/mdebugread.c gdb-4.16axp/gdb/mdebugread.c
> --- gdb-4.16/gdb/mdebugread.c   Sat Apr  6 02:09:55 1996
> +++ gdb-4.16axp/gdb/mdebugread.c        Wed May 22 19:17:06 1996
> @@ -835,7 +835,23 @@
>        if (sh->sc == scUndefined || sh->sc == scNil)
>         t = mdebug_type_int;
>        else
> -       t = parse_type (cur_fd, ax, sh->index + 1, 0, bigend, name);
> +       {
> +         t = parse_type (cur_fd, ax, sh->index + 1, 0, bigend, name);
> +         if (STREQ(name, "malloc") && t->code == TYPE_CODE_VOID)
> +           {
> +             /* I don't know why, but, at least under Linux/Alpha,
> +                when linking against a malloc without debugging
> +                symbols, its read as a function returning void---this
> +                is bad because it means we cannot call functions with
> +                string arguments interactively; i.e., "call
> +                printf("howdy\n")" would fail with the error message
> +                "program has no memory available".  To avoid this, we
> +                patch up the type and make it void*
> +                instead. (davidm@azstarnet.com)
> +                */
> +             t = t->pointer_type;
> +           }
> +       }
>        b = top_stack->cur_block;
>        if (sh->st == stProc)
>         {
> 
> The problem that this code looks like it is trying to address is that gdb,
> on Linux/Alpha, sees malloc() as returning a type void, instead of 
> (void *).  In this code, t is a block with information about a type, and
> t->pointer_type is a block with information about a pointer to that type.
> 
> I'm guessing that, in the case of t describing (void), t->pointer_type
> should describe (void *). However, in the case of a void type,
> t->pointer_type is always NULL.
> 
> I've removed this patch from the source build, and the resulting gdb seems
> to work fine.  However, I can't help but wonder if the problem that this
> patch addressed has been resolved elsewhere, or if I'm just breaking some
> other functionality.
> 
> Jeff Odom
> System Administrator
> The Johns Hopkins Kreiger Mind/Brain Institute
> 
> 
> --
> To unsubscribe: send e-mail to axp-list-request@redhat.com with
> 'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com
> 
> 

--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com

           reply	other threads:[~1997-06-02 15:41 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <Pine.LNX.3.95.970601210529.5006A-100000@naphta.mb.jhu.edu>]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox