aboutsummaryrefslogtreecommitdiff
path: root/gdb/printcmd.c
diff options
context:
space:
mode:
authorJim Kingdon <jkingdon@engr.sgi.com>1993-07-12 03:42:35 +0000
committerJim Kingdon <jkingdon@engr.sgi.com>1993-07-12 03:42:35 +0000
commitf1ed43304a848d01f5a4c68a7b0f41990824f293 (patch)
tree9c8e5ab5d2a97302d8d867125625f0c2ce501fa3 /gdb/printcmd.c
parentf6365bd696eccfd91d03d7a54faab5b63eadcb07 (diff)
downloadgdb-f1ed43304a848d01f5a4c68a7b0f41990824f293.zip
gdb-f1ed43304a848d01f5a4c68a7b0f41990824f293.tar.gz
gdb-f1ed43304a848d01f5a4c68a7b0f41990824f293.tar.bz2
* symtab.c (decode_line_1): Use end of block to figure out whether
val.end is in the same function, not minimal symbols. * source.c (line_info): Add a few more wrap_here's. * i386-tdep.c (i386_follow_jump): Do byteswapping where needed and don't make assumptions about sizes of host data types. * blockframe.c, symtab.h (find_pc_partial_function): New arg endaddr. * infrun.c, breakpoint.c, printcmd.c: Change callers. * printcmd.c (containing_function_bounds): Remove. * printcmd.c (disassemble_command): Use find_pc_partial_function, not containing_function_bounds. * infcmd.c (step_1): Use find_pc_partial_function rather than trying to roll our own. Move check for a pc between SIGTRAMP_START and SIGTRAMP_END in find_pc_partial_function, not step_1.
Diffstat (limited to 'gdb/printcmd.c')
-rw-r--r--gdb/printcmd.c58
1 files changed, 7 insertions, 51 deletions
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
index 191e573..48ced2a 100644
--- a/gdb/printcmd.c
+++ b/gdb/printcmd.c
@@ -32,12 +32,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "breakpoint.h"
#include "demangle.h"
-/* These are just for containing_function_bounds. It might be better
- to move containing_function_bounds to blockframe.c or thereabouts. */
-#include "bfd.h"
-#include "symfile.h"
-#include "objfiles.h"
-
extern int asm_demangle; /* Whether to demangle syms in asm printouts */
extern int addressprint; /* Whether to print hex addresses in HLL " */
@@ -128,9 +122,6 @@ disable_display_command PARAMS ((char *, int));
static void
disassemble_command PARAMS ((char *, int));
-static int
-containing_function_bounds PARAMS ((CORE_ADDR, CORE_ADDR *, CORE_ADDR *));
-
static void
printf_command PARAMS ((char *, int));
@@ -1904,41 +1895,6 @@ printf_command (arg, from_tty)
vprintf (string, args_to_vprintf);
}
-/* Helper function for asdump_command. Finds the bounds of a function
- for a specified section of text. PC is an address within the
- function which you want bounds for; *LOW and *HIGH are set to the
- beginning (inclusive) and end (exclusive) of the function. This
- function returns 1 on success and 0 on failure. */
-
-static int
-containing_function_bounds (pc, low, high)
- CORE_ADDR pc, *low, *high;
-{
- CORE_ADDR scan;
- CORE_ADDR limit;
- struct obj_section *sec;
-
- if (!find_pc_partial_function (pc, 0, low))
- return 0;
-
- sec = find_pc_section (pc);
- if (sec == NULL)
- return 0;
- limit = sec->endaddr;
-
- scan = *low;
- while (scan < limit)
- {
- ++scan;
- if (!find_pc_partial_function (scan, 0, high))
- return 0;
- if (*low != *high)
- return 1;
- }
- *high = limit;
- return 1;
-}
-
/* Dump a specified section of assembly code. With no command line
arguments, this command will dump the assembly code for the
function surrounding the pc value in the selected frame. With one
@@ -1953,24 +1909,26 @@ disassemble_command (arg, from_tty)
int from_tty;
{
CORE_ADDR low, high;
+ char *name;
CORE_ADDR pc;
char *space_index;
+ name = NULL;
if (!arg)
{
if (!selected_frame)
error ("No frame selected.\n");
pc = get_frame_pc (selected_frame);
- if (!containing_function_bounds (pc, &low, &high))
- error ("No function contains pc specified by selected frame.\n");
+ if (find_pc_partial_function (pc, &name, &low, &high) == 0)
+ error ("No function contains program counter for selected frame.\n");
}
else if (!(space_index = (char *) strchr (arg, ' ')))
{
/* One argument. */
pc = parse_and_eval_address (arg);
- if (!containing_function_bounds (pc, &low, &high))
- error ("No function contains specified pc.\n");
+ if (find_pc_partial_function (pc, &name, &low, &high) == 0)
+ error ("No function contains specified address.\n");
}
else
{
@@ -1981,10 +1939,8 @@ disassemble_command (arg, from_tty)
}
printf_filtered ("Dump of assembler code ");
- if (!space_index)
+ if (name != NULL)
{
- char *name;
- find_pc_partial_function (pc, &name, 0);
printf_filtered ("for function %s:\n", name);
}
else