Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFC] disassemble-next-line
@ 2009-03-08  5:34 teawater
  2009-03-09 15:29 ` Tom Tromey
  0 siblings, 1 reply; 19+ messages in thread
From: teawater @ 2009-03-08  5:34 UTC (permalink / raw)
  To: tromey, Eli Zaretskii, Doug Evans, Pedro Alves, Daniel Jacobowitz
  Cc: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 2836 bytes --]

Hi guys,

This is the patch for the function to output assembly codes for next line.
I this a rfc and doesn't include doc because we still a lot of thing
is not decided.  Such as the name, the behavior and maybe something
else.

I didn't add disassemble-next-line-max because I want output a warning
this message is cut if the number is bigger than max.
But make sure it's cut or not is not easy.  And there is already a
filter when output the assembly codes.
So I think maybe we don't need it.

Please send your comment.  Thanks a lot.  :)

Thanks,
Hui

On Thu, Mar 5, 2009 at 10:41, teawater <teawater@gmail.com> wrote:
>
> Thanks guys,
>
> For the people that want extend disassemble:
> Output assembly codes of next-line is just one part of this idea.
>
> We still have another part:
> 1. Auto mode, output assembly codes only if there is not line message
> for current pc.
> For example:
> (gdb) si
> 0x080483ee      24              b = printf ("a = %d b = %d c = %d\n", a, b, c);
> (gdb) si
> 0x080482d8 in printf@plt ()
> Current language:  auto; currently asm
> 0x080482d8 <printf@plt+0>:      jmp    *0x8049670
> (gdb) si
> 0x080482de in printf@plt ()
> 0x080482de <printf@plt+6>:      push   $0x10
>
> I think maybe is can be default option of gdb.  Add it to display with itself?
>
>
> 2. Output assembly codes number limit.
> This idea form Doug:
> Also, the user might want to set a limit on the number of lines of
> disassembly displayed.
> If cut short gdb could print "[output cut short due to `set
> dissemble-next-line-max 10']" (or some such).
>
> I think maybe it need output something like "This message is cut ...
> you can set it with ...".
>
>
> 3. Special for optimized code.
> This idea form Doug too:
> For debugging optimized code, maybe it'd be nice if gdb determined
> there were more (discontiguous) lines of disassembly to display for
> the current source line and notified the user (by printing
> "discontiguous source line" or some such) before and/or after the
> output.
>
>
>
> I think maybe is too much thing for disassemble.
>
>
>
> Thanks,
> Hui
>
>
>
> On Thu, Mar 5, 2009 at 07:40, Tom Tromey <tromey@redhat.com> wrote:
> >>>>>> "Daniel" == Daniel Jacobowitz <drow@false.org> writes:
> >
> >>> Right, I thought about something that begins with "disassemble", but
> >>> didn't want to shoot our completion habits in the foot, since
> >>> currently typing just "disas TAB" is all I need to get disassembly.
> >
> > Daniel> I agree we don't want to change that binding (I use it all the time).
> > Daniel> But is it a problem?  This would be under set, if I understand right.
> >
> > Yeah, this sounds reasonable to me.
> > I'd prefer to have some word like "disassemble" in the parameter name.
> >
> > Tom
> >

[-- Attachment #2: disassemble-next-line.txt --]
[-- Type: text/plain, Size: 4080 bytes --]

---
 stack.c |   85 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 85 insertions(+)

--- a/stack.c
+++ b/stack.c
@@ -45,6 +45,7 @@
 #include "valprint.h"
 #include "gdbthread.h"
 #include "cp-support.h"
+#include "disasm.h"
 
 #include "gdb_assert.h"
 #include <ctype.h>
@@ -456,6 +457,53 @@ set_current_sal_from_frame (struct frame
     }
 }
 
+/* Enum strings for "set|show disassemble-next-line".  */
+
+static const char disassemble_next_line_auto[] = "auto";
+static const char disassemble_next_line_on[] = "on";
+static const char disassemble_next_line_off[] = "off";
+static const char *disassemble_next_line_enum[] =
+{
+  disassemble_next_line_auto,
+  disassemble_next_line_on,
+  disassemble_next_line_off,
+  NULL,
+};
+
+/* If ON, GDB will output the assembly codes of next line.
+   If OFF, GDB will not do it.
+   doesn't support it, GDB will instead use the traditional
+   If AUTO (which is the default), GDB will output a assembly code
+   at current address if there is not line message.  */
+
+static const char *disassemble_next_line = disassemble_next_line_on;
+
+static void
+show_disassemble_next_line (struct ui_file *file, int from_tty,
+				 struct cmd_list_element *c,
+				 const char *value)
+{
+  fprintf_filtered (file, _("\
+Debugger's willingness to use disassemble-next-line is %s.\n"), value);
+}
+
+/* Show assembly codes; stub for catch_errors.  */
+
+struct gdb_disassembly_stub_args
+{
+  int how_many;
+  CORE_ADDR low;
+  CORE_ADDR high;
+};
+
+static int
+gdb_disassembly_stub (void *args)
+{
+  struct gdb_disassembly_stub_args *p = args;
+  gdb_disassembly (uiout, 0, 0, 0, p->how_many, p->low, p->high);
+  return 0;
+}
+
 /* Print information about frame FRAME.  The output is format according
    to PRINT_LEVEL and PRINT_WHAT and PRINT ARGS.  The meaning of
    PRINT_WHAT is:
@@ -533,6 +581,19 @@ print_frame_info (struct frame_info *fra
 
   source_print = (print_what == SRC_LINE || print_what == SRC_AND_LOC);
 
+  /* If disassemble-next-line is set to auto or on and doesn't have
+     line message, output current instructions.  */
+  if ((disassemble_next_line == disassemble_next_line_auto
+       || disassemble_next_line == disassemble_next_line_on)
+      && source_print && !sal.symtab)
+    {
+      struct gdb_disassembly_stub_args args;
+      args.how_many = 1;
+      args.low = get_frame_pc (frame);
+      args.high = get_frame_pc (frame) + 1;
+      catch_errors (gdb_disassembly_stub, &args, "", RETURN_MASK_ALL);
+    }
+
   if (source_print && sal.symtab)
     {
       int done = 0;
@@ -569,6 +630,17 @@ print_frame_info (struct frame_info *fra
 	      print_source_lines (sal.symtab, sal.line, sal.line + 1, 0);
 	    }
 	}
+
+      /* If disassemble-next-line is set to on and there is line
+         messages, output assembly codes for next line.  */
+      if (disassemble_next_line == disassemble_next_line_on)
+        {
+          struct gdb_disassembly_stub_args args;
+          args.how_many = -1;
+          args.low = get_frame_pc (frame);
+          args.high = sal.end;
+          catch_errors (gdb_disassembly_stub, &args, "", RETURN_MASK_ALL);
+        }
     }
 
   if (print_what != LOCATION)
