Branch: Tag:

2003-10-20

2003-10-20 13:11:22 by Martin Stjernholm <mast@lysator.liu.se>

Don't fiddle with shared strings in gdb_backtrace; it has to be more
robust than that.

Rev: src/interpret.c:1.335

2:   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: interpret.c,v 1.334 2003/10/01 15:07:00 grubba Exp $ + || $Id: interpret.c,v 1.335 2003/10/20 13:11:22 mast Exp $   */      #include "global.h" - RCSID("$Id: interpret.c,v 1.334 2003/10/01 15:07:00 grubba Exp $"); + RCSID("$Id: interpret.c,v 1.335 2003/10/20 13:11:22 mast Exp $");   #include "interpret.h"   #include "object.h"   #include "program.h"
2386:    for (of = 0; f; f = (of = f)->next)    if (f->refs) {    int args, i; -  struct pike_string *file = NULL; +  char *file = NULL;    INT32 line;       if (f->context.prog) {    if (f->pc) -  file = get_line (f->pc, f->context.prog, &line); +  file = low_get_line_plain (f->pc, f->context.prog, &line, 0);    else -  file = get_program_line (f->context.prog, &line); +  file = low_get_program_line_plain (f->context.prog, &line, 0);    } -  if (file) { -  fprintf (stderr, "%s:%d: ", file->str, line); -  free_string(file); -  } else +  if (file) +  fprintf (stderr, "%s:%d: ", file, line); +  else    fputs ("unknown program: ", stderr);       if (f->current_object && f->current_object->prog) {
2507:    case T_OBJECT: {    struct program *p = arg->u.object->prog;    if (p && p->num_linenumbers) { -  file = get_program_line (p, &line); -  fprintf (stderr, "object(%s:%d)", file->str, line); -  free_string(file); +  file = low_get_program_line_plain (p, &line, 0); +  fprintf (stderr, "object(%s:%d)", file, line);    }    else    fputs ("object", stderr);
2519:    case T_PROGRAM: {    struct program *p = arg->u.program;    if (p->num_linenumbers) { -  file = get_program_line (p, &line); +  file = low_get_program_line_plain (p, &line, 0);    fprintf (stderr, "program(%s:%d)", file->str, line); -  free_string(file); +     }    else    fputs ("program", stderr);