From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30915 invoked by alias); 7 Apr 2003 13:24:30 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 30908 invoked from network); 7 Apr 2003 13:24:29 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 7 Apr 2003 13:24:29 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h37DOTe28370 for ; Mon, 7 Apr 2003 09:24:29 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h37DOTJ08659 for ; Mon, 7 Apr 2003 09:24:29 -0400 Received: from localhost.redhat.com (romulus-int.sfbay.redhat.com [172.16.27.46]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h37DOS315313 for ; Mon, 7 Apr 2003 09:24:29 -0400 Received: by localhost.redhat.com (Postfix, from userid 469) id E0A612C43D; Fri, 4 Apr 2003 18:04:48 -0500 (EST) From: Elena Zannoni MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16014.3984.767812.912971@localhost.redhat.com> Date: Mon, 07 Apr 2003 13:24:00 -0000 To: gdb-patches@sources.redhat.com Subject: [PATCH] disassembly fixes X-SW-Source: 2003-04/txt/msg00111.txt.bz2 A few fixes for the new disassembler. I'll commit in a day or so. 2003-04-04 Elena Zannoni * disasm.c (dump_insns): Move variables inside loop, or they will be freed more than once, causing wild memory corruptions. (gdb_disassembly): Look for the substring "-thread", instead of "-threads" in the target name, to make sure to find the 'multi-thread' target. Also, make sure we do the right thing with the "core" target. Index: disasm.c =================================================================== RCS file: /cvs/uberbaum/gdb/disasm.c,v retrieving revision 1.5 diff -u -p -r1.5 disasm.c --- disasm.c 17 Mar 2003 19:57:12 -0000 1.5 +++ disasm.c 4 Apr 2003 22:56:46 -0000 @@ -93,14 +93,15 @@ dump_insns (struct ui_out *uiout, disass /* parts of the symbolic representation of the address */ int unmapped; - char *filename = NULL; - char *name = NULL; int offset; int line; struct cleanup *ui_out_chain; for (pc = low; pc < high;) { + char *filename = NULL; + char *name = NULL; + QUIT; if (how_many >= 0) { @@ -358,7 +359,8 @@ gdb_disassembly (struct ui_out *uiout, if (strcmp (target_shortname, "child") == 0 || strcmp (target_shortname, "procfs") == 0 || strcmp (target_shortname, "vxprocess") == 0 - || strstr (target_shortname, "-threads") != NULL) + || strcmp (target_shortname, "core") == 0 + || strstr (target_shortname, "-thread") != NULL) gdb_disassemble_from_exec = 0; /* It's a child process, read inferior mem */ else gdb_disassemble_from_exec = 1; /* It's remote, read the exec file */