]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2009-10-22 Paul Pluzhnikov <ppluzhnikov@google.com>
authorPaul Pluzhnikov <ppluzhnikov@google.com>
Fri, 23 Oct 2009 00:49:33 +0000 (00:49 +0000)
committerPaul Pluzhnikov <ppluzhnikov@google.com>
Fri, 23 Oct 2009 00:49:33 +0000 (00:49 +0000)
* disasm.h (DISASSEMBLY_OMIT_FNAME) New define.
(gdb_disassembly): Correct parameter name.
* disasm.c (dump_insns): Adjust.
(gdb_disassembly): Fix indentation.
* cli/cli-cmds.c (disassemble_command): Adjust.

doc/ChangeLog:

2009-10-22  Paul Pluzhnikov  <ppluzhnikov@google.com>

* gdb.texinfo (Machine Code): Mention function name in disasssembly
and adjust example.

testsuite/ChangeLog:

2009-10-22  Paul Pluzhnikov  <ppluzhnikov@google.com>

* gdb.asm/asm-source.exp: Adjust.

gdb/ChangeLog
gdb/cli/cli-cmds.c
gdb/disasm.c
gdb/disasm.h
gdb/doc/ChangeLog
gdb/doc/gdb.texinfo
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.asm/asm-source.exp

index 153bc57b74d9f2d0f84f31afcb367e227146b022..dfc57fbdecc3258e481ea3e98f0d462c467093fe 100644 (file)
@@ -1,3 +1,11 @@
+2009-10-22  Paul Pluzhnikov  <ppluzhnikov@google.com>
+
+       * disasm.h (DISASSEMBLY_OMIT_FNAME) New define.
+       (gdb_disassembly): Correct parameter name.
+       * disasm.c (dump_insns): Adjust.
+       (gdb_disassembly): Fix indentation.
+       * cli/cli-cmds.c (disassemble_command): Adjust.
+       
 2009-10-22  Michael Snyder  <msnyder@vmware.com>
 
        * infrun.c (keep_going): If insert_breakpoints fails, 
index ce7c2a63066ddfdb79ff402766fd4409443a649c..acdbc820b674bc1bc82d2bb93ea61c69f7f1621c 100644 (file)
@@ -936,8 +936,7 @@ print_disassembly (struct gdbarch *gdbarch, const char *name,
 }
 
 /* Subroutine of disassemble_command to simplify it.
-   Print a disassembly of the current function.
-   MIXED is non-zero to print source with the assembler.  */
+   Print a disassembly of the current function according to FLAGS.  */
 
 static void
 disassemble_current_function (int flags)
@@ -1018,6 +1017,7 @@ disassemble_command (char *arg, int from_tty)
 
   if (! arg || ! *arg)
     {
+      flags |= DISASSEMBLY_OMIT_FNAME;
       disassemble_current_function (flags);
       return;
     }
@@ -1039,6 +1039,7 @@ disassemble_command (char *arg, int from_tty)
        low = tui_get_low_disassembly_address (gdbarch, low, pc);
 #endif
       low += gdbarch_deprecated_function_start_offset (gdbarch);