@@ -2062,6 +2134,19 @@ Usage: func <name>\n"));
 			_("Show printing of non-scalar frame arguments"),
 			NULL, NULL, NULL, &setprintlist, &showprintlist);
 
+  add_setshow_enum_cmd ("disassemble-next-line", class_run,
+			disassemble_next_line_enum,
+			&disassemble_next_line, _("\
+Set debugger's willingness to use disassemble-next-line."), _("\
+Show debugger's willingness to use disassemble-next-line."), _("\
+If on, gdb will output the assembly codes of next line.\n\
+If off, gdb will not do it.\n\
+If auto (which is the default), gdb will output a assembly code\n\
+at current address if there is not line message."),
+			NULL,
+			show_disassemble_next_line,
+			&setlist, &showlist);
+
 #if 0
   add_cmd ("backtrace-limit", class_stack, set_backtrace_limit_command, _(\
 "Specify maximum number of frames for \"backtrace\" to print by default."),

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC] disassemble-next-line
  2009-03-08  5:34 [RFC] disassemble-next-line teawater
@ 2009-03-09 15:29 ` Tom Tromey
  2009-03-09 19:41   ` Eli Zaretskii
  2009-03-11  8:32   ` teawater
  0 siblings, 2 replies; 19+ messages in thread
From: Tom Tromey @ 2009-03-09 15:29 UTC (permalink / raw)
  To: teawater
  Cc: Eli Zaretskii, Doug Evans, Pedro Alves, Daniel Jacobowitz, gdb-patches

>>>>> "teawater" == teawater  <teawater@gmail.com> writes:

teawater> This is the patch for the function to output assembly codes
teawater> for next line.

teawater> +/* If ON, GDB will output the assembly codes of next line.
teawater> +   If OFF, GDB will not do it.
teawater> +   doesn't support it, GDB will instead use the traditional

I think this third line should be removed.

teawater> +/* Show assembly codes; stub for catch_errors.  */
teawater> +
teawater> +struct gdb_disassembly_stub_args
teawater> +{
teawater> +  int how_many;
teawater> +  CORE_ADDR low;
teawater> +  CORE_ADDR high;
teawater> +};
teawater> +
teawater> +static int
teawater> +gdb_disassembly_stub (void *args)
teawater> +{
teawater> +  struct gdb_disassembly_stub_args *p = args;
teawater> +  gdb_disassembly (uiout, 0, 0, 0, p->how_many, p->low, p->high);
teawater> +  return 0;

IMO, in this case it would be shorter, and clearer, to use TRY_CATCH
at the call site rather than catch_errors.  What do you think?

teawater> +  /* If disassemble-next-line is set to auto or on and doesn't have
teawater> +     line message, output current instructions.  */

"a line message"

teawater> +      /* If disassemble-next-line is set to on and there is line
teawater> +         messages, output assembly codes for next line.  */

"there are line messages"

teawater> +  add_setshow_enum_cmd ("disassemble-next-line", class_run,
teawater> +			disassemble_next_line_enum,
teawater> +			&disassemble_next_line, _("\
teawater> +Set debugger's willingness to use disassemble-next-line."), _("\

This text seems circular.
Instead it should briefly describe what the option does.

teawater> +Show debugger's willingness to use disassemble-next-line."), _("\
teawater> +If on, gdb will output the assembly codes of next line.\n\

This also reads strangely, but I don't have a suggestion for what it
ought to say.  I think it should at least say when the assembly will
be displayed.  "assembly codes" in particular sounds odd to me.

teawater> +If auto (which is the default), gdb will output a assembly code\n\
teawater> +at current address if there is not line message."),

"at the current address"

The line message bit could use rewording as well; at least s/not/no/.

Tom


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC] disassemble-next-line
  2009-03-09 15:29 ` Tom Tromey
@ 2009-03-09 19:41   ` Eli Zaretskii
  2009-03-10  2:45     ` Doug Evans
  2009-03-11  8:32   ` teawater
  1 sibling, 1 reply; 19+ messages in thread
From: Eli Zaretskii @ 2009-03-09 19:41 UTC (permalink / raw)
  To: Tom Tromey; +Cc: teawater, dje, pedro, drow, gdb-patches

> Cc: Eli Zaretskii <eliz@gnu.org>, Doug Evans <dje@google.com>,
>         Pedro Alves <pedro@codesourcery.com>,
>         Daniel Jacobowitz <drow@false.org>,
>         "gdb-patches\@sourceware.org" <gdb-patches@sourceware.org>
> From: Tom Tromey <tromey@redhat.com>
> Date: Mon, 09 Mar 2009 09:26:03 -0600
> 
> teawater> +Show debugger's willingness to use disassemble-next-line."), _("\
> teawater> +If on, gdb will output the assembly codes of next line.\n\
> 
> This also reads strangely, but I don't have a suggestion for what it
> ought to say.  I think it should at least say when the assembly will
> be displayed.  "assembly codes" in particular sounds odd to me.

How about

  If ON, GDB will disassemble next source line.

> teawater> +If auto (which is the default), gdb will output a assembly code\n\
> teawater> +at current address if there is not line message."),
> 
> "at the current address"
> 
> The line message bit could use rewording as well; at least s/not/no/.

Right.  FWIW, I don't even understand what a "line message" is.


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC] disassemble-next-line
  2009-03-09 19:41   ` Eli Zaretskii
