Bug 87677 - Disassembly from core files doesn't work
Disassembly from core files doesn't work
Product: Red Hat Linux
Classification: Retired
Component: gdb (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Elena Zannoni
Jay Turner
Depends On:
Blocks: 85605
  Show dependency treegraph
Reported: 2003-03-31 23:53 EST by Elena Zannoni
Modified: 2015-01-07 19:04 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2003-04-04 13:10:43 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Elena Zannoni 2003-03-31 23:53:06 EST
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 13:10:43 EST
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

Note You need to log in before you can comment on or make changes to this bug.