Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup and update to gdb 7.8 #2

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 4 additions & 69 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -105,78 +105,12 @@ DAEMON_OBJECT_FILES=remote_daemon.o va_server.o va_server_v1.o \
lkcd_common.o lkcd_v1.o lkcd_v2_v3.o lkcd_v5.o lkcd_v7.o lkcd_v8.o \
s390_dump.o netdump_daemon.o

GDB_5.0_FILES=${GDB}/gdb/Makefile.in \
${GDB}/gdb/main.c ${GDB}/gdb/symtab.c ${GDB}/gdb/target.c \
${GDB}/gdb/blockframe.c ${GDB}/gdb/alpha-tdep.c \
${GDB}/gdb/symfile.c ${GDB}/gdb/elfread.c \
${GDB}/gdb/ui-file.c ${GDB}/gdb/utils.c ${GDB}/gdb/gnu-regex.c \
${GDB}/gdb/ppc-linux-nat.c
GDB_5.0_OFILES=${GDB}/gdb/main.o ${GDB}/gdb/symtab.o ${GDB}/gdb/target.o \
${GDB}/gdb/blockframe.o ${GDB}/gdb/alpha-tdep.o \
${GDB}/gdb/symfile.o ${GDB}/gdb/elfread.o \
${GDB}/gdb/ui-file.o ${GDB}/gdb/utils.o ${GDB}/gdb/gnu-regex.o \
${GDB}/gdb/ppc-linux-nat.o

GDB_5.1_FILES=${GDB}/gdb/Makefile.in \
${GDB}/gdb/main.c ${GDB}/gdb/symtab.c ${GDB}/gdb/target.c \
${GDB}/gdb/blockframe.c ${GDB}/gdb/alpha-tdep.c \
${GDB}/gdb/symfile.c ${GDB}/gdb/elfread.c \
${GDB}/gdb/ui-file.c ${GDB}/gdb/utils.c ${GDB}/gdb/gnu-regex.c
GDB_5.1_OFILES=${GDB}/gdb/main.o ${GDB}/gdb/symtab.o ${GDB}/gdb/target.o \
${GDB}/gdb/blockframe.o ${GDB}/gdb/alpha-tdep.o \
${GDB}/gdb/symfile.o ${GDB}/gdb/elfread.o \
${GDB}/gdb/ui-file.o ${GDB}/gdb/utils.o ${GDB}/gdb/gnu-regex.o

GDB_5.2.1_FILES=${GDB}/gdb/Makefile.in \
${GDB}/gdb/main.c ${GDB}/gdb/symtab.c ${GDB}/gdb/target.c \
${GDB}/gdb/blockframe.c ${GDB}/gdb/alpha-tdep.c \
${GDB}/gdb/symfile.c ${GDB}/gdb/elfread.c \
${GDB}/gdb/ui-file.c ${GDB}/gdb/utils.c
GDB_5.2.1_OFILES=${GDB}/gdb/main.o ${GDB}/gdb/symtab.o ${GDB}/gdb/target.o \
${GDB}/gdb/blockframe.o ${GDB}/gdb/alpha-tdep.o \
${GDB}/gdb/symfile.o ${GDB}/gdb/elfread.o \
${GDB}/gdb/ui-file.o ${GDB}/gdb/utils.o

GDB_5.3post-0.20021129.36rh_FILES=${GDB}/gdb/Makefile.in \
${GDB}/gdb/main.c ${GDB}/gdb/symtab.c ${GDB}/gdb/target.c \
${GDB}/gdb/frame.c ${GDB}/gdb/alpha-tdep.c \
${GDB}/gdb/symfile.c ${GDB}/gdb/elfread.c \
${GDB}/gdb/ui-file.c ${GDB}/gdb/utils.c ${GDB}/gdb/dwarf2read.c
GDB_5.3post-0.20021129.36rh_OFILES=${GDB}/gdb/main.o ${GDB}/gdb/symtab.o \
${GDB}/gdb/target.o ${GDB}/gdb/frame.o ${GDB}/gdb/alpha-tdep.o \
${GDB}/gdb/symfile.o ${GDB}/gdb/elfread.o ${GDB}/gdb/ui-file.o \
${GDB}/gdb/utils.o ${GDB}/gdb/dwarf2read.o

GDB_6.0_FILES=${GDB}/gdb/Makefile.in ${GDB}/Makefile.in \
${GDB}/gdb/main.c ${GDB}/gdb/symtab.c ${GDB}/gdb/target.c \
${GDB}/gdb/symfile.c ${GDB}/gdb/elfread.c \
${GDB}/gdb/ui-file.c ${GDB}/gdb/utils.c \
${GDB}/gdb/ppc-linux-tdep.c ${GDB}/sim/ppc/ppc-instructions \
${GDB}/bfd/simple.c ${GDB}/include/obstack.h
GDB_6.0_OFILES=${GDB}/gdb/main.o ${GDB}/gdb/symtab.o \
${GDB}/gdb/target.o ${GDB}/gdb/symfile.o ${GDB}/gdb/elfread.o \
${GDB}/gdb/ui-file.o ${GDB}/gdb/utils.o \
${GDB}/gdb/ppc-linux-tdep.o ${GDB}/bfd/simple.o