@ 2009-03-10  2:45     ` Doug Evans
  0 siblings, 0 replies; 19+ messages in thread
From: Doug Evans @ 2009-03-10  2:45 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Tom Tromey, teawater, pedro, drow, gdb-patches

On Mon, Mar 9, 2009 at 12:41 PM, Eli Zaretskii <eliz@gnu.org> wrote:
>> Cc: Eli Zaretskii <eliz@gnu.org>, Doug Evans <dje@google.com>,
>>         Pedro Alves <pedro@codesourcery.com>,
>>         Daniel Jacobowitz <drow@false.org>,
>>         "gdb-patches\@sourceware.org" <gdb-patches@sourceware.org>
>> From: Tom Tromey <tromey@redhat.com>
>> Date: Mon, 09 Mar 2009 09:26:03 -0600
>>
>> teawater> +Show debugger's willingness to use disassemble-next-line."), _("\
>> teawater> +If on, gdb will output the assembly codes of next line.\n\
>>
>> This also reads strangely, but I don't have a suggestion for what it
>> ought to say.  I think it should at least say when the assembly will
>> be displayed.  "assembly codes" in particular sounds odd to me.
>
> How about
>
>  If ON, GDB will disassemble next source line.

fwiw, I think it should also indicate _when_ it will disassemble the next line.
E.g.

If ON, GDB will disassemble the next source line when execution stops.
If the next source line cannot be ascertained, the next instruction
will be disassembled instead.

or some such.
[IIRC, that is the intended behaviour.]

$0.02.


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC] disassemble-next-line
  2009-03-09 15:29 ` Tom Tromey
  2009-03-09 19:41   ` Eli Zaretskii
@ 2009-03-11  8:32   ` teawater
  2009-03-12 23:57     ` teawater
  1 sibling, 1 reply; 19+ messages in thread
From: teawater @ 2009-03-11  8:32 UTC (permalink / raw)
  To: Tom Tromey, Eli Zaretskii, Doug Evans
  Cc: Pedro Alves, Daniel Jacobowitz, gdb-patches

Hi guys,

On Mon, Mar 9, 2009 at 23:26, Tom Tromey <tromey@redhat.com> wrote:
>>>>>> "teawater" == teawater  <teawater@gmail.com> writes:
>
> teawater> This is the patch for the function to output assembly codes
> teawater> for next line.
>
> teawater> +/* If ON, GDB will output the assembly codes of next line.
> teawater> +   If OFF, GDB will not do it.
> teawater> +   doesn't support it, GDB will instead use the traditional
>
> I think this third line should be removed.

OK. I will remove it.

>
> teawater> +/* Show assembly codes; stub for catch_errors.  */
> teawater> +
> teawater> +struct gdb_disassembly_stub_args
> teawater> +{
> teawater> +  int how_many;
> teawater> +  CORE_ADDR low;
> teawater> +  CORE_ADDR high;
> teawater> +};
> teawater> +
> teawater> +static int
> teawater> +gdb_disassembly_stub (void *args)
> teawater> +{
> teawater> +  struct gdb_disassembly_stub_args *p = args;
> teawater> +  gdb_disassembly (uiout, 0, 0, 0, p->how_many, p->low, p->high);
> teawater> +  return 0;
>
> IMO, in this case it would be shorter, and clearer, to use TRY_CATCH
> at the call site rather than catch_errors.  What do you think?

OK.  I will change it to TRY_CATCH.

>
> teawater> +  /* If disassemble-next-line is set to auto or on and doesn't have
> teawater> +     line message, output current instructions.  */
>
> "a line message"
>
> teawater> +      /* If disassemble-next-line is set to on and there is line
> teawater> +         messages, output assembly codes for next line.  */
>
> "there are line messages"

I will change it.

>
> teawater> +  add_setshow_enum_cmd ("disassemble-next-line", class_run,
> teawater> +                     disassemble_next_line_enum,
> teawater> +                     &disassemble_next_line, _("\
> teawater> +Set debugger's willingness to use disassemble-next-line."), _("\
>
> This text seems circular.
> Instead it should briefly describe what the option does.
>
> teawater> +Show debugger's willingness to use disassemble-next-line."), _("\
> teawater> +If on, gdb will output the assembly codes of next line.\n\
>
> This also reads strangely, but I don't have a suggestion for what it
> ought to say.  I think it should at least say when the assembly will
> be displayed.  "assembly codes" in particular sounds odd to me.

I think Doug's idea is better:
If ON, GDB will disassemble the next source line when execution stops.
If the next source line cannot be ascertained, the next instruction
will be disassembled instead.

>
> teawater> +If auto (which is the default), gdb will output a assembly code\n\
> teawater> +at current address if there is not line message."),
>
> "at the current address"

I will change it.

>
> The line message bit could use rewording as well; at least s/not/no/.
>

About line message.
struct symtab_and_line
{
  struct symtab *symtab;
  struct obj_section *section;
  /* Line number.  Line numbers start at 1 and proceed through symtab->nlines.
     0 is never a valid line number; it is used to indicate that line number
     information is not available.  */
  int line;

  CORE_ADDR pc;
  CORE_ADDR end;
  int explicit_pc;
  int explicit_line;
};
It don't have comment name.
What about change it to "line debug message"?


Thanks for your help.
Hui


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC] disassemble-next-line
  2009-03-11  8:32   ` teawater