+      flags |= DISASSEMBLY_OMIT_FNAME;
     }
   else
     {
index e296e38f98b49549fe23e9d99fa3d1f9c56df18f..592736727fdff7af4f6391ccad80c0870b40edea 100644 (file)
@@ -122,7 +122,8 @@ dump_insns (struct gdbarch *gdbarch, struct ui_out *uiout,
          /* We don't care now about line, filename and
             unmapped. But we might in the future. */
          ui_out_text (uiout, " <");
-         ui_out_field_string (uiout, "func-name", name);
+         if ((flags & DISASSEMBLY_OMIT_FNAME) == 0)
+           ui_out_field_string (uiout, "func-name", name);
          ui_out_text (uiout, "+");
          ui_out_field_int (uiout, "offset", offset);
          ui_out_text (uiout, ">:\t");
@@ -373,9 +374,8 @@ gdb_disassemble_info (struct gdbarch *gdbarch, struct ui_file *file)
 
 void
 gdb_disassembly (struct gdbarch *gdbarch, struct ui_out *uiout,
-               char *file_string,
-               int flags,
-               int how_many, CORE_ADDR low, CORE_ADDR high)
+                char *file_string, int flags, int how_many,
+                CORE_ADDR low, CORE_ADDR high)
 {
   struct ui_stream *stb = ui_out_stream_new (uiout);
   struct cleanup *cleanups = make_cleanup_ui_out_stream_delete (stb);
index a6f6d396d28768116774a454da6a59dda57b6c23..c92e5afa060722a0b0fdd081527dd9e5cf53d37c 100644 (file)
 
 #define DISASSEMBLY_SOURCE     (0x1 << 0)
 #define DISASSEMBLY_RAW_INSN   (0x1 << 1)
+#define DISASSEMBLY_OMIT_FNAME (0x1 << 2)
 
 struct ui_out;
 struct ui_file;
 
 extern void gdb_disassembly (struct gdbarch *gdbarch, struct ui_out *uiout,
-                            char *file_string,
-                            int mixed_source_and_assembly,
-                            int how_many, CORE_ADDR low, CORE_ADDR high);
+                            char *file_string, int flags, int how_many,
+                            CORE_ADDR low, CORE_ADDR high);
 
 /* Print the instruction at address MEMADDR in debugged memory,
    on STREAM.  Returns the length of the instruction, in bytes,
index 7f70e8d1c25464031cfe92acbef65ca92a0c5c83..d65e6856af385cb55b894f9944534bf7f58a9535 100644 (file)
@@ -1,3 +1,8 @@
+2009-10-22  Paul Pluzhnikov  <ppluzhnikov@google.com>
+
+       * gdb.texinfo (Machine Code): Mention function name in disasssembly
+       and adjust example.
+       
 2009-10-22  Michael Snyder  <msnyder@vmware.com>
 
        * gdb.texinfo (Process Record and Replay): Document new form of
index 18bad647ce18e6715f9413e30321ae5cb292ad93..c1e393f5dd7b0892ff27b5557f94dd0855a50f02 100644 (file)
@@ -6540,7 +6540,9 @@ The default memory range is the function surrounding the
 program counter of the selected frame.  A single argument to this
 command is a program counter value; @value{GDBN} dumps the function
 surrounding this value.  Two arguments specify a range of addresses
-(first inclusive, second exclusive) to dump.
+(first inclusive, second exclusive) to dump.  In that case, the name of
+the function is also printed (since there could be several functions in
+the given range).
 
 If the range of memory being disassembled contains current program counter,
 the instruction at that location is shown with a @code{=>} marker.
@@ -6570,21 +6572,21 @@ program is stopped just after function prologue:
 (@value{GDBP}) disas /m main
 Dump of assembler code for function main:
 5       @{
-   0x08048330 <main+0>:    push   %ebp
-   0x08048331 <main+1>:    mov    %esp,%ebp
-   0x08048333 <main+3>:    sub    $0x8,%esp
-   0x08048336 <main+6>:    and    $0xfffffff0,%esp
-   0x08048339 <main+9>:    sub    $0x10,%esp
+   0x08048330 <+0>:    push   %ebp
+   0x08048331 <+1>:    mov    %esp,%ebp
+   0x08048333 <+3>:    sub    $0x8,%esp
+   0x08048336 <+6>:    and    $0xfffffff0,%esp
+   0x08048339 <+9>:    sub    $0x10,%esp
 
 6         printf ("Hello.\n");
-=> 0x0804833c <main+12>:   movl   $0x8048440,(%esp)
-   0x08048343 <main+19>:   call   0x8048284 <puts@@plt>
+=> 0x0804833c <+12>:   movl   $0x8048440,(%esp)
+   0x08048343 <+19>:   call   0x8048284 <puts@@plt>
 
 7         return 0;
 8       @}
-   0x08048348 <main+24>:   mov    $0x0,%eax
-   0x0804834d <main+29>:   leave
-   0x0804834e <main+30>:   ret
+   0x08048348 <+24>:   mov    $0x0,%eax
+   0x0804834d <+29>:   leave
+   0x0804834e <+30>:   ret
 
 End of assembler dump.
 @end smallexample
index 6f4099fdc1acfbdfbc02b5221d234c19f14e8821..2cdccccef44b9a35a9318e55ce3ed44cc06d8ba7 100644 (file)
@@ -1,3 +1,7 @@
+2009-10-22  Paul Pluzhnikov  <ppluzhnikov@google.com>
+
+       * gdb.asm/asm-source.exp: Adjust.
+       
 2009-10-22  Michael Snyder  <msnyder@vmware.com>
 
        * gdb.reverse/break-precsave.exp: New test.
index b2bb679a752d7e61820822fd1fdde15e1ca9072a..40feba7f2115863fe3c478580ecbaa0ba7b37cee 100644 (file)
@@ -461,7 +461,7 @@ test_dis "x/i &staticvar" "staticvar"
 test_dis "disassem &staticvar &staticvar+1" "staticvar"
 
 # See if we can look at a static function
-gdb_test "disassem foostatic" ".*<foostatic\\+0>:.*End of assembler dump." \
+gdb_test "disassem foostatic" ".*<\\+0>:.*End of assembler dump." \
        "look at static function"
 
 remote_exec build "rm -f ${subdir}/arch.inc"