GDB_6.1_FILES=${GDB}/gdb/Makefile.in ${GDB}/Makefile.in \
${GDB}/gdb/main.c ${GDB}/gdb/symtab.c ${GDB}/gdb/target.c \
${GDB}/gdb/symfile.c ${GDB}/gdb/elfread.c \
${GDB}/gdb/ui-file.c ${GDB}/gdb/utils.c ${GDB}/gdb/dwarf2read.c \
${GDB}/include/obstack.h ${GDB}/gdb/ppc-linux-tdep.c
GDB_6.1_OFILES=${GDB}/gdb/main.o ${GDB}/gdb/symtab.o \
${GDB}/gdb/target.o ${GDB}/gdb/symfile.o ${GDB}/gdb/elfread.o \
${GDB}/gdb/ui-file.o ${GDB}/gdb/utils.o ${GDB}/gdb/dwarf2read.o \
${GDB}/gdb/ppc-linux-tdep.o

GDB_7.0_FILES=
GDB_7.0_OFILES=${GDB}/gdb/symtab.o

GDB_7.3.1_FILES=
GDB_7.3.1_OFILES=${GDB}/gdb/symtab.o

GDB_7.6_FILES=
GDB_7.6_OFILES=${GDB}/gdb/symtab.o

GDB_7.8_FILES=
GDB_7.8_OFILES=${GDB}/gdb/symtab.o