@ 2009-03-12 23:57     ` teawater
  2009-03-13  0:50       ` Pedro Alves
  2009-03-13  9:53       ` Eli Zaretskii
  0 siblings, 2 replies; 19+ messages in thread
From: teawater @ 2009-03-12 23:57 UTC (permalink / raw)
  To: Tom Tromey, Eli Zaretskii, Doug Evans
  Cc: Pedro Alves, Daniel Jacobowitz, gdb-patches

[-- Attachment #1: Type: text/plain, Size: 3683 bytes --]

Hi guys,

I make a new patch according to your comments.
If you think it's OK. I will make the patch for doc.

Thanks,
Hui

On Wed, Mar 11, 2009 at 11:16, teawater <teawater@gmail.com> wrote:
> Hi guys,
>
> On Mon, Mar 9, 2009 at 23:26, Tom Tromey <tromey@redhat.com> wrote:
>>>>>>> "teawater" == teawater  <teawater@gmail.com> writes:
>>
>> teawater> This is the patch for the function to output assembly codes
>> teawater> for next line.
>>
>> teawater> +/* If ON, GDB will output the assembly codes of next line.
>> teawater> +   If OFF, GDB will not do it.
>> teawater> +   doesn't support it, GDB will instead use the traditional
>>
>> I think this third line should be removed.
>
> OK. I will remove it.
>
>>
>> teawater> +/* Show assembly codes; stub for catch_errors.  */
>> teawater> +
>> teawater> +struct gdb_disassembly_stub_args
>> teawater> +{
>> teawater> +  int how_many;
>> teawater> +  CORE_ADDR low;
>> teawater> +  CORE_ADDR high;
>> teawater> +};
>> teawater> +
>> teawater> +static int
>> teawater> +gdb_disassembly_stub (void *args)
>> teawater> +{
>> teawater> +  struct gdb_disassembly_stub_args *p = args;
>> teawater> +  gdb_disassembly (uiout, 0, 0, 0, p->how_many, p->low, p->high);
>> teawater> +  return 0;
>>
>> IMO, in this case it would be shorter, and clearer, to use TRY_CATCH
>> at the call site rather than catch_errors.  What do you think?
>
> OK.  I will change it to TRY_CATCH.
>
>>
>> teawater> +  /* If disassemble-next-line is set to auto or on and doesn't have
>> teawater> +     line message, output current instructions.  */
>>
>> "a line message"
>>
>> teawater> +      /* If disassemble-next-line is set to on and there is line
>> teawater> +         messages, output assembly codes for next line.  */
>>
>> "there are line messages"
>
> I will change it.
>
>>
>> teawater> +  add_setshow_enum_cmd ("disassemble-next-line", class_run,
>> teawater> +                     disassemble_next_line_enum,
>> teawater> +                     &disassemble_next_line, _("\
>> teawater> +Set debugger's willingness to use disassemble-next-line."), _("\
>>
>> This text seems circular.
>> Instead it should briefly describe what the option does.
>>
>> teawater> +Show debugger's willingness to use disassemble-next-line."), _("\
>> teawater> +If on, gdb will output the assembly codes of next line.\n\
>>
>> This also reads strangely, but I don't have a suggestion for what it
>> ought to say.  I think it should at least say when the assembly will
>> be displayed.  "assembly codes" in particular sounds odd to me.
>
> I think Doug's idea is better:
> If ON, GDB will disassemble the next source line when execution stops.
> If the next source line cannot be ascertained, the next instruction
> will be disassembled instead.
>
>>
>> teawater> +If auto (which is the default), gdb will output a assembly code\n\
>> teawater> +at current address if there is not line message."),
>>
>> "at the current address"
>
> I will change it.
>
>>
>> The line message bit could use rewording as well; at least s/not/no/.
>>
>
> About line message.
> struct symtab_and_line
> {
>  struct symtab *symtab;
>  struct obj_section *section;
>  /* Line number.  Line numbers start at 1 and proceed through symtab->nlines.
>     0 is never a valid line number; it is used to indicate that line number
>     information is not available.  */
>  int line;
>
>  CORE_ADDR pc;
>  CORE_ADDR end;
>  int explicit_pc;
>  int explicit_line;
> };
> It don't have comment name.
> What about change it to "line debug message"?
>
>
> Thanks for your help.
> Hui
>

[-- Attachment #2: disassemble-next-line.txt --]
[-- Type: text/plain, Size: 4127 bytes --]

---
 stack.c |   89 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 89 insertions(+)

--- a/stack.c
+++ b/stack.c
@@ -45,6 +45,7 @@
 #include "valprint.h"
 #include "gdbthread.h"
 #include "cp-support.h"
+#include "disasm.h"
 
 #include "gdb_assert.h"
 #include <ctype.h>
@@ -456,6 +457,69 @@ set_current_sal_from_frame (struct frame
     }
 }
 
+/* Enum strings for "set|show disassemble-next-line".  */
+
+static const char disassemble_next_line_auto[] = "auto";
+static const char disassemble_next_line_on[] = "on";
+static const char disassemble_next_line_off[] = "off";
+static const char *disassemble_next_line_enum[] =
+{
+  disassemble_next_line_auto,
+  disassemble_next_line_on,
+  disassemble_next_line_off,
+  NULL,
+};
+
+/* If ON, GDB will disassemble the next source line when execution
+   stops.
+   If AUTO (which is the default) or the next source line cannot be
+   ascertained, the next instruction will be disassembled instead.  */
+
+static const char *disassemble_next_line = disassemble_next_line_auto;
+
+static void
+show_disassemble_next_line (struct ui_file *file, int from_tty,
+				 struct cmd_list_element *c,
+				 const char *value)
+{
+  fprintf_filtered (file, _("\
+Debugger's willingness to use disassemble-next-line is %s.\n"), value);
+}
+
+/* Show assembly codes; stub for catch_errors.  */
+
+struct gdb_disassembly_stub_args
+{
+  int how_many;
+  CORE_ADDR low;
+  CORE_ADDR high;
+};
+
+static void
+gdb_disassembly_stub (void *args)
+{
+  struct gdb_disassembly_stub_args *p = args;
+  gdb_disassembly (uiout, 0, 0, p->how_many, p->low, p->high);
+}
+
+/* Use TRY_CATCH to catch the exception from the gdb_disassembly
+   because it will be broken by filter sometime.  */
+
+static void
+do_gdb_disassembly (int how_many, CORE_ADDR low, CORE_ADDR high)
+{
+  volatile struct gdb_exception exception;
+  struct gdb_disassembly_stub_args args;
+
+  args.how_many = how_many;
+  args.low = low;
+  args.high = high;
+  TRY_CATCH (exception, RETURN_MASK_ALL)
+    {
+      gdb_disassembly_stub (&args);
+    }
+}
+
 /* Print information about frame FRAME.  The output is format according
    to PRINT_LEVEL and PRINT_WHAT and PRINT ARGS.  The meaning of
    PRINT_WHAT is:
@@ -533,6 +597,13 @@ print_frame_info (struct frame_info *fra
 
   source_print = (print_what == SRC_LINE || print_what == SRC_AND_LOC);
 
+  /* If disassemble-next-line is set to auto or on and doesn't have
+     the line debug messages for $pc, output current instructions.  */
+  if ((disassemble_next_line == disassemble_next_line_auto
+       || disassemble_next_line == disassemble_next_line_on)
+      && source_print && !sal.symtab)
+    do_gdb_disassembly (1, get_frame_pc (frame), get_frame_pc (frame) + 1);
+
   if (source_print && sal.symtab)
     {
       int done = 0;
@@ -569,6 +640,11 @@ print_frame_info (struct frame_info *fra
 	      print_source_lines (sal.symtab, sal.line, sal.line + 1, 0);
 	    }
 	}
+
+      /* If disassemble-next-line is set to on and there is line
+         messages, output assembly codes for next line.  */
+      if (disassemble_next_line == disassemble_next_line_on)
+	do_gdb_disassembly (-1, get_frame_pc (frame), sal.end);
     }
 
   if (print_what != LOCATION)
@@ -2062,6 +2138,19 @@ Usage: func <name>\n"));
 			_("Show printing of non-scalar frame arguments"),
 			NULL, NULL, NULL, &setprintlist, &showprintlist);
 
+  add_setshow_enum_cmd ("disassemble-next-line", class_run,
+			disassemble_next_line_enum,
+			&disassemble_next_line, _("\
+Set debugger's willingness to use disassemble-next-line."), _("\
+Show debugger's willingness to use disassemble-next-line."), _("\
+If ON, GDB will disassemble the next source line when execution\n\
+stops.\n\
+If AUTO (which is the default) or the next source line cannot be\n\
+ascertained, the next instruction will be disassembled instead."),
+			NULL,
+			show_disassemble_next_line,
+			&setlist, &showlist);
+
 #if 0
   add_cmd ("backtrace-limit", class_stack, set_backtrace_limit_command, _(\
 "Specify maximum number of frames for \"backtrace\" to print by default."),

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC] disassemble-next-line
  2009-03-12 23:57     ` teawater
@ 2009-03-13  0:50       ` Pedro Alves
  2009-03-13  5:54         ` teawater
  2009-03-13  9:53       ` Eli Zaretskii
  1 sibling, 1 reply; 19+ messages in thread
From: Pedro Alves @ 2009-03-13  0:50 UTC (permalink / raw)
  To: gdb-patches
  Cc: teawater, Tom Tromey, Eli Zaretskii, Doug Evans, Daniel Jacobowitz

> --- a/stack.c
> +++ b/stack.c
>  
> +/* Enum strings for "set|show disassemble-next-line".  */
> +
> +static const char disassemble_next_line_auto[] = "auto";
> +static const char disassemble_next_line_on[] = "on";
> +static const char disassemble_next_line_off[] = "off";
> +static const char *disassemble_next_line_enum[] =
> +{
> +  disassemble_next_line_auto,
> +  disassemble_next_line_on,
> +  disassemble_next_line_off,
> +  NULL,
> +};

Please make this an `enum auto_boolean' / AUTO_BOOLEAN_AUTO, and
register the "disassemble-next-line" command with
add_setshow_auto_boolean_cmd instead.

