This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH]: Fix TUI display main
- From: Stephane Carrez <stcarrez at nerim dot fr>
- To: gdb-patches at sources dot redhat dot com
- Date: Sun, 25 Aug 2002 23:23:27 +0200
- Subject: [PATCH]: Fix TUI display main
Hi!
To display the main source file the code to obtain the main address is duplicated
in tuiDisplayMain. This patch uses the tuiGetBeginAsmAddress() with does the thing.
The patch GNU-ify the function name too.
Committed on mainline.
Stephane
2002-08-25 Stephane Carrez <stcarrez@nerim.fr>
* tuiSourceWin.c (tui_display_main): Rename from tuiDisplayMainFunction
and use tuiGetBeginAsmAddress.
* tuiSourceWin.h (tui_display_main): Declare.
* tui.h (tuiDisplayMainFunction): Remove.
* tui-hooks.c (tui_new_objfile_hook): Update.
Index: tui-hooks.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tui-hooks.c,v
retrieving revision 1.4
diff -u -p -r1.4 tui-hooks.c
--- tui-hooks.c 25 Aug 2002 18:42:32 -0000 1.4
+++ tui-hooks.c 25 Aug 2002 19:17:13 -0000
@@ -71,9 +71,7 @@ static void
tui_new_objfile_hook (struct objfile* objfile)
{
if (tui_active)
- {
- tuiDisplayMainFunction ();
- }
+ tui_display_main ();
if (tui_target_new_objfile_chain)
tui_target_new_objfile_chain (objfile);
Index: tui.h
===================================================================
RCS file: /cvs/src/src/gdb/tui/tui.h,v
retrieving revision 1.13
diff -u -p -r1.13 tui.h
--- tui.h 24 Aug 2002 17:04:33 -0000 1.13
+++ tui.h 25 Aug 2002 19:17:13 -0000
@@ -125,7 +125,6 @@ extern void tui_vStartNewLines (va_list)
extern TuiStatus tui_set_layout (const char *);
/* tuiSourceWin.c */
-extern void tuiDisplayMainFunction (void);
extern void tuiUpdateAllExecInfos (void);
extern void tui_vAllSetHasBreakAt (va_list);
extern void tui_vUpdateSourceWindowsWithAddr (va_list);
Index: tuiSourceWin.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tuiSourceWin.c,v
retrieving revision 1.16
diff -u -p -r1.16 tuiSourceWin.c
--- tuiSourceWin.c 25 Aug 2002 13:13:20 -0000 1.16
+++ tuiSourceWin.c 25 Aug 2002 19:17:14 -0000
@@ -56,30 +56,15 @@
#include "tuiDisassem.h"
-/*****************************************
-** EXTERNAL FUNCTION DECLS **
-******************************************/
-
-/*****************************************
-** EXTERNAL DATA DECLS **
-******************************************/
-extern int current_source_line;
-extern struct symtab *current_source_symtab;
-
-/*
- ** tuiDisplayMainFunction().
- ** Function to display the "main" routine"
- */
+/* Function to display the "main" routine. */
void
-tuiDisplayMainFunction (void)
+tui_display_main (void)
{
if ((sourceWindows ())->count > 0)
{
CORE_ADDR addr;
- addr = parse_and_eval_address ("main");
- if (addr == (CORE_ADDR) 0)
- addr = parse_and_eval_address ("MAIN");
+ addr = tuiGetBeginAsmAddress ();
if (addr != (CORE_ADDR) 0)
{
struct symtab_and_line sal;
Index: tuiSourceWin.h
===================================================================
RCS file: /cvs/src/src/gdb/tui/tuiSourceWin.h,v
retrieving revision 1.10
diff -u -p -r1.10 tuiSourceWin.h
--- tuiSourceWin.h 25 Aug 2002 08:44:44 -0000 1.10
+++ tuiSourceWin.h 25 Aug 2002 19:17:14 -0000
@@ -22,7 +22,8 @@
#ifndef _TUI_SOURCEWIN_H
#define _TUI_SOURCEWIN_H
-extern void tuiDisplayMainFunction (void);
+/* Function to display the "main" routine. */
+extern void tui_display_main (void);
extern void tuiUpdateSourceWindow (TuiWinInfoPtr, struct symtab *, TuiLineOrAddress,
int);
extern void tuiUpdateSourceWindowAsIs (TuiWinInfoPtr, struct symtab *, TuiLineOrAddress,