--- ./gdb/mi/mi-cmd-disas.c~ 2012-03-14 20:00:23.000000000 -0700 +++ ./gdb/mi/mi-cmd-disas.c 2012-03-16 20:23:29.000000000 -0700 @@ -35,6 +35,12 @@ or: + START-ADDRESS: address to start the disassembly at. + (Automatically stops at the end of the function containing + START-ADDRESS.) + + or: + FILENAME: The name of the file where we want disassemble from. LINE: The line around which we want to disassemble. It will disassemble the function that contins that line. @@ -128,18 +134,24 @@ argv += oind; argc -= oind; + if (start_seen && !end_seen && !file_seen && !line_seen && !num_seen) + { + if (!find_pc_partial_function (low, NULL, NULL, &high)) + error (_("-data-disassemble: " + "No function contains specified address")); + else + end_seen = 1; + } + /* Allow only filename + linenum (with how_many which is not required) OR start_addr + end_addr. */ if (!((line_seen && file_seen && num_seen && !start_seen && !end_seen) || (line_seen && file_seen && !num_seen && !start_seen && !end_seen) - || (!line_seen && !file_seen && !num_seen && start_seen && end_seen))) - error (_("-data-disassemble: Usage: ( [-f filename -l linenum [-n " - "howmany]] | [-s startaddr -e endaddr]) [--] mode.")); - - if (argc != 1) + || (!line_seen && !file_seen && !num_seen && start_seen && end_seen)) + || argc != 1) error (_("-data-disassemble: Usage: [-f filename -l linenum " - "[-n howmany]] [-s startaddr -e endaddr] [--] mode.")); + "[-n howmany]] [-s startaddr [-e endaddr]] [--] mode.")); mode = atoi (argv[0]); if (mode < 0 || mode > 3)