-- 
Pedro Alves


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC] disassemble-next-line
  2009-03-13  0:50       ` Pedro Alves
@ 2009-03-13  5:54         ` teawater
  0 siblings, 0 replies; 19+ messages in thread
From: teawater @ 2009-03-13  5:54 UTC (permalink / raw)
  To: Pedro Alves
  Cc: gdb-patches, Tom Tromey, Eli Zaretskii, Doug Evans, Daniel Jacobowitz

[-- Attachment #1: Type: text/plain, Size: 909 bytes --]

Hi Pedro.

The enum auto_boolean and add_setshow_auto_boolean_cmd is cool.
Thanks for you remind me.

I had changed it.  Do you think it's OK?

Thanks,
Hui

On Fri, Mar 13, 2009 at 08:20, Pedro Alves <pedro@codesourcery.com> wrote:
>> --- a/stack.c
>> +++ b/stack.c
>>
>> +/* Enum strings for "set|show disassemble-next-line".  */
>> +
>> +static const char disassemble_next_line_auto[] = "auto";
>> +static const char disassemble_next_line_on[] = "on";
>> +static const char disassemble_next_line_off[] = "off";
>> +static const char *disassemble_next_line_enum[] =
>> +{
>> +  disassemble_next_line_auto,
>> +  disassemble_next_line_on,
>> +  disassemble_next_line_off,
>> +  NULL,
>> +};
>
> Please make this an `enum auto_boolean' / AUTO_BOOLEAN_AUTO, and
> register the "disassemble-next-line" command with
> add_setshow_auto_boolean_cmd instead.
>
> --
> Pedro Alves
>

[-- Attachment #2: disassemble-next-line.txt --]
[-- Type: text/plain, Size: 3770 bytes --]

---
 stack.c |   77 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 77 insertions(+)

--- a/stack.c
+++ b/stack.c
@@ -45,6 +45,7 @@
 #include "valprint.h"
 #include "gdbthread.h"
 #include "cp-support.h"
+#include "disasm.h"
 
 #include "gdb_assert.h"
 #include <ctype.h>
@@ -456,6 +457,57 @@ set_current_sal_from_frame (struct frame
     }
 }
 
+/* If ON, GDB will disassemble the next source line when execution
+   stops.
+   If AUTO (which is the default) or the next source line cannot be
+   ascertained, the next instruction will be disassembled instead.  */
+
+static enum auto_boolean disassemble_next_line;
+
+static void
+show_disassemble_next_line (struct ui_file *file, int from_tty,
+				 struct cmd_list_element *c,
+				 const char *value)
+{
+  fprintf_filtered (file, _("\
+Debugger's willingness to use disassemble-next-line is %s.\n"),
+                    value);
+}
+
+/* Show assembly codes; stub for catch_errors.  */
+
+struct gdb_disassembly_stub_args
+{
+  int how_many;
+  CORE_ADDR low;
+  CORE_ADDR high;
+};
+
+static void
+gdb_disassembly_stub (void *args)
+{
+  struct gdb_disassembly_stub_args *p = args;
+  gdb_disassembly (uiout, 0, 0, p->how_many, p->low, p->high);
+}
+
+/* Use TRY_CATCH to catch the exception from the gdb_disassembly
+   because it will be broken by filter sometime.  */
+
+static void
+do_gdb_disassembly (int how_many, CORE_ADDR low, CORE_ADDR high)
+{
+  volatile struct gdb_exception exception;
+  struct gdb_disassembly_stub_args args;
+
+  args.how_many = how_many;
+  args.low = low;
+  args.high = high;
+  TRY_CATCH (exception, RETURN_MASK_ALL)
+    {
+      gdb_disassembly_stub (&args);
+    }
+}
+
 /* Print information about frame FRAME.  The output is format according
    to PRINT_LEVEL and PRINT_WHAT and PRINT ARGS.  The meaning of
    PRINT_WHAT is:
@@ -533,6 +585,13 @@ print_frame_info (struct frame_info *fra
 
   source_print = (print_what == SRC_LINE || print_what == SRC_AND_LOC);
 
+  /* If disassemble-next-line is set to auto or on and doesn't have
+     the line debug messages for $pc, output current instructions.  */
+  if ((disassemble_next_line == AUTO_BOOLEAN_AUTO
+       || disassemble_next_line == AUTO_BOOLEAN_TRUE)
+      && source_print && !sal.symtab)
+    do_gdb_disassembly (1, get_frame_pc (frame), get_frame_pc (frame) + 1);
+
   if (source_print && sal.symtab)
     {
       int done = 0;
@@ -569,6 +628,11 @@ print_frame_info (struct frame_info *fra
 	      print_source_lines (sal.symtab, sal.line, sal.line + 1, 0);
 	    }
 	}
+
+      /* If disassemble-next-line is set to on and there is line
+         messages, output assembly codes for next line.  */
+      if (disassemble_next_line == AUTO_BOOLEAN_TRUE)
+	do_gdb_disassembly (-1, get_frame_pc (frame), sal.end);
     }
 
   if (print_what != LOCATION)
@@ -2062,6 +2126,19 @@ Usage: func <name>\n"));
 			_("Show printing of non-scalar frame arguments"),
 			NULL, NULL, NULL, &setprintlist, &showprintlist);
 
+  add_setshow_auto_boolean_cmd ("disassemble-next-line", class_stack,
+			        &disassemble_next_line, _("\
+Set debugger's willingness to use disassemble-next-line."), _("\
+Show debugger's willingness to use disassemble-next-line."), _("\
+If ON, GDB will disassemble the next source line when execution\n\
+stops.\n\
+If AUTO (which is the default) or the next source line cannot be\n\
+ascertained, the next instruction will be disassembled instead."),
+			        NULL,
+			        show_disassemble_next_line,
+			        &setlist, &showlist);
+  disassemble_next_line = AUTO_BOOLEAN_AUTO;
+
 #if 0
   add_cmd ("backtrace-limit", class_stack, set_backtrace_limit_command, _(\
 "Specify maximum number of frames for \"backtrace\" to print by default."),

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC] disassemble-next-line
  2009-03-12 23:57     ` teawater
  2009-03-13  0:50       ` Pedro Alves
@ 2009-03-13  9:53       ` Eli Zaretskii
  2009-03-16  7:59         ` teawater
  1 sibling, 1 reply; 19+ messages in thread
From: Eli Zaretskii @ 2009-03-13  9:53 UTC (permalink / raw)
  To: teawater; +Cc: tromey, dje, pedro, drow, gdb-patches

> Date: Fri, 13 Mar 2009 07:55:59 +0800
> From: teawater <teawater@gmail.com>
> Cc: Pedro Alves <pedro@codesourcery.com>, Daniel Jacobowitz <drow@false.org>, 
> 	"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
> 
> +  add_setshow_enum_cmd ("disassemble-next-line", class_run,
> +			disassemble_next_line_enum,
> +			&disassemble_next_line, _("\
> +Set debugger's willingness to use disassemble-next-line."), _("\
> +Show debugger's willingness to use disassemble-next-line."), _("\

This self-referential doc string is confusing.  I suggest to change to
something like this:

  Set whether to disassemble next source line when execution stops.

and similarly for Show.

> +If ON, GDB will disassemble the next source line when execution\n\
> +stops.\n\

 If ON, GDB will display disassembly of the next source line when\n\
 execution of the program being debugged stops.\n\

> +If AUTO (which is the default) or the next source line cannot be\n\
> +ascertained, the next instruction will be disassembled instead."),

What does it mean ``the next source line cannot be ascertained''?

In any case, instead of ``the next instruction will be disassembled
instead'', I suggest ``display disassembly of the next instruction
instead.''


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC] disassemble-next-line
  2009-03-13  9:53       ` Eli Zaretskii
@ 2009-03-16  7:59         ` teawater
  2009-03-16 19:22           ` Eli Zaretskii
  0 siblings, 1 reply; 19+ messages in thread
From: teawater @ 2009-03-16  7:59 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: tromey, dje, pedro, drow, gdb-patches

[-- Attachment #1: Type: text/plain, Size: 1521 bytes --]

Hi Eli,

I had make the patches for code and doc.
Please help me review it.

Thanks,
Hui

On Fri, Mar 13, 2009 at 17:45, Eli Zaretskii <eliz@gnu.org> wrote:
>> Date: Fri, 13 Mar 2009 07:55:59 +0800
>> From: teawater <teawater@gmail.com>
>> Cc: Pedro Alves <pedro@codesourcery.com>, Daniel Jacobowitz <drow@false.org>,
>>       "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
>>
>> +  add_setshow_enum_cmd ("disassemble-next-line", class_run,
>> +                     disassemble_next_line_enum,
>> +                     &disassemble_next_line, _("\
>> +Set debugger's willingness to use disassemble-next-line."), _("\
>> +Show debugger's willingness to use disassemble-next-line."), _("\
>
> This self-referential doc string is confusing.  I suggest to change to
> something like this:
>
>  Set whether to disassemble next source line when execution stops.
>
> and similarly for Show.
>
>> +If ON, GDB will disassemble the next source line when execution\n\
>> +stops.\n\
>
>  If ON, GDB will display disassembly of the next source line when\n\
>  execution of the program being debugged stops.\n\
>
>> +If AUTO (which is the default) or the next source line cannot be\n\
>> +ascertained, the next instruction will be disassembled instead."),
>
> What does it mean ``the next source line cannot be ascertained''?
>
> In any case, instead of ``the next instruction will be disassembled
> instead'', I suggest ``display disassembly of the next instruction
> instead.''
>

[-- Attachment #2: disassemble-next-line.txt --]
[-- Type: text/plain, Size: 3882 bytes --]

---
 stack.c |   79 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 79 insertions(+)

--- a/stack.c
+++ b/stack.c
@@ -45,6 +45,7 @@
 #include "valprint.h"
 #include "gdbthread.h"
 #include "cp-support.h"
+#include "disasm.h"
 
 #include "gdb_assert.h"
 #include <ctype.h>
@@ -456,6 +457,58 @@ set_current_sal_from_frame (struct frame
     }
 }
 
+/* If ON, GDB will display disassembly of the next source line when
+   execution of the program being debugged stops.
+   If AUTO (which is the default) or the next source line cannot be
+   ascertained, display disassembly of the next instruction
+   instead.  */
+
+static enum auto_boolean disassemble_next_line;
+
+static void
+show_disassemble_next_line (struct ui_file *file, int from_tty,
+				 struct cmd_list_element *c,
+				 const char *value)
+{
+  fprintf_filtered (file, _("\
+Debugger's willingness to use disassemble-next-line is %s.\n"),
+                    value);
+}
+
+/* Show assembly codes; stub for catch_errors.  */
+
+struct gdb_disassembly_stub_args
+{
+  int how_many;
+  CORE_ADDR low;
+  CORE_ADDR high;
+};
+
+static void
+gdb_disassembly_stub (void *args)
+{
+  struct gdb_disassembly_stub_args *p = args;
+  gdb_disassembly (uiout, 0, 0, p->how_many, p->low, p->high);
+}
+
+/* Use TRY_CATCH to catch the exception from the gdb_disassembly
+   because it will be broken by filter sometime.  */
+
+static void
+do_gdb_disassembly (int how_many, CORE_ADDR low, CORE_ADDR high)
+{
+  volatile struct gdb_exception exception;
+  struct gdb_disassembly_stub_args args;
+
+  args.how_many = how_many;
+  args.low = low;
+  args.high = high;
+  TRY_CATCH (exception, RETURN_MASK_ALL)
+    {
+      gdb_disassembly_stub (&args);
+    }
+}
+
 /* Print information about frame FRAME.  The output is format according
    to PRINT_LEVEL and PRINT_WHAT and PRINT ARGS.  The meaning of
    PRINT_WHAT is:
@@ -533,6 +586,13 @@ print_frame_info (struct frame_info *fra
 
   source_print = (print_what == SRC_LINE || print_what == SRC_AND_LOC);
 
+  /* If disassemble-next-line is set to auto or on and doesn't have
+     the line debug messages for $pc, output current instructions.  */
+  if ((disassemble_next_line == AUTO_BOOLEAN_AUTO
+       || disassemble_next_line == AUTO_BOOLEAN_TRUE)
+      && source_print && !sal.symtab)
+    do_gdb_disassembly (1, get_frame_pc (frame), get_frame_pc (frame) + 1);
+
   if (source_print && sal.symtab)
     {
       int done = 0;
@@ -569,6 +629,11 @@ print_frame_info (struct frame_info *fra
 	      print_source_lines (sal.symtab, sal.line, sal.line + 1, 0);
 	    }
 	}
+
+      /* If disassemble-next-line is set to on and there is line
+         messages, output assembly codes for next line.  */
+      if (disassemble_next_line == AUTO_BOOLEAN_TRUE)
+	do_gdb_disassembly (-1, get_frame_pc (frame), sal.end);
     }
 
   if (print_what != LOCATION)
@@ -2071,6 +2136,20 @@ Usage: func <name>\n"));
 			_("Show printing of non-scalar frame arguments"),
 			NULL, NULL, NULL, &setprintlist, &showprintlist);
 
+  add_setshow_auto_boolean_cmd ("disassemble-next-line", class_stack,
+			        &disassemble_next_line, _("\
+Set whether to disassemble next source line when execution stops."), _("\
+Show whether to disassemble next source line when execution stops."), _("\
+If ON, GDB will display disassembly of the next source line when\n\
+execution of the program being debugged stops.\n\
+If AUTO (which is the default) or the next source line cannot be\n\
+ascertained, display disassembly of the next instruction\n\
+instead."),
+			        NULL,
+			        show_disassemble_next_line,
+			        &setlist, &showlist);
+  disassemble_next_line = AUTO_BOOLEAN_AUTO;
+
 #if 0
   add_cmd ("backtrace-limit", class_stack, set_backtrace_limit_command, _(\
 "Specify maximum number of frames for \"backtrace\" to print by default."),

[-- Attachment #3: disassemble-next-line-doc.txt --]
[-- Type: text/plain, Size: 1458 bytes --]

---
 doc/gdb.texinfo |   17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

--- a/doc/gdb.texinfo
+++ b/doc/gdb.texinfo
@@ -5910,7 +5910,9 @@ directories in one command.
 
 You can use the command @code{info line} to map source lines to program
 addresses (and vice versa), and the command @code{disassemble} to display
-a range of addresses as machine instructions.  When run under @sc{gnu} Emacs
+a range of addresses as machine instructions.  You can use the command
+@code{set disassemble-next-line} to set whether to disassemble next
+source line when execution stops.  When run under @sc{gnu} Emacs
 mode, the @code{info line} command causes the arrow to point to the
 line specified.  Also, @code{info line} prints addresses in symbolic form as
 well as hex.
@@ -6040,6 +6042,19 @@ assemblers for x86-based targets.
 Show the current setting of the disassembly flavor.
 @end table
 
+@table @code
+@kindex set disassemble-next-line
+@kindex show disassemble-next-line
+@item set disassemble-next-line
+@itemx show disassemble-next-line
+Control whether or not @value{GDBN} will disassemble next source line
+when execution stops.  If ON, GDB will display disassembly of the next
+source line when execution of the program being debugged stops.
+If AUTO (which is the default) or the next source line cannot be
+ascertained, display disassembly of the next instruction
+instead.
+@end table
+
 
 @node Data
 @chapter Examining Data

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC] disassemble-next-line
  2009-03-16  7:59         ` teawater
@ 2009-03-16 19:22           ` Eli Zaretskii
  2009-03-16 19:40             ` Doug Evans
  0 siblings, 1 reply; 19+ messages in thread
From: Eli Zaretskii @ 2009-03-16 19:22 UTC (permalink / raw)
  To: teawater; +Cc: tromey, dje, pedro, drow, gdb-patches

> Date: Mon, 16 Mar 2009 14:51:51 +0800
> From: teawater <teawater@gmail.com>
> Cc: tromey@redhat.com, dje@google.com, pedro@codesourcery.com, drow@false.org, 
> 	gdb-patches@sourceware.org
> 
> I had make the patches for code and doc.
> Please help me review it.

Thanks.  Everything is OK, except that you didn't answer my question:

> >> +If AUTO (which is the default) or the next source line cannot be\n\
> >> +ascertained, the next instruction will be disassembled instead."),
> >
> > What does it mean ``the next source line cannot be ascertained''?

I asked that question because I cannot understand the last sentence,
which uses this phrase.  Please help me understand what you mean.


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC] disassemble-next-line
  2009-03-16 19:22           ` Eli Zaretskii
@ 2009-03-16 19:40             ` Doug Evans
  2009-03-16 19:54               ` Eli Zaretskii
  0 siblings, 1 reply; 19+ messages in thread
From: Doug Evans @ 2009-03-16 19:40 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: teawater, tromey, pedro, drow, gdb-patches

On Mon, Mar 16, 2009 at 12:20 PM, Eli Zaretskii <eliz@gnu.org> wrote:
>> Date: Mon, 16 Mar 2009 14:51:51 +0800
>> From: teawater <teawater@gmail.com>
>> Cc: tromey@redhat.com, dje@google.com, pedro@codesourcery.com, drow@false.org,
>>       gdb-patches@sourceware.org
>>
>> I had make the patches for code and doc.
>> Please help me review it.
>
> Thanks.  Everything is OK, except that you didn't answer my question:
>
>> >> +If AUTO (which is the default) or the next source line cannot be\n\
>> >> +ascertained, the next instruction will be disassembled instead."),
>> >
>> > What does it mean ``the next source line cannot be ascertained''?
>
> I asked that question because I cannot understand the last sentence,
> which uses this phrase.  Please help me understand what you mean.
>


The issue here is that not all pc values have an associated source
line, and therefore what does one print in this situation?

Whatever you suggest for how to communicate this to the user is fine
with me (fwiw of course).


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC] disassemble-next-line
  2009-03-16 19:40             ` Doug Evans
@ 2009-03-16 19:54               ` Eli Zaretskii
  2009-03-17  3:15                 ` teawater
  0 siblings, 1 reply; 19+ messages in thread
From: Eli Zaretskii @ 2009-03-16 19:54 UTC (permalink / raw)
  To: Doug Evans; +Cc: teawater, tromey, pedro, drow, gdb-patches

> Date: Mon, 16 Mar 2009 12:31:44 -0700
> From: Doug Evans <dje@google.com>
> Cc: teawater <teawater@gmail.com>, tromey@redhat.com, pedro@codesourcery.com,
>         drow@false.org, gdb-patches@sourceware.org
> 
> The issue here is that not all pc values have an associated source
> line, and therefore what does one print in this situation?

Thanks.  But how can this be?  Are we talking about code compiled
without source line info, or about something else?


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC] disassemble-next-line
  2009-03-16 19:54               ` Eli Zaretskii
@ 2009-03-17  3:15                 ` teawater
  2009-03-17  4:52                   ` Eli Zaretskii
  0 siblings, 1 reply; 19+ messages in thread
From: teawater @ 2009-03-17  3:15 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Doug Evans, tromey, pedro, drow, gdb-patches

I think pc address doesn't have line info have 2 reasons:

1.  Compile without -g
2.  Some code doesn't have line info.  for example: plt code, lib code.

On Tue, Mar 17, 2009 at 03:51, Eli Zaretskii <eliz@gnu.org> wrote:
>> Date: Mon, 16 Mar 2009 12:31:44 -0700
>> From: Doug Evans <dje@google.com>
>> Cc: teawater <teawater@gmail.com>, tromey@redhat.com, pedro@codesourcery.com,
>>         drow@false.org, gdb-patches@sourceware.org
>>
>> The issue here is that not all pc values have an associated source
>> line, and therefore what does one print in this situation?
>
> Thanks.  But how can this be?  Are we talking about code compiled
> without source line info, or about something else?
>


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC] disassemble-next-line
  2009-03-17  3:15                 ` teawater
@ 2009-03-17  4:52                   ` Eli Zaretskii
  2009-03-17  5:30                     ` teawater
  0 siblings, 1 reply; 19+ messages in thread
From: Eli Zaretskii @ 2009-03-17  4:52 UTC (permalink / raw)
  To: teawater; +Cc: dje, tromey, pedro, drow, gdb-patches

> Date: Tue, 17 Mar 2009 10:17:16 +0800
> From: teawater <teawater@gmail.com>
> Cc: Doug Evans <dje@google.com>, tromey@redhat.com, pedro@codesourcery.com, 
> 	drow@false.org, gdb-patches@sourceware.org
> 
> I think pc address doesn't have line info have 2 reasons:
> 
> 1.  Compile without -g
> 2.  Some code doesn't have line info.  for example: plt code, lib code.

OK.  In that case, I suggest the following rewording:

 If AUTO (which is the default), or there's no line info to determine
 the source line of the next instruction, display disassembly of next
 instruction instead.


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC] disassemble-next-line
  2009-03-17  4:52                   ` Eli Zaretskii
@ 2009-03-17  5:30                     ` teawater
  2009-03-17  6:21                       ` teawater
  0 siblings, 1 reply; 19+ messages in thread
From: teawater @ 2009-03-17  5:30 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: dje, tromey, pedro, drow, gdb-patches

Sorry Eli,

I had checked-in the old patch because I understand your meaning of
"Everything is OK" mistake.
I will commit your words to cvs.

Thanks,
Hui

On Tue, Mar 17, 2009 at 12:14, Eli Zaretskii <eliz@gnu.org> wrote:
>> Date: Tue, 17 Mar 2009 10:17:16 +0800
>> From: teawater <teawater@gmail.com>
>> Cc: Doug Evans <dje@google.com>, tromey@redhat.com, pedro@codesourcery.com,
>>       drow@false.org, gdb-patches@sourceware.org
>>
>> I think pc address doesn't have line info have 2 reasons:
>>
>> 1.  Compile without -g
>> 2.  Some code doesn't have line info.  for example: plt code, lib code.
>
> OK.  In that case, I suggest the following rewording:
>
>  If AUTO (which is the default), or there's no line info to determine
>  the source line of the next instruction, display disassembly of next
>  instruction instead.
>


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC] disassemble-next-line
  2009-03-17  5:30                     ` teawater
@ 2009-03-17  6:21                       ` teawater
  2009-03-17 19:03                         ` Eli Zaretskii
  0 siblings, 1 reply; 19+ messages in thread
From: teawater @ 2009-03-17  6:21 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: dje, tromey, pedro, drow, gdb-patches

I had check the new patch in.

2009-03-17  Hui Zhu  <teawater@gmail.com>

	* stack.c: Change the introduce of "disassemble-next-line".

2009-03-17  Hui Zhu  <teawater@gmail.com>

	* gdb.texinfo: Change the introduce of "disassemble-next-line".

Thanks,
Hui

On Tue, Mar 17, 2009 at 13:26, teawater <teawater@gmail.com> wrote:
> Sorry Eli,
>
> I had checked-in the old patch because I understand your meaning of
> "Everything is OK" mistake.
> I will commit your words to cvs.
>
> Thanks,
> Hui
>
> On Tue, Mar 17, 2009 at 12:14, Eli Zaretskii <eliz@gnu.org> wrote:
>>> Date: Tue, 17 Mar 2009 10:17:16 +0800
>>> From: teawater <teawater@gmail.com>
>>> Cc: Doug Evans <dje@google.com>, tromey@redhat.com, pedro@codesourcery.com,
>>>       drow@false.org, gdb-patches@sourceware.org
>>>
>>> I think pc address doesn't have line info have 2 reasons:
>>>
>>> 1.  Compile without -g
>>> 2.  Some code doesn't have line info.  for example: plt code, lib code.
>>
>> OK.  In that case, I suggest the following rewording:
>>
>>  If AUTO (which is the default), or there's no line info to determine
>>  the source line of the next instruction, display disassembly of next
>>  instruction instead.
>>
>


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC] disassemble-next-line
  2009-03-17  6:21                       ` teawater