#
# GDB_FLAGS is passed up from the gdb Makefile.
#
Expand Down Expand Up @@ -228,6 +162,7 @@ gdb_merge: force
@echo "${LDFLAGS} -lz -ldl -rdynamic" > ${GDB}/gdb/mergelibs
@echo "../../${PROGRAM} ../../${PROGRAM}lib.a" > ${GDB}/gdb/mergeobj
@rm -f ${PROGRAM}
@ln -sf ${GDB}/gdb/ gdb
@if [ ! -f ${GDB}/config.status ]; then \
(cd ${GDB}; ./configure ${GDB_CONF_FLAGS} --with-separate-debug-dir=/usr/lib/debug \
--with-bugurl="" --with-expat=no --with-python=no; \
Expand Down
7 changes: 2 additions & 5 deletions alpha.c
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,7 @@ alpha_dump_line_number(char *name, ulong callpc)
static void
alpha_frame_offset(struct gnu_request *req, ulong alt_pc)
{
static int gdb_frame_offset_warnings = 10;
uint *ip, ival;
ulong value;

Expand Down Expand Up @@ -796,15 +797,11 @@ alpha_frame_offset(struct gnu_request *req, ulong alt_pc)
}

use_gdb:
#ifndef GDB_5_3
{
static int gdb_frame_offset_warnings = 10;

if (gdb_frame_offset_warnings-- > 0)
error(WARNING,
"GNU_ALPHA_FRAME_OFFSET functionality not ported to gdb\n");
}
#endif

req->command = GNU_ALPHA_FRAME_OFFSET;
if (alt_pc) {
ulong pc_save;
Expand Down
124 changes: 31 additions & 93 deletions configure.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@
#include <unistd.h>
#include <ctype.h>

#ifndef ARRAY_SIZE
#define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0]))
#endif

struct supported_gdb_version;
void build_configure(struct supported_gdb_version *);
void release_configure(char *, struct supported_gdb_version *);
Expand Down Expand Up @@ -158,16 +162,6 @@ void add_extra_lib(char *);
* unless overridden.
*/

#define GDB_5_3 (0)
#define GDB_6_0 (1)
#define GDB_6_1 (2)
#define GDB_7_0 (3)
#define GDB_7_3_1 (4)
#define GDB_7_6 (5)
#define SUPPORTED_GDB_VERSIONS (GDB_7_6 + 1)

int default_gdb = GDB_7_6;

struct supported_gdb_version {
char *GDB;
char *GDB_VERSION_IN;
Expand All @@ -176,52 +170,7 @@ struct supported_gdb_version {
char *GDB_PATCH_FILES;
char *GDB_FLAGS;
char *GPL;
} supported_gdb_versions[SUPPORTED_GDB_VERSIONS] = {
{
"GDB=gdb-5.3post-0.20021129.36rh",
"Red Hat Linux (5.3post-0.20021129.36rh)",
"GDB_FILES=${GDB_5.3post-0.20021129.36rh_FILES}",
"GDB_OFILES=${GDB_5.3post-0.20021129.36rh_OFILES}",
"GDB_PATCH_FILES=",
"GDB_FLAGS=-DGDB_5_3",
"GPLv2"
},
{
"GDB=gdb-6.0",
"6.0",
"GDB_FILES=${GDB_6.0_FILES}",
"GDB_OFILES=${GDB_6.0_OFILES}",
"GDB_PATCH_FILES=",
"GDB_FLAGS=-DGDB_6_0",
"GPLv2"
},
{
"GDB=gdb-6.1",
"6.1",
"GDB_FILES=${GDB_6.1_FILES}",
"GDB_OFILES=${GDB_6.1_OFILES}",
"GDB_PATCH_FILES=gdb-6.1.patch",
"GDB_FLAGS=-DGDB_6_1",
"GPLv2"
},
{
"GDB=gdb-7.0",
"7.0",
"GDB_FILES=${GDB_7.0_FILES}",
"GDB_OFILES=${GDB_7.0_OFILES}",
"GDB_PATCH_FILES=gdb-7.0.patch",
"GDB_FLAGS=-DGDB_7_0",
"GPLv3"
},
{
"GDB=gdb-7.3.1",
"7.3.1",
"GDB_FILES=${GDB_7.3.1_FILES}",
"GDB_OFILES=${GDB_7.3.1_OFILES}",
"GDB_PATCH_FILES=gdb-7.3.1.patch",
"GDB_FLAGS=-DGDB_7_3_1",
"GPLv3"
},
} supported_gdb_versions[] = {
{
"GDB=gdb-7.6",
"7.6",
Expand All @@ -231,8 +180,19 @@ struct supported_gdb_version {
"GDB_FLAGS=-DGDB_7_6",
"GPLv3"
},
{
"GDB=gdb-7.8",
"7.8",
"GDB_FILES=${GDB_7.8_FILES}",
"GDB_OFILES=${GDB_7.8_OFILES}",
"GDB_PATCH_FILES=gdb-7.8.patch",
"GDB_FLAGS=-DGDB_7_8",
"GPLv3"
},
};

struct supported_gdb_version *default_gdb = &supported_gdb_versions[0];

#define DAEMON 0x1
#define QUIET 0x2

Expand Down Expand Up @@ -1367,6 +1327,8 @@ setup_gdb_defaults(void)
}

while (fgets(inbuf, 512, fp)) {
int i;

strip_linefeeds(inbuf);
strip_beginning_whitespace(inbuf);

Expand All @@ -1375,43 +1337,19 @@ setup_gdb_defaults(void)
/*
* Simple override.
*/
if (strcmp(buf, "5.3") == 0) {
fclose(fp);
sp = &supported_gdb_versions[GDB_5_3];
fprintf(stderr, ".gdb configuration: %s\n\n", sp->GDB_VERSION_IN);
return store_gdb_defaults(sp);
}
if (strcmp(buf, "6.0") == 0) {
fclose(fp);
sp = &supported_gdb_versions[GDB_6_0];
fprintf(stderr, ".gdb configuration: %s\n\n", sp->GDB_VERSION_IN);
return store_gdb_defaults(sp);
}
if (strcmp(buf, "6.1") == 0) {
fclose(fp);
sp = &supported_gdb_versions[GDB_6_1];
fprintf(stderr, ".gdb configuration: %s\n", sp->GDB_VERSION_IN);
return store_gdb_defaults(sp);
}
if (strcmp(buf, "7.0") == 0) {
fclose(fp);
sp = &supported_gdb_versions[GDB_7_0];
fprintf(stderr, ".gdb configuration: %s\n", sp->GDB_VERSION_IN);
return store_gdb_defaults(sp);
}
if (strcmp(buf, "7.3.1") == 0) {
fclose(fp);
sp = &supported_gdb_versions[GDB_7_3_1];
fprintf(stderr, ".gdb configuration: %s\n", sp->GDB_VERSION_IN);
return store_gdb_defaults(sp);
}
if (strcmp(buf, "7.6") == 0) {
fclose(fp);
sp = &supported_gdb_versions[GDB_7_6];
fprintf(stderr, ".gdb configuration: %s\n", sp->GDB_VERSION_IN);
return store_gdb_defaults(sp);
}

for (i = 0; i < ARRAY_SIZE(supported_gdb_versions); i++) {
struct supported_gdb_version *vers;
vers = &supported_gdb_versions[i];

if (strcmp(buf, vers->GDB_VERSION_IN) == 0) {
fclose(fp);
sp = vers;
fprintf(stderr, ".gdb configuration: %s\n",
sp->GDB_VERSION_IN);
return store_gdb_defaults(sp);
}
}
}

fclose(fp);
Expand All @@ -1424,7 +1362,7 @@ struct supported_gdb_version *
store_gdb_defaults(struct supported_gdb_version *sp)
{
if (!sp)
sp = &supported_gdb_versions[default_gdb];
sp = default_gdb;
else
fprintf(stderr, "WARNING: \"make clean\" may be required before rebuilding\n\n");

Expand Down
Loading