mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-28 01:50:48 +00:00
New /s modifier for the disassemble command.
The "source centric" /m option to the disassemble command is often unhelpful, e.g., in the presence of optimized code. This patch adds a /s modifier that is better. For one, /m only prints instructions from the originating source file, leaving out instructions from e.g., inlined functions from other files. gdb/ChangeLog: PR gdb/11833 * NEWS: Document new /s modifier for the disassemble command. * cli/cli-cmds.c (disassemble_command): Add support for /s. (_initialize_cli_cmds): Update online docs of disassemble command. * disasm.c: #include "source.h". (struct deprecated_dis_line_entry): Renamed from dis_line_entry. All uses updated. (dis_line_entry): New struct. (hash_dis_line_entry, eq_dis_line_entry): New functions. (allocate_dis_line_table): New functions. (maybe_add_dis_line_entry, line_has_code_p): New functions. (dump_insns): New arg end_pc. All callers updated. (do_mixed_source_and_assembly_deprecated): Renamed from do_mixed_source_and_assembly. All callers updated. (do_mixed_source_and_assembly): New function. (gdb_disassembly): Handle /s (DISASSEMBLY_SOURCE). * disasm.h (DISASSEMBLY_SOURCE_DEPRECATED): Renamed from DISASSEMBLY_SOURCE. All uses updated. (DISASSEMBLY_SOURCE): New macro. * mi/mi-cmd-disas.c (mi_cmd_disassemble): New modes 4,5. gdb/doc/ChangeLog: * gdb.texinfo (Machine Code): Update docs for mixed source/assembly disassembly. (GDB/MI Data Manipulation): Update docs for new disassembly modes. gdb/testsuite/ChangeLog: * gdb.mi/mi-disassemble.exp: Update. * gdb.base/disasm-optim.S: New file. * gdb.base/disasm-optim.c: New file. * gdb.base/disasm-optim.h: New file. * gdb.base/disasm-optim.exp: New file.
This commit is contained in:
@@ -21,11 +21,12 @@
|
||||
|
||||
#include "dis-asm.h"
|
||||
|
||||
#define DISASSEMBLY_SOURCE (0x1 << 0)
|
||||
#define DISASSEMBLY_SOURCE_DEPRECATED (0x1 << 0)
|
||||
#define DISASSEMBLY_RAW_INSN (0x1 << 1)
|
||||
#define DISASSEMBLY_OMIT_FNAME (0x1 << 2)
|
||||
#define DISASSEMBLY_FILENAME (0x1 << 3)
|
||||
#define DISASSEMBLY_OMIT_PC (0x1 << 4)
|
||||
#define DISASSEMBLY_SOURCE (0x1 << 5)
|
||||
|
||||
struct gdbarch;
|
||||
struct ui_out;
|
||||
|
||||
Reference in New Issue
Block a user