@ 2009-03-17 19:03                         ` Eli Zaretskii
  2009-03-17 23:26                           ` teawater
  0 siblings, 1 reply; 19+ messages in thread
From: Eli Zaretskii @ 2009-03-17 19:03 UTC (permalink / raw)
  To: teawater; +Cc: dje, tromey, pedro, drow, gdb-patches

> Date: Tue, 17 Mar 2009 14:05:43 +0800
> From: teawater <teawater@gmail.com>
> Cc: dje@google.com, tromey@redhat.com, pedro@codesourcery.com, drow@false.org, 
> 	gdb-patches@sourceware.org
> 
> I had check the new patch in.
> 
> 2009-03-17  Hui Zhu  <teawater@gmail.com>
> 
> 	* stack.c: Change the introduce of "disassemble-next-line".
> 
> 2009-03-17  Hui Zhu  <teawater@gmail.com>
> 
> 	* gdb.texinfo: Change the introduce of "disassemble-next-line".

Thank you.


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [RFC] disassemble-next-line
  2009-03-17 19:03                         ` Eli Zaretskii
@ 2009-03-17 23:26                           ` teawater
  0 siblings, 0 replies; 19+ messages in thread
From: teawater @ 2009-03-17 23:26 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: dje, tromey, pedro, drow, gdb-patches

