Bug 87677

Summary: Disassembly from core files doesn't work
Product: [Retired] Red Hat Linux Reporter: Elena Zannoni <ezannoni>
Component: gdbAssignee: Elena Zannoni <ezannoni>
Status: CLOSED RAWHIDE QA Contact: Jay Turner <jturner>
Severity: medium Docs Contact:
Priority: medium    
Version: 9CC: srevivo
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-04-04 18:10:43 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 85605    

Description Elena Zannoni 2003-04-01 04:53:06 UTC
Description of problem:
When reading a core file, the 'disassemble' command doesn't work, while the 'x'
command works fine.  If you run the code inside gdb you get the correct disass

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:

Take a RHL9 install and compile:

#include <string.h>
main (void)
  stpcpy (NULL, "dd");
  return 0;

Nothing special about stpcpy, it's a function gcc has no inlines for.
Now run it and create a core (ulimit -c unlimited is your friend).
Finally start gdb with the core file and run "disass".  The result:

(gdb) disass
Dump of assembler code for function stpcpy:
0x4207be30 <stpcpy+0>:  Cannot access memory at address 0x4207be30

Actual results:

Expected results:

Additional info:

Comment 1 Elena Zannoni 2003-04-04 18:10:43 UTC
This was a problem in the disassembly command:

--- gdb+dejagnu-20021129/gdb/disasm.c.1 Mon Mar 31 22:33:18 2003
+++ gdb+dejagnu-20021129/gdb/disasm.c   Mon Mar 31 22:35:53 2003
@@ -360,7 +360,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 */
        gdb_disassemble_from_exec = 1;  /* It's remote, read the exec file */

Fixed now in gdb-5.3post-0.20021129.29