On Wed, Mar 18, 2009 at 02:27, Eli Zaretskii <eliz@gnu.org> wrote:
>> Date: Tue, 17 Mar 2009 14:05:43 +0800
>> From: teawater <teawater@gmail.com>
>> Cc: dje@google.com, tromey@redhat.com, pedro@codesourcery.com, drow@false.org,
>>       gdb-patches@sourceware.org
>>
>> I had check the new patch in.
>>
>> 2009-03-17  Hui Zhu  <teawater@gmail.com>
>>
>>       * stack.c: Change the introduce of "disassemble-next-line".
>>
>> 2009-03-17  Hui Zhu  <teawater@gmail.com>
>>
>>       * gdb.texinfo: Change the introduce of "disassemble-next-line".
>
> Thank you.
>

Thanks for your help.  :)

Hui


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2009-03-17 23:26 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-08  5:34 [RFC] disassemble-next-line teawater
2009-03-09 15:29 ` Tom Tromey
2009-03-09 19:41   ` Eli Zaretskii
2009-03-10  2:45     ` Doug Evans
2009-03-11  8:32   ` teawater
2009-03-12 23:57     ` teawater
2009-03-13  0:50       ` Pedro Alves
2009-03-13  5:54         ` teawater
2009-03-13  9:53       ` Eli Zaretskii
2009-03-16  7:59         ` teawater
2009-03-16 19:22           ` Eli Zaretskii
2009-03-16 19:40             ` Doug Evans
2009-03-16 19:54               ` Eli Zaretskii
2009-03-17  3:15                 ` teawater
2009-03-17  4:52                   ` Eli Zaretskii
2009-03-17  5:30                     ` teawater
2009-03-17  6:21                       ` teawater
2009-03-17 19:03                         ` Eli Zaretskii
2009-03-17 23:26                           ` teawater

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox