ups-cvs Mailing List for UPS debugger (Page 5)
Brought to you by:
ianedwards
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(11) |
Nov
(49) |
Dec
(1) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(1) |
Feb
|
Mar
(10) |
Apr
(5) |
May
|
Jun
(5) |
Jul
(19) |
Aug
(29) |
Sep
(3) |
Oct
(1) |
Nov
(8) |
Dec
|
2004 |
Jan
|
Feb
(20) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
|
2005 |
Jan
(1) |
Feb
(10) |
Mar
(5) |
Apr
(1) |
May
|
Jun
|
Jul
(2) |
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
2006 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(4) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(4) |
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
(11) |
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
2009 |
Jan
|
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
(3) |
Jul
(4) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(5) |
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2012 |
Jan
|
Feb
(2) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
(34) |
Feb
(3) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Tom H. <th...@us...> - 2005-02-21 12:18:13
|
Update of /cvsroot/ups/ups/ups In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20943 Modified Files: ao_stack.c Log Message: If we're not looking at the bottom frame of the stack then lookup functions and DWARF unwind information based on the previous PC value as the return address may be beyond the end of the function if the compiler has made the last instruction a function call that it knows can never return (like a call to abort). Index: ao_stack.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_stack.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** ao_stack.c 28 Jan 2005 10:27:57 -0000 1.12 --- ao_stack.c 21 Feb 2005 12:18:02 -0000 1.13 *************** *** 445,452 **** for (stk = last = NULL; fp != (taddr_t)0; last = stk) { fil_t *fil; int lnum; ! if ((f = addr_to_func(pc)) == NULL) { f = make_badfunc(); } --- 445,453 ---- for (stk = last = NULL; fp != (taddr_t)0; last = stk) { + taddr_t prevpc = (last == NULL) ? pc : (pc - 1); fil_t *fil; int lnum; ! if ((f = addr_to_func(prevpc)) == NULL) { f = make_badfunc(); } *************** *** 466,471 **** #endif ! addr_to_fil_and_lnum(f, (last == NULL) ? pc : (pc - 1), ! &fil, &lnum, FALSE); #ifdef DEBUG_STACK --- 467,471 ---- #endif ! addr_to_fil_and_lnum(f, prevpc, &fil, &lnum, FALSE); #ifdef DEBUG_STACK *************** *** 486,490 **** */ ! if (f->fu_symtab && st_unwind(xp, f->fu_symtab, &fp, &sp, &pc)) { } else if ((f->fu_flags & FU_NO_FP) != 0 || pc < f->fu_addr) { --- 486,491 ---- */ ! if (f->fu_symtab && st_unwind(xp, f->fu_symtab, &fp, &sp, &prevpc)) { ! pc = prevpc; } else if ((f->fu_flags & FU_NO_FP) != 0 || pc < f->fu_addr) { |
From: Tom H. <th...@us...> - 2005-02-18 12:14:20
|
Update of /cvsroot/ups/ups/ups In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1895 Modified Files: ao_dwfutil.c Log Message: Handle preserved registers properly during DWARF unwind processing. Index: ao_dwfutil.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_dwfutil.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** ao_dwfutil.c 24 Feb 2004 17:02:39 -0000 1.11 --- ao_dwfutil.c 18 Feb 2005 12:14:11 -0000 1.12 *************** *** 583,586 **** --- 583,590 ---- else if (register_num == SP_COL) *regval = sp; + else if (register_num == DW_FRAME_SAME_VAL && regnum == FP_COL) + *regval = fp; + else if (register_num == DW_FRAME_SAME_VAL && regnum == SP_COL) + *regval = cfa; else rv = DW_DLV_ERROR; |
From: Tom H. <th...@us...> - 2005-02-18 10:18:12
|
Update of /cvsroot/ups/ups/ups In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3753 Modified Files: ao_elflib.c Log Message: Only advance the pointer into the local array if we have actually filled in an entry or we will wind up with bogus entries and will also overrun the end of the allocated space. Index: ao_elflib.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_elflib.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** ao_elflib.c 17 Feb 2005 14:38:09 -0000 1.14 --- ao_elflib.c 18 Feb 2005 10:18:03 -0000 1.15 *************** *** 1647,1655 **** return 0; nroot = n = malloc(sizeof(addr_t)*(i+1)); ! for (sa = ip->ip_solib_addrs; sa != NULL; sa = sa->next, n++) if (sa->vaddr) { n->addr = sa->vaddr; n->path = sa->path; } n->addr = 0; --- 1647,1656 ---- return 0; nroot = n = malloc(sizeof(addr_t)*(i+1)); ! for (sa = ip->ip_solib_addrs; sa != NULL; sa = sa->next) if (sa->vaddr) { n->addr = sa->vaddr; n->path = sa->path; + n++; } n->addr = 0; |
From: Tom H. <th...@us...> - 2005-02-17 14:38:17
|
Update of /cvsroot/ups/ups/ups In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25948 Modified Files: ao_elflib.c Log Message: When processing ldd output, ignore lines with an address and no name like this example: linux-gate.so.1 => (0xffffe000) Index: ao_elflib.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_elflib.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** ao_elflib.c 17 Feb 2005 14:28:44 -0000 1.13 --- ao_elflib.c 17 Feb 2005 14:38:09 -0000 1.14 *************** *** 1541,1546 **** pos = buf; addr = 0; ! if ((sscanf(buf, "%*s => %s (%lx)", name, &addr) == 2) ! || (sscanf(buf, "%*s => %s", name) == 1)) { if (stat(name, &stbuf) != 0) --- 1541,1547 ---- pos = buf; addr = 0; ! if (sscanf(buf, "%*s => %s (%lx)", name, &addr) == 2 || ! (sscanf(buf, "%*s => (%lx)", &addr) == 0 && ! sscanf(buf, "%*s => %s", name) == 1)) { if (stat(name, &stbuf) != 0) |
From: Tom H. <th...@us...> - 2005-02-17 14:28:54
|
Update of /cvsroot/ups/ups/ups In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23598 Modified Files: ao_elflib.c Log Message: Loosen the parsing of lines from the maps file so that we can parse the maps generated by recent linux kernels. Index: ao_elflib.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_elflib.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** ao_elflib.c 30 Nov 2004 09:08:37 -0000 1.12 --- ao_elflib.c 17 Feb 2005 14:28:44 -0000 1.13 *************** *** 1435,1439 **** while (fgets(buf, sizeof(buf), fp) != NULL) { ! if (sscanf(buf, "%lx-%*x %*s %*x %*d:%*d %*d %s", &addr, name) == 2) { if (strcmp(name, lastname) == 0) continue; --- 1435,1439 ---- while (fgets(buf, sizeof(buf), fp) != NULL) { ! if (sscanf(buf, "%lx-%*x %*s %*x %*s %*d %s", &addr, name) == 2) { if (strcmp(name, lastname) == 0) continue; |
From: Tom H. <th...@us...> - 2005-01-28 10:28:15
|
Update of /cvsroot/ups/ups/ups In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2858 Modified Files: ao_stack.c Log Message: When trying to unwind out of a function with no frame pointer move over the stack four bytes at a time, even on an x86-64 machine, as there is guarantee of eight byte alignment so we might miss the address if we move in eight byte steps. Index: ao_stack.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_stack.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** ao_stack.c 24 Feb 2004 17:02:39 -0000 1.11 --- ao_stack.c 28 Jan 2005 10:27:57 -0000 1.12 *************** *** 528,532 **** } ! for (; offset < offsetlim; offset += sizeof(taddr_t)) { func_t *cfunc; --- 528,532 ---- } ! for (; offset < offsetlim; offset += 4) { func_t *cfunc; |
From: Tom H. <th...@us...> - 2004-11-30 10:54:02
|
Update of /cvsroot/ups/ups/ups In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10526 Modified Files: ao_dwftype.c Log Message: Resolve base types in DWARF before fixing up dummy types and typedefs. Index: ao_dwftype.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_dwftype.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ao_dwftype.c 17 Sep 2003 17:05:57 -0000 1.10 --- ao_dwftype.c 30 Nov 2004 10:53:51 -0000 1.11 *************** *** 914,928 **** int recursed; { ! dtype_t *start; type_t *dest; int incomplete = 0; int bad_dummy = 0; - start = dt; - /* ! * First resolve base types and fixup dummy types. */ ! while (dt != NULL) { dwf_fixup_type(dt); if (dt->dt_base_offset != (off_t)0) { --- 914,926 ---- int recursed; { ! dtype_t *start = dt; type_t *dest; int incomplete = 0; int bad_dummy = 0; /* ! * First resolve base types. */ ! for (dt = start; dt; dt = dt->dt_next) { dwf_fixup_type(dt); if (dt->dt_base_offset != (off_t)0) { *************** *** 935,939 **** } } ! dt = dt->dt_next; } --- 933,1004 ---- } } ! } ! ! for (dt = start; dt; dt = dt->dt_next) { ! if (dt->dt_base_offset == (off_t)0) { ! type_t *base; ! qualifiers_t qual; ! typedef_t *tdef; ! lexinfo_t *lx; ! ! /* ! * If this is a dummy type (ty_code == TY_NOTYPE) then fix it. ! */ ! switch (dt->dt_is) { ! case DT_IS_TYPE: ! dest = dt->dt_type; ! if (dest->ty_code != TY_NOTYPE) ! break; ! /* ! * Only qualified types should have got a dummy type. ! */ ! if (dt->dt_type->ty_qualifiers == 0) { ! errf("\bUnqualified dummy DWARF type"); ! break; ! } ! /* ! * Copy the base type, preserving the qualifiers and lexinfo. ! */ ! base = dt->dt_type->ty_base; ! qual = dest->ty_qualifiers; ! lx = dest->ty_lexinfo; ! dwf_copy_type(dest, base); ! dest->ty_qualifiers = qual; ! if (lx) ! dest->ty_lexinfo = lx; ! break; ! ! case DT_IS_TYPEDEF: ! dest = dt->dt_type; ! if (dest->ty_code != TY_NOTYPE) ! break; ! /* ! * Copy the base type, preserving the 'typedef' pointer ! * and lexinfo ! */ ! base = *(dt->dt_p_type); ! tdef = dest->ty_typedef; ! lx = dest->ty_lexinfo; ! dwf_copy_type(dest, base); ! dest->ty_typedef = tdef; ! if (lx) ! dest->ty_lexinfo = lx; ! /* ! * If the base type does not already contain a reference to ! * a typedef then set it. This is so that variables are ! * shown with the typedef name even if the symbol table ! * used the underlying type. ! */ ! if ((base->ty_typedef == NULL) && (base->ty_lexinfo != NULL)) ! base->ty_typedef = tdef; ! break; ! ! case DT_IS_VAR: ! case DT_IS_RANGE: ! case DT_IS_BITFIELD: ! break; ! ! } ! } } *************** *** 942,947 **** * Also does base class names. */ ! dt = start; ! while (dt != NULL) { if ((dt->dt_base_offset == (off_t)0) && (dt->dt_is == DT_IS_TYPE)) { dest = dt->dt_type; --- 1007,1011 ---- * Also does base class names. */ ! for (dt = start; dt; dt = dt->dt_next) { if ((dt->dt_base_offset == (off_t)0) && (dt->dt_is == DT_IS_TYPE)) { dest = dt->dt_type; *************** *** 968,973 **** } } - - dt = dt->dt_next; } --- 1032,1035 ---- *************** *** 989,996 **** dtype_t *dbase; type_t *base; - type_t *dest; - qualifiers_t qual; - typedef_t *tdef; - lexinfo_t *lx; /* --- 1051,1054 ---- *************** *** 1012,1076 **** } - if (dt->dt_base_offset == (off_t)0) { - /* - * If this is a dummy type (ty_code == TY_NOTYPE) then fix it. - */ - switch (dt->dt_is) { - case DT_IS_TYPE: - dest = dt->dt_type; - if (dest->ty_code != TY_NOTYPE) - break; - /* - * Only qualified types should have got a dummy type. - */ - if (dt->dt_type->ty_qualifiers == 0) { - errf("\bUnqualified dummy DWARF type"); - break; - } - /* - * Copy the base type, preserving the qualifiers and lexinfo. - */ - base = dt->dt_type->ty_base; - qual = dest->ty_qualifiers; - lx = dest->ty_lexinfo; - dwf_copy_type(dest, base); - dest->ty_qualifiers = qual; - if (lx) - dest->ty_lexinfo = lx; - break; - - case DT_IS_TYPEDEF: - dest = dt->dt_type; - if (dest->ty_code != TY_NOTYPE) - break; - /* - * Copy the base type, preserving the 'typedef' pointer - * and lexinfo - */ - base = *(dt->dt_p_type); - tdef = dest->ty_typedef; - lx = dest->ty_lexinfo; - dwf_copy_type(dest, base); - dest->ty_typedef = tdef; - if (lx) - dest->ty_lexinfo = lx; - /* - * If the base type does not already contain a reference to - * a typedef then set it. This is so that variables are - * shown with the typedef name even if the symbol table - * used the underlying type. - */ - if ((base->ty_typedef == NULL) && (base->ty_lexinfo != NULL)) - base->ty_typedef = tdef; - break; - - case DT_IS_VAR: - case DT_IS_RANGE: - case DT_IS_BITFIELD: - break; - - } - } - return (dt && dt->dt_base_offset == (off_t)0) ? dt->dt_type : NULL; } --- 1070,1073 ---- |
From: Tom H. <th...@us...> - 2004-11-30 09:08:47
|
Update of /cvsroot/ups/ups/ups In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20512/ups Modified Files: ao_elflib.c ao_elfpriv.h ao_elfreadbase.c Log Message: Fixed some Solaris build problems introduced during the x86-64 port work. We need to include link.h to get the Elf32_Dyn and Elf64_Dyn type definitions on Solaris so I've put that back but we then have problems with the r_debug and link_map definitions so I have made local versions of those with different names. Index: ao_elfreadbase.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_elfreadbase.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ao_elfreadbase.c 16 Feb 2004 13:02:00 -0000 1.1 --- ao_elfreadbase.c 30 Nov 2004 09:08:37 -0000 1.2 *************** *** 29,32 **** --- 29,35 ---- #if HAVE_ELF_H #include <elf.h> + #define FREEBSD_ELF 1 + #include <link.h> + #undef FREEBSD_ELF #elif HAVE_LINUX_ELF_H #include <linux/elf.h> *************** *** 48,54 **** #include "elfstab.h" ! #ifdef OS_LINUX ! ! struct r_debug { int r_version; Elf_Addr r_map; --- 51,55 ---- #include "elfstab.h" ! struct elf_r_debug { int r_version; Elf_Addr r_map; *************** *** 58,62 **** }; ! struct link_map { Elf_Addr l_addr; Elf_Addr l_name; --- 59,63 ---- }; ! struct elf_link_map { Elf_Addr l_addr; Elf_Addr l_name; *************** *** 65,70 **** }; - #endif - static int ELF(address_size)(void) --- 66,69 ---- *************** *** 366,379 **** } ! static struct r_debug * ELF(read_r_debug)(taddr_t addr, Elfread read_callback, void *read_handle) { Elf_Addr dbaddr; ! struct r_debug *debug; ! debug = e_malloc(sizeof(struct r_debug)); if (read_callback(read_handle, addr, &dbaddr, sizeof(dbaddr)) < 0 || ! read_callback(read_handle, dbaddr, debug, sizeof(struct r_debug)) < 0) { free(debug); return NULL; --- 365,378 ---- } ! static struct elf_r_debug * ELF(read_r_debug)(taddr_t addr, Elfread read_callback, void *read_handle) { Elf_Addr dbaddr; ! struct elf_r_debug *debug; ! debug = e_malloc(sizeof(struct elf_r_debug)); if (read_callback(read_handle, addr, &dbaddr, sizeof(dbaddr)) < 0 || ! read_callback(read_handle, dbaddr, debug, sizeof(struct elf_r_debug)) < 0) { free(debug); return NULL; *************** *** 384,388 **** static taddr_t ! ELF(r_debug_map)(struct r_debug *debug) { return debug->r_map; --- 383,387 ---- static taddr_t ! ELF(r_debug_map)(struct elf_r_debug *debug) { return debug->r_map; *************** *** 390,406 **** static taddr_t ! ELF(r_debug_brk)(struct r_debug *debug) { return debug->r_brk; } ! static struct link_map * ELF(read_link_map)(taddr_t addr, Elfread read_callback, void *read_handle) { ! struct link_map *lmap; ! lmap = e_malloc(sizeof(struct link_map)); ! if (read_callback(read_handle, addr, lmap, sizeof(struct link_map)) < 0) { free(lmap); return NULL; --- 389,405 ---- static taddr_t ! ELF(r_debug_brk)(struct elf_r_debug *debug) { return debug->r_brk; } ! static struct elf_link_map * ELF(read_link_map)(taddr_t addr, Elfread read_callback, void *read_handle) { ! struct elf_link_map *lmap; ! lmap = e_malloc(sizeof(struct elf_link_map)); ! if (read_callback(read_handle, addr, lmap, sizeof(struct elf_link_map)) < 0) { free(lmap); return NULL; *************** *** 411,415 **** static taddr_t ! ELF(link_map_addr)(struct link_map *lmap) { return lmap->l_addr; --- 410,414 ---- static taddr_t ! ELF(link_map_addr)(struct elf_link_map *lmap) { return lmap->l_addr; *************** *** 417,421 **** static taddr_t ! ELF(link_map_name)(struct link_map *lmap) { return lmap->l_name; --- 416,420 ---- static taddr_t ! ELF(link_map_name)(struct elf_link_map *lmap) { return lmap->l_name; *************** *** 423,427 **** static taddr_t ! ELF(link_map_next)(struct link_map *lmap) { return lmap->l_next; --- 422,426 ---- static taddr_t ! ELF(link_map_next)(struct elf_link_map *lmap) { return lmap->l_next; *************** *** 429,433 **** static taddr_t ! ELF(link_map_prev)(struct link_map *lmap) { return lmap->l_prev; --- 428,432 ---- static taddr_t ! ELF(link_map_prev)(struct elf_link_map *lmap) { return lmap->l_prev; Index: ao_elfpriv.h =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_elfpriv.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ao_elfpriv.h 19 Feb 2004 12:48:39 -0000 1.3 --- ao_elfpriv.h 30 Nov 2004 09:08:37 -0000 1.4 *************** *** 139,154 **** int rel_type, taddr_t off, char *name)); ! struct r_debug *(*read_r_debug)PROTO((taddr_t addr, ! Elfread read_callback, ! void *read_handle)); ! taddr_t (*r_debug_map)PROTO((struct r_debug *debug)); ! taddr_t (*r_debug_brk)PROTO((struct r_debug *debug)); ! struct link_map *(*read_link_map)PROTO((taddr_t addr, ! Elfread read_callback, ! void *read_handle)); ! taddr_t (*link_map_addr)PROTO((struct link_map *lmap)); ! taddr_t (*link_map_name)PROTO((struct link_map *lmap)); ! taddr_t (*link_map_next)PROTO((struct link_map *lmap)); ! taddr_t (*link_map_prev)PROTO((struct link_map *lmap)); } Elfops; --- 139,154 ---- int rel_type, taddr_t off, char *name)); ! struct elf_r_debug *(*read_r_debug)PROTO((taddr_t addr, ! Elfread read_callback, ! void *read_handle)); ! taddr_t (*r_debug_map)PROTO((struct elf_r_debug *debug)); ! taddr_t (*r_debug_brk)PROTO((struct elf_r_debug *debug)); ! struct elf_link_map *(*read_link_map)PROTO((taddr_t addr, ! Elfread read_callback, ! void *read_handle)); ! taddr_t (*link_map_addr)PROTO((struct elf_link_map *lmap)); ! taddr_t (*link_map_name)PROTO((struct elf_link_map *lmap)); ! taddr_t (*link_map_next)PROTO((struct elf_link_map *lmap)); ! taddr_t (*link_map_prev)PROTO((struct elf_link_map *lmap)); } Elfops; Index: ao_elflib.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_elflib.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** ao_elflib.c 17 Feb 2004 17:19:13 -0000 1.11 --- ao_elflib.c 30 Nov 2004 09:08:37 -0000 1.12 *************** *** 34,37 **** --- 34,40 ---- #include <sys/param.h> /* for MAXPATHLEN */ #include <elf.h> + #define FREEBSD_ELF 1 + #include <link.h> + #undef FREEBSD_ELF #include <stdlib.h> #include <stdio.h> *************** *** 753,762 **** elf_get_core_shlib_info(alloc_pool_t *ap, iproc_t *ip) { ! struct r_debug *debug; Solib *so; const char *path; taddr_t lmaddr; Coredesc *co; ! struct link_map *lmap; so = ip->ip_solibs; --- 756,765 ---- elf_get_core_shlib_info(alloc_pool_t *ap, iproc_t *ip) { ! struct elf_r_debug *debug; Solib *so; const char *path; taddr_t lmaddr; Coredesc *co; ! struct elf_link_map *lmap; so = ip->ip_solibs; *************** *** 848,856 **** Libdep **last_child) { ! struct r_debug *debug; const char *path = "DT_DEBUG"; const char *libpath_copy; taddr_t lmaddr; ! struct link_map *lmap; target_t *xp; iproc_t *ip; --- 851,859 ---- Libdep **last_child) { ! struct elf_r_debug *debug; const char *path = "DT_DEBUG"; const char *libpath_copy; taddr_t lmaddr; ! struct elf_link_map *lmap; target_t *xp; iproc_t *ip; |
From: Tom H. <th...@us...> - 2004-11-23 16:27:23
|
Update of /cvsroot/ups/ups/ups In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24916 Modified Files: ao_dwfsyms.c Log Message: It seems that g++ generates functions to handle static construction and destruction and those functions do not have file or line attributes. This fix makes ups cope with those functions by not trying to look at the file information to get the language if there is no file information to look at. Index: ao_dwfsyms.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_dwfsyms.c,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** ao_dwfsyms.c 19 Feb 2004 12:50:31 -0000 1.22 --- ao_dwfsyms.c 23 Nov 2004 16:26:57 -0000 1.23 *************** *** 296,300 **** if (f->fu_fil == NULL) { f->fu_fil = fil; ! f->fu_language = fil->fi_language; } else if (f->fu_fil != fil) --- 296,301 ---- if (f->fu_fil == NULL) { f->fu_fil = fil; ! if (fil != NULL) ! f->fu_language = fil->fi_language; } else if (f->fu_fil != fil) |
From: Tom H. <th...@us...> - 2004-03-26 15:36:14
|
Update of /cvsroot/ups/ups/ups In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19115 Modified Files: ao_symscan.c Log Message: If we encounter an N_SO stab while we still have N_BINCL stabs oustanding that have not been closed with N_EINCL then make sure we set the symbol limit for the outstanding include files after we issue the warning. This fixes a problem with gcc 3.2.2 which seems to forget to issue a close stab for the main source file. Because the limit was then not set ups was searching all over the place for symbols. Index: ao_symscan.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_symscan.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ao_symscan.c 24 Nov 2003 13:21:50 -0000 1.5 --- ao_symscan.c 26 Mar 2004 15:25:08 -0000 1.6 *************** *** 1093,1097 **** errf("unmatched N_BINCL symbol in %s (%s)", path, name); errf_set_ofunc(oldf); ! isp = 0; } --- 1093,1098 ---- errf("unmatched N_BINCL symbol in %s (%s)", path, name); errf_set_ofunc(oldf); ! while (isp > 0) ! istack[--isp]->hf_stf->stf_symlim = symno; } |
From: <th...@us...> - 2004-02-24 17:17:00
|
Update of /cvsroot/ups/ups/ups In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28576 Modified Files: ao_dwfutil.c ao_stack.c Log Message: Record the correct frame pointer in the stack records when using the DWARF frame information to unwind the stack. Index: ao_dwfutil.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_dwfutil.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ao_dwfutil.c 24 Feb 2004 14:40:09 -0000 1.10 --- ao_dwfutil.c 24 Feb 2004 17:02:39 -0000 1.11 *************** *** 622,628 **** if (dwf_unwind_reg(fde, xp, cfa, *fp, *sp, *pc, CFA_COL, &cfa) && dwf_unwind_reg(fde, xp, cfa, *fp, *sp, *pc, RA_COL, &new_pc)) { ! if (!dwf_unwind_reg(fde, xp, cfa, *fp, *sp, *pc, FP_COL, &new_fp)) ! new_fp = cfa - 16; ! if (!dwf_unwind_reg(fde, xp, cfa, *fp, *sp, *pc, SP_COL, &new_sp)) new_sp = cfa; --- 622,628 ---- if (dwf_unwind_reg(fde, xp, cfa, *fp, *sp, *pc, CFA_COL, &cfa) && dwf_unwind_reg(fde, xp, cfa, *fp, *sp, *pc, RA_COL, &new_pc)) { ! if (!dwf_unwind_reg(fde, xp, cfa, *fp, *sp, *pc, FP_COL, &new_fp)) ! new_fp = 0; ! if (!dwf_unwind_reg(fde, xp, cfa, *fp, *sp, *pc, SP_COL, &new_sp)) new_sp = cfa; Index: ao_stack.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_stack.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ao_stack.c 21 Feb 2004 17:00:00 -0000 1.10 --- ao_stack.c 24 Feb 2004 17:02:39 -0000 1.11 *************** *** 477,480 **** --- 477,481 ---- stk = make_stk(f, pc, fil, lnum, last); + stk->stk_fp = stk->stk_ap = fp; stk->stk_sp = sp; *************** *** 486,490 **** if (f->fu_symtab && st_unwind(xp, f->fu_symtab, &fp, &sp, &pc)) { - stk->stk_fp = stk->stk_ap = fp; } else if ((f->fu_flags & FU_NO_FP) != 0 || pc < f->fu_addr) { --- 487,490 ---- *************** *** 641,652 **** } ! stk->stk_fp = sp + offset; stk->stk_sp = sp; sp = sp + offset + 4; } else { - stk->stk_fp = stk->stk_ap = fp; - stk->stk_sp = sp; - if (dread_addrval(xp, stk->stk_fp, &fp) != 0) break; --- 641,649 ---- } ! stk->stk_fp = stk->stk_ap = sp + offset; stk->stk_sp = sp; sp = sp + offset + 4; } else { if (dread_addrval(xp, stk->stk_fp, &fp) != 0) break; |
From: <th...@us...> - 2004-02-24 14:54:28
|
Update of /cvsroot/ups/ups/ups In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28052 Modified Files: ao_dwfutil.c Log Message: Make sure FP and SP are updated properly when using DWARF frame information to unwind the stack. Index: ao_dwfutil.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_dwfutil.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ao_dwfutil.c 21 Feb 2004 17:00:00 -0000 1.9 --- ao_dwfutil.c 24 Feb 2004 14:40:09 -0000 1.10 *************** *** 623,631 **** dwf_unwind_reg(fde, xp, cfa, *fp, *sp, *pc, RA_COL, &new_pc)) { if (!dwf_unwind_reg(fde, xp, cfa, *fp, *sp, *pc, FP_COL, &new_fp)) ! *fp = cfa - 16; if (!dwf_unwind_reg(fde, xp, cfa, *fp, *sp, *pc, SP_COL, &new_sp)) ! *sp = cfa; *pc = new_pc; } --- 623,633 ---- dwf_unwind_reg(fde, xp, cfa, *fp, *sp, *pc, RA_COL, &new_pc)) { if (!dwf_unwind_reg(fde, xp, cfa, *fp, *sp, *pc, FP_COL, &new_fp)) ! new_fp = cfa - 16; if (!dwf_unwind_reg(fde, xp, cfa, *fp, *sp, *pc, SP_COL, &new_sp)) ! new_sp = cfa; + *fp = new_fp; + *sp = new_sp; *pc = new_pc; } |
From: <th...@us...> - 2004-02-24 14:53:50
|
Update of /cvsroot/ups/ups/lib/libdwarf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27897 Modified Files: dwarf_frame.c Log Message: Fix handling of DW_CFA_def_cfa_register ops. According to the DWARF 2 specification only the register number should be updated by such an op and the offset should be left alone. Index: dwarf_frame.c =================================================================== RCS file: /cvsroot/ups/ups/lib/libdwarf/dwarf_frame.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** dwarf_frame.c 16 Jul 2003 14:36:03 -0000 1.2 --- dwarf_frame.c 24 Feb 2004 14:39:33 -0000 1.3 *************** *** 603,609 **** } - reg[DW_FRAME_CFA_COL].ru_is_off = 0; reg[DW_FRAME_CFA_COL].ru_register = reg_no; - reg[DW_FRAME_CFA_COL].ru_offset = 0; fp_register = reg_no; break; --- 603,607 ---- |
From: <th...@us...> - 2004-02-21 18:06:11
|
Update of /cvsroot/ups/ups/ups In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5889 Modified Files: ui_layout.c Log Message: Reorded includes to resolve type redefinition error. Index: ui_layout.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ui_layout.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ui_layout.c 16 Feb 2004 13:02:00 -0000 1.4 --- ui_layout.c 21 Feb 2004 17:54:08 -0000 1.5 *************** *** 71,76 **** #include "sccsdata.h" #include "util.h" - #include "st.h" #include "target.h" #include "exec.h" #ifdef AO_ELF --- 71,76 ---- #include "sccsdata.h" #include "util.h" #include "target.h" + #include "st.h" #include "exec.h" #ifdef AO_ELF |
From: <th...@us...> - 2004-02-21 17:12:02
|
Update of /cvsroot/ups/ups/ups In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27494 Modified Files: ao_dwftext.c ao_dwftext.h ao_dwfutil.c ao_dwfutil.h ao_stack.c ao_symload.c ao_symload.h as_mi.c obj_stack.c srcwin.c st.h st_lookup.c target.h xc_text.c Log Message: Use DWARF frame information to unwind the stack on x86 platforms. Index: ao_dwftext.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_dwftext.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ao_dwftext.c 24 Nov 2003 13:21:50 -0000 1.5 --- ao_dwftext.c 21 Feb 2004 17:00:00 -0000 1.6 *************** *** 41,44 **** --- 41,45 ---- #include "ao_dwfsyms.h" #include "ao_dwftext.h" + #include "ao_dwfutil.h" #include "ao_symcb.h" #include "cursors.h" *************** *** 386,390 **** } ! #endif /* WANT_DWARF */ --- 387,411 ---- } + /* + * Unwind a stack frame. + */ + bool + dw_unwind(xp, st, fp, sp, pc) + target_t *xp; + symtab_t *st; + taddr_t *fp; + taddr_t *sp; + taddr_t *pc; + { + ao_stdata_t *ast = AO_STDATA(st); + taddr_t adjusted_pc = *pc - ast->st_base_address; + + if (dwf_unwind(ast->st_dw_dbg, xp, fp, sp, &adjusted_pc)) { + *pc = adjusted_pc; + return TRUE; + } ! return FALSE; ! } + #endif /* WANT_DWARF */ Index: ao_dwftext.h =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_dwftext.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ao_dwftext.h 24 Nov 2003 13:21:50 -0000 1.3 --- ao_dwftext.h 21 Feb 2004 17:00:00 -0000 1.4 *************** *** 42,44 **** --- 42,47 ---- macro_t * dw_get_fi_macros PROTO((fil_t *fil)); + bool dw_unwind PROTO((target_t *xp, symtab_t *st, taddr_t *fp, + taddr_t *sp, taddr_t *pc)); + #endif /* WANT_DWARF */ Index: ao_dwfutil.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_dwfutil.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ao_dwfutil.c 21 Feb 2004 14:57:01 -0000 1.8 --- ao_dwfutil.c 21 Feb 2004 17:00:00 -0000 1.9 *************** *** 37,40 **** --- 37,41 ---- #include "ci.h" #include "st.h" + #include "data.h" #include "ao_dwarf.h" #include "ao_syms.h" *************** *** 546,549 **** } ! #endif /* WANT_DWARF */ --- 547,660 ---- } ! #if defined(ARCH_386_64) ! #define CFA_COL DW_FRAME_CFA_COL ! #define FP_COL 6 ! #define SP_COL 7 ! #define RA_COL 16 ! #elif defined(ARCH_386) ! #define CFA_COL DW_FRAME_CFA_COL ! #define FP_COL 5 ! #define SP_COL 4 ! #define RA_COL 8 ! #endif ! ! #if defined(ARCH_386) + /* + * Unwind the value of a specified register. + */ + static bool + dwf_unwind_reg(Dwarf_Fde fde, target_t *xp, taddr_t cfa, taddr_t fp, taddr_t sp, + taddr_t pc, int regnum, taddr_t *regval) + { + int rv; + Dwarf_Error err; + Dwarf_Signed offset_relevant; + Dwarf_Signed register_num; + Dwarf_Signed offset; + + if ((rv = dwarf_get_fde_info_for_reg(fde, regnum, pc, &offset_relevant, + ®ister_num, &offset, NULL, + &err)) == DW_DLV_OK) { + if (register_num == CFA_COL) + *regval = cfa; + else if (register_num == FP_COL) + *regval = fp; + else if (register_num == SP_COL) + *regval = sp; + else + rv = DW_DLV_ERROR; + + if (rv == DW_DLV_OK && offset_relevant) + *regval += offset; + + if (rv == DW_DLV_OK && register_num == CFA_COL) + dread_addrval(xp, *regval, regval); + } + + return rv == DW_DLV_OK; + } + + /* + * Unwind a stack frame. + */ + bool + dwf_unwind(Dwarf_Debug dbg, target_t *xp, taddr_t *fp, taddr_t *sp, taddr_t *pc) + { + int rv; + Dwarf_Error err; + Dwarf_Cie *cie_data; + Dwarf_Signed cie_count; + Dwarf_Fde *fde_data; + Dwarf_Signed fde_count; + + if ((rv = dwarf_get_fde_list(dbg, &cie_data, &cie_count, &fde_data, &fde_count, &err)) == DW_DLV_OK) { + Dwarf_Cie *ciep; + Dwarf_Fde *fdep; + Dwarf_Fde fde; + + if ((rv = dwarf_get_fde_at_pc(fde_data, *pc, &fde, NULL, NULL, &err)) == DW_DLV_OK) { + taddr_t cfa; + taddr_t new_fp; + taddr_t new_sp; + taddr_t new_pc; + + if (dwf_unwind_reg(fde, xp, cfa, *fp, *sp, *pc, CFA_COL, &cfa) && + dwf_unwind_reg(fde, xp, cfa, *fp, *sp, *pc, RA_COL, &new_pc)) { + if (!dwf_unwind_reg(fde, xp, cfa, *fp, *sp, *pc, FP_COL, &new_fp)) + *fp = cfa - 16; + + if (!dwf_unwind_reg(fde, xp, cfa, *fp, *sp, *pc, SP_COL, &new_sp)) + *sp = cfa; + + *pc = new_pc; + } + } + + for (ciep = cie_data; ciep < cie_data + cie_count; ciep++) + dwarf_dealloc(dbg, *ciep, DW_DLA_CIE); + + for (fdep = fde_data; fdep < fde_data + fde_count; fdep++) + dwarf_dealloc(dbg, *fdep, DW_DLA_FDE); + + dwarf_dealloc(dbg, cie_data, DW_DLA_LIST); + dwarf_dealloc(dbg, fde_data, DW_DLA_LIST); + } + + return rv == DW_DLV_OK; + } + + #else /* ARCH_386 */ + + /* + * Unwind a stack frame. + */ + bool + dwf_unwind(Dwarf_Debug dbg, target_t *xp, taddr_t *fp, taddr_t *sp, taddr_t *pc) + { + return FALSE; + } + + #endif /* ARCH_386 */ + + #endif /* WANT_DWARF */ Index: ao_dwfutil.h =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_dwfutil.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ao_dwfutil.h 2 Mar 2003 20:13:38 -0000 1.3 --- ao_dwfutil.h 21 Feb 2004 17:00:00 -0000 1.4 *************** *** 48,50 **** --- 48,53 ---- Dwarf_Die die, Dwarf_Half id)); + bool dwf_unwind PROTO((Dwarf_Debug dbg, target_t *xp, taddr_t *fp, + taddr_t *sp, taddr_t *pc)); + #endif /* WANT_DWARF */ Index: ao_stack.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_stack.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ao_stack.c 21 Feb 2004 12:57:21 -0000 1.9 --- ao_stack.c 21 Feb 2004 17:00:00 -0000 1.10 *************** *** 477,480 **** --- 477,482 ---- stk = make_stk(f, pc, fil, lnum, last); + stk->stk_sp = sp; + if (!get_preamble(f, (ao_preamble_t **)NULL)) break; *************** *** 483,487 **** */ ! if ((f->fu_flags & FU_NO_FP) != 0 || pc < f->fu_addr) { ao_preamble_t *pr; int offset; --- 485,492 ---- */ ! if (f->fu_symtab && st_unwind(xp, f->fu_symtab, &fp, &sp, &pc)) { ! stk->stk_fp = stk->stk_ap = fp; ! } ! else if ((f->fu_flags & FU_NO_FP) != 0 || pc < f->fu_addr) { ao_preamble_t *pr; int offset; Index: ao_symload.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_symload.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ao_symload.c 24 Nov 2003 13:21:50 -0000 1.6 --- ao_symload.c 21 Feb 2004 17:00:00 -0000 1.7 *************** *** 810,813 **** --- 810,824 ---- } + bool + ao_unwind(xp, st, fp, sp, pc) + target_t *xp; + symtab_t *st; + taddr_t *fp; + taddr_t *sp; + taddr_t *pc; + { + return FALSE; + } + /* Many compilers give you two seperate symbol table entries for a * register parameter - one for the stack copy of the parameter, one Index: ao_symload.h =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_symload.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ao_symload.h 24 Nov 2003 13:21:50 -0000 1.4 --- ao_symload.h 21 Feb 2004 17:00:01 -0000 1.5 *************** *** 30,33 **** --- 30,35 ---- var_t *ao_get_fi_vars PROTO((fil_t *fil)); macro_t *ao_get_fi_macros PROTO((fil_t *fil)); + bool ao_unwind PROTO((target_t *xp, symtab_t *st, taddr_t *fp, + taddr_t *sp, taddr_t *pc)); block_t *ao_get_fu_blocks PROTO((func_t *f)); func_t *ao_ensure_fu PROTO((func_t *f)); Index: as_mi.c =================================================================== RCS file: /cvsroot/ups/ups/ups/as_mi.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** as_mi.c 26 Oct 2002 13:06:01 -0000 1.1.1.1 --- as_mi.c 21 Feb 2004 17:00:01 -0000 1.2 *************** *** 39,45 **** #include "ups.h" #include "symtab.h" #include "st.h" #include "trun.h" - #include "target.h" #include "as.h" #include "debug.h" --- 39,45 ---- #include "ups.h" #include "symtab.h" + #include "target.h" #include "st.h" #include "trun.h" #include "as.h" #include "debug.h" Index: obj_stack.c =================================================================== RCS file: /cvsroot/ups/ups/ups/obj_stack.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** obj_stack.c 16 Feb 2004 13:02:00 -0000 1.4 --- obj_stack.c 21 Feb 2004 17:00:01 -0000 1.5 *************** *** 50,55 **** #include "ao_syms.h" #include "srcwin.h" - #include "st.h" #include "target.h" #include "obj_stack.h" #include "data.h" --- 50,55 ---- #include "ao_syms.h" #include "srcwin.h" #include "target.h" + #include "st.h" #include "obj_stack.h" #include "data.h" Index: srcwin.c =================================================================== RCS file: /cvsroot/ups/ups/ups/srcwin.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** srcwin.c 16 Feb 2004 13:02:00 -0000 1.5 --- srcwin.c 21 Feb 2004 17:00:01 -0000 1.6 *************** *** 46,53 **** #include "reg.h" #include "symtab.h" #include "st.h" #include "srcbuf.h" #include "srcwin.h" - #include "target.h" #include "srcpath.h" #include "va_priv.h" --- 46,53 ---- #include "reg.h" #include "symtab.h" + #include "target.h" #include "st.h" #include "srcbuf.h" #include "srcwin.h" #include "srcpath.h" #include "va_priv.h" Index: st.h =================================================================== RCS file: /cvsroot/ups/ups/ups/st.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** st.h 24 Nov 2003 13:21:50 -0000 1.4 --- st.h 21 Feb 2004 17:00:01 -0000 1.5 *************** *** 41,44 **** --- 41,48 ---- #define ST_H_INCLUDED + + #ifndef TARGET_H_INCLUDED + typedef struct target_s target_t; + #endif typedef int (*matchfunc_t)PROTO((const char *name, const char *pat)); *************** *** 73,76 **** --- 77,83 ---- macro_t *(*so_get_fi_macros)PROTO((fil_t *fil)); + bool (*so_unwind)PROTO((target_t *xp, symtab_t *st, taddr_t *fp, + taddr_t *sp, taddr_t *pc)); + const char *(*so_disassemble_instruction)PROTO((func_t *f, taddr_t addr, const char *text, *************** *** 123,126 **** --- 130,136 ---- (fil->fi_symtab->st_ops->so_get_fi_macros)(fil) + #define st_unwind(xp, st, fp, sp, pc) \ + (st->st_ops->so_unwind)(xp, st, fp, sp, pc) + #define st_disassemble_instruction(f, addr, text, len) \ (f->fu_symtab->st_ops->so_disassemble_instruction)(f, addr, text, len) Index: st_lookup.c =================================================================== RCS file: /cvsroot/ups/ups/ups/st_lookup.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** st_lookup.c 24 Nov 2003 13:21:50 -0000 1.5 --- st_lookup.c 21 Feb 2004 17:00:01 -0000 1.6 *************** *** 46,51 **** #include "ci.h" #include "ci_util.h" - #include "st.h" #include "target.h" #include "state.h" #include "srcwin.h" --- 46,51 ---- #include "ci.h" #include "ci_util.h" #include "target.h" + #include "st.h" #include "state.h" #include "srcwin.h" Index: target.h =================================================================== RCS file: /cvsroot/ups/ups/ups/target.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** target.h 16 Feb 2004 13:02:00 -0000 1.3 --- target.h 21 Feb 2004 17:00:01 -0000 1.4 *************** *** 135,139 **** typedef struct stack_s Stack; ! typedef struct { /* These fields are set by make_target() */ --- 135,139 ---- typedef struct stack_s Stack; ! typedef struct target_s { /* These fields are set by make_target() */ Index: xc_text.c =================================================================== RCS file: /cvsroot/ups/ups/ups/xc_text.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** xc_text.c 18 Feb 2004 10:56:29 -0000 1.7 --- xc_text.c 21 Feb 2004 17:00:01 -0000 1.8 *************** *** 106,109 **** --- 106,111 ---- static var_t *xc_get_fi_vars PROTO((fil_t *fil)); static macro_t *xc_get_fi_macros PROTO((fil_t *fil)); + static bool xc_unwind PROTO((target_t *xp, symtab_t *st, taddr_t *fp, + taddr_t *sp, taddr_t *pc)); static func_t *xc_ensure_fu PROTO((func_t *f)); static fil_t *xc_get_fi PROTO((symtab_t *st)); *************** *** 1102,1105 **** --- 1104,1109 ---- xc_get_fi_macros, + xc_unwind, + xc_disassemble_instruction, xc_get_jumps, *************** *** 1335,1338 **** --- 1339,1353 ---- } + static bool + xc_unwind(xp, st, fp, sp, pc) + target_t *xp; + symtab_t *st; + taddr_t *fp; + taddr_t *sp; + taddr_t *pc; + { + return FALSE; + } + static func_t * xc_ensure_fu(f) |
From: <th...@us...> - 2004-02-21 16:46:44
|
Update of /cvsroot/ups/ups/ups In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22815 Modified Files: ao_text.c Log Message: Fix typo that made all functions look like they had a frame pointer on x86-64 systems. Index: ao_text.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_text.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ao_text.c 21 Feb 2004 12:58:07 -0000 1.8 --- ao_text.c 21 Feb 2004 16:34:40 -0000 1.9 *************** *** 200,203 **** --- 200,205 ---- ao_get_fi_macros, + ao_unwind, + ao_disassemble_instruction, ao_get_jumps, *************** *** 228,231 **** --- 230,235 ---- dw_get_fi_macros, + dw_unwind, + ao_disassemble_instruction, ao_get_jumps, *************** *** 612,619 **** text += 4; } ! #else else f->fu_flags |= FU_NO_FP; - #endif if (*(unsigned short *)text == SUBL_IMM_ESP) { --- 616,622 ---- text += 4; } ! #endif else f->fu_flags |= FU_NO_FP; if (*(unsigned short *)text == SUBL_IMM_ESP) { |
From: <th...@us...> - 2004-02-21 15:08:57
|
Update of /cvsroot/ups/ups/ups In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3963 Modified Files: ao_dwfutil.c Log Message: Handle DW_OP_regx in location expressions so that register numbers greater than 31 are handled - register 32 can be used for FP values on x86-64 systems. Index: ao_dwfutil.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_dwfutil.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ao_dwfutil.c 31 Oct 2003 23:59:08 -0000 1.7 --- ao_dwfutil.c 21 Feb 2004 14:57:01 -0000 1.8 *************** *** 519,522 **** --- 519,528 ---- vaddr->v_op = OP_REGISTER; vaddr->v_register = op - DW_OP_reg0; + } else if (op == DW_OP_regx) { + /* + * Register + */ + vaddr->v_op = OP_REGISTER; + vaddr->v_register = loclist[i].ld_s->lr_number; } else if (op == DW_OP_plus_uconst) { /* |
From: <th...@us...> - 2004-02-21 13:10:08
|
Update of /cvsroot/ups/ups/ups In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14574 Modified Files: ao_text.c Log Message: Improve function prologue recognition x86-64 based systems. Index: ao_text.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_text.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ao_text.c 16 Feb 2004 14:04:59 -0000 1.7 --- ao_text.c 21 Feb 2004 12:58:07 -0000 1.8 *************** *** 520,525 **** #define JMP_SHORT 0xeb ! #define SUBL_IMM_ESP 0xec81 /* four byte operand */ ! #define SUBL_IMM_ESP_SHORT 0xec83 /* one byte operand */ /* No, I don't have the faintest idea why opcodes should be different --- 520,527 ---- #define JMP_SHORT 0xeb ! #define SUBL_IMM_ESP 0xec81 /* four byte operand */ ! #define SUBL_IMM_ESP_SHORT 0xec83 /* one byte operand */ ! #define SUBQ_IMM_ESP 0xec8148 /* four byte operand */ ! #define SUBQ_IMM_ESP_SHORT 0xec8348 /* one byte operand */ /* No, I don't have the faintest idea why opcodes should be different *************** *** 603,614 **** } ! if ((*(unsigned *)text & 0xffffff) == (PUSHL_EBP | (MOVL_ESP_EBP << 8))) { text += 3; } ! else if ((*(unsigned *)text & 0xffffffff) == (PUSHQ_RBP | (MOVQ_RSP_RBP << 8))) { text += 4; } else f->fu_flags |= FU_NO_FP; if (*(unsigned short *)text == SUBL_IMM_ESP) { --- 605,619 ---- } ! if ((*(unsigned int *)text & 0xffffff) == (PUSHL_EBP | (MOVL_ESP_EBP << 8))) { text += 3; } ! #if defined(ARCH_386_64) ! else if ((*(unsigned int *)text & 0xffffffff) == (PUSHQ_RBP | (MOVQ_RSP_RBP << 8))) { text += 4; } + #else else f->fu_flags |= FU_NO_FP; + #endif if (*(unsigned short *)text == SUBL_IMM_ESP) { *************** *** 620,623 **** --- 625,638 ---- text += 3; } + #if defined(ARCH_386_64) + else if ((*(unsigned int *)text & 0xffffff) == SUBQ_IMM_ESP) { + pr->pr_rsave_offset = -*(int *)&text[3]; + text += 7; + } + else if ((*(unsigned int *)text & 0xffffff) == SUBQ_IMM_ESP_SHORT) { + pr->pr_rsave_offset = -*(unsigned char *)&text[3]; + text += 4; + } + #endif else pr->pr_rsave_offset = 0; *************** *** 627,634 **** while ((text[0] & 0x7) == 0x50 || (text[0] == 0x41 && (text[1] & 0x7) == 0x50)) { ! #ifdef OS_SUNOS static int regs[] = { EAX, ECX, EDX, EBX, ESP, EBP, ESI, EDI }; ! #endif ! #if defined(ARCH_LINUX386_64) static int regs[] = { RAX, RCX, RDX, RBX, RSP, RBP, RSI, RDI, R8, R9, R10, R11, R12, R13, R14, R15 }; #elif defined(ARCH_LINUX386) --- 642,648 ---- while ((text[0] & 0x7) == 0x50 || (text[0] == 0x41 && (text[1] & 0x7) == 0x50)) { ! #if defined(OS_SUNOS) static int regs[] = { EAX, ECX, EDX, EBX, ESP, EBP, ESI, EDI }; ! #elif defined(ARCH_LINUX386_64) static int regs[] = { RAX, RCX, RDX, RBX, RSP, RBP, RSI, RDI, R8, R9, R10, R11, R12, R13, R14, R15 }; #elif defined(ARCH_LINUX386) *************** *** 640,652 **** panic("pushl botch in gsf"); if (text[0] == 0x41) { reg += 8; text++; } #if defined(OS_SUNOS) || defined(OS_LINUX) reg += regs[text[0] & 7]; ! #endif ! #ifdef OS_BSD44 reg += text[0] & 7; #endif --- 654,667 ---- panic("pushl botch in gsf"); + #if defined(ARCH_386_64) if (text[0] == 0x41) { reg += 8; text++; } + #endif #if defined(OS_SUNOS) || defined(OS_LINUX) reg += regs[text[0] & 7]; ! #elif defined(OS_BSD44) reg += text[0] & 7; #endif |
From: <th...@us...> - 2004-02-21 13:09:28
|
Update of /cvsroot/ups/ups/ups In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14464 Modified Files: ao_stack.c ao_pt_regs.c Log Message: Make floating point register access work on x86-64 systems. Index: ao_stack.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_stack.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ao_stack.c 16 Feb 2004 13:02:00 -0000 1.8 --- ao_stack.c 21 Feb 2004 12:57:21 -0000 1.9 *************** *** 1255,1258 **** --- 1255,1266 ---- } #endif + #ifdef ARCH_386_64 + /* Registers 17 to 32 are the SSE XMM registers which are + * used for fp values on x86-64 architectures. + */ + if (reg >= 17 && reg <= 32) { + return 0; + } + #endif #ifdef ARCH_386 reg = x86_gcc_register(reg); Index: ao_pt_regs.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_pt_regs.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ao_pt_regs.c 16 Feb 2004 13:02:00 -0000 1.9 --- ao_pt_regs.c 21 Feb 2004 12:57:22 -0000 1.10 *************** *** 692,696 **** fpval_t *p_val; { ! #ifdef ARCH_SUN3 sunregs_t *sr; --- 692,696 ---- fpval_t *p_val; { ! #if defined(ARCH_SUN3) sunregs_t *sr; *************** *** 710,714 **** convert_68881_reg((unsigned *)sr->sr_fpu.f_fpstatus.fps_regs[regno].fp, ! (num_bytes == sizeof(double), p_val); return 0; #else --- 710,739 ---- convert_68881_reg((unsigned *)sr->sr_fpu.f_fpstatus.fps_regs[regno].fp, ! (num_bytes == sizeof(double)), p_val); ! return 0; ! #elif defined(ARCH_386_64) ! ptrace_regs_t *pr = &ip->ip_ptrace_info->ptrace_regs; ! ! regno -= 17; ! if (regno < 0 || regno > 15) ! panic("bad regno in rf"); ! ! if (pr->need_fpregs) { ! e_ptrace(PTRACE_GETFPREGS, ip->ip_pid, NULL, (long)&pr->fpregs); ! pr->need_fpregs = FALSE; ! } ! ! switch (num_bytes) { ! case sizeof(float): ! p_val->f = ((float *)pr->fpregs.xmm_space)[regno * 4]; ! break; ! case sizeof(double): ! p_val->d = ((double *)pr->fpregs.xmm_space)[regno * 2]; ! break; ! default: ! panic("cannot get this size floating point from register"); ! break; ! } ! return 0; #else |
From: <th...@us...> - 2004-02-19 13:00:49
|
Update of /cvsroot/ups/ups/ups In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17568 Modified Files: ao_dwfsyms.c Log Message: Stop the DWARF symbol reading aborting if it finds an existing function at the same address with a different name as glibc often has multiple names for a function and it will be random which one is already in the symbol table. Instead we usurp the existing entry and change it's name to match that from the DWARF data, which is presumably the canonical name. Index: ao_dwfsyms.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_dwfsyms.c,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** ao_dwfsyms.c 24 Nov 2003 13:21:50 -0000 1.21 --- ao_dwfsyms.c 19 Feb 2004 12:50:31 -0000 1.22 *************** *** 289,293 **** if (addr_and_functab_to_func(st->st_functab, addr, &f) && f->fu_addr == addr) { if (strcmp(f->fu_name, name) != 0) ! panic("Name mismatch"); if (f->fu_symtab != st) --- 289,293 ---- if (addr_and_functab_to_func(st->st_functab, addr, &f) && f->fu_addr == addr) { if (strcmp(f->fu_name, name) != 0) ! f->fu_name = name; if (f->fu_symtab != st) |
From: <th...@us...> - 2004-02-19 12:58:57
|
Update of /cvsroot/ups/ups/ups In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17455 Modified Files: ao_elfread.c ao_elfsym.c ao_elfpriv.h Log Message: Add support for separate debug files, located using the .gnu_debuglink section in the main ELF file. Index: ao_elfread.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_elfread.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ao_elfread.c 16 Feb 2004 13:01:59 -0000 1.4 --- ao_elfread.c 19 Feb 2004 12:48:38 -0000 1.5 *************** *** 234,237 **** --- 234,238 ---- el->fd = fd; el->sections = alloc(ap, elf_header_shsize(elops, eh)); + el->debugel = el; if (!read_chunk(textpath, Elfwhat, fd, "section header table", *************** *** 263,266 **** --- 264,418 ---- } + /* + * This routine for calculating the CRC for a separate debug file + * is GPLed code borrowed from binutils. + */ + static unsigned long + calc_gnu_debuglink_crc32(unsigned long crc, const unsigned char *buf, int len) + { + static const unsigned long crc32_table[256] = + { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, + 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, + 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, + 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, + 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856, + 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, + 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, + 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, + 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a, + 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, + 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, + 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, + 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, + 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e, + 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, + 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, + 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, + 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, + 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, + 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, + 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010, + 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, + 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, + 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, + 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, + 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344, + 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, + 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, + 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, + 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c, + 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, + 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, + 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, + 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, + 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c, + 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, + 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, + 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, + 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, + 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278, + 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, + 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66, + 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, + 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, + 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, + 0x2d02ef8d + }; + const unsigned char *end; + + crc = ~crc & 0xffffffff; + for (end = buf + len; buf < end; ++ buf) + crc = crc32_table[(crc ^ *buf) & 0xff] ^ (crc >> 8); + return ~crc & 0xffffffff;; + } + + static bool + debug_file_exists(const char *debugpath, unsigned long crc) + { + int fd; + unsigned char buffer[8192]; + int count; + unsigned long file_crc; + + if ((fd = open(debugpath, O_RDONLY)) < 0) + return FALSE; + + file_crc = 0; + + while ((count = read(fd, buffer, sizeof(buffer))) > 0) + file_crc = calc_gnu_debuglink_crc32(file_crc, buffer, count); + + close(fd); + + return crc == file_crc; + } + + static bool + find_debug_file(const char *textpath, const char *debugname, + unsigned long crc, char *debugpath) + { + char *textdir; + char *textdirptr; + + textdir = strsave(textpath); + + if ((textdirptr = strrchr(textdir, '/')) != NULL) { + *textdirptr = '\0'; + } + + sprintf(debugpath, "%s/%s", textdir, debugname); + + if (!debug_file_exists(debugpath, crc)) { + sprintf(debugpath, "%s/.debug/%s", textdir, debugname); + + if (!debug_file_exists(debugpath, crc)) { + sprintf(debugpath, "/usr/lib/debug%s/%s", textdir, debugname); + + if (!debug_file_exists(debugpath, crc)) { + free(textdir); + return FALSE; + } + } + } + + free(textdir); + + return TRUE; + } + + static Elfinfo * + open_debug_file(const char *debugpath) + { + int fd; + const Elfops *elops; + Elf_Ehdr *hdr; + Elfinfo *el; + + if ((fd = open(debugpath, O_RDONLY)) < 0) + return NULL; + + if (!check_elf_ident(debugpath, fd, (off_t)0, "debug", &elops)) + return NULL; + + if (!elf_read_header(elops, debugpath, fd, (off_t)0, &hdr)) + return NULL; + + if (!prepare_to_parse_elf_file(debugpath, fd, hdr, elops, &el, (off_t)0)) { + free(hdr); + return NULL; + } + + free(hdr); + + return el; + } + bool elf_get_exec_info(const char *textpath, int fd, Libdep *libdep, *************** *** 272,275 **** --- 424,428 ---- Elf_Shdr *textsh; Elf_Shdr *symsh, *symstrsh, *indexsh, *indexstrsh; + Elf_Shdr *debuglinksh; Elfinfo *el; const char *symtab_secname; *************** *** 327,338 **** } #if WANT_DWARF ! if (elf_lookup_section(el, ".debug_info", &dwarfsh)) { *p_st_is = ST_DWARF; symsh = symstrsh = NULL; } else #endif ! if (elf_lookup_section(el, ".stab", &symsh)) { ! if (!elf_lookup_section(el, ".stabstr", &symstrsh)) { errf("Found .stab section in %s but no " ".stabstr strings section for it", el->path); --- 480,514 ---- } + if (elf_lookup_section(el, ".gnu_debuglink", &debuglinksh)) { + char *debuglink = e_malloc(elf_section_size(el, debuglinksh)); + + if (read_chunk(textpath, Elfwhat, fd, "debug file name", + elf_section_offset(el, debuglinksh), debuglink, + elf_section_size(el, debuglinksh))) { + int crc_offset; + unsigned long crc; + char debugpath[256]; + + crc_offset = strlen(debuglink) + 1; + crc_offset = (crc_offset + 3) & ~3; + + crc = *(unsigned int *)(debuglink + crc_offset); + + if (find_debug_file(textpath, debuglink, crc, debugpath)) { + el->debugel = open_debug_file(debugpath); + } + } + + free(debuglink); + } + #if WANT_DWARF ! if (elf_lookup_section(el->debugel, ".debug_info", &dwarfsh)) { *p_st_is = ST_DWARF; symsh = symstrsh = NULL; } else #endif ! if (elf_lookup_section(el->debugel, ".stab", &symsh)) { ! if (!elf_lookup_section(el->debugel, ".stabstr", &symstrsh)) { errf("Found .stab section in %s but no " ".stabstr strings section for it", el->path); *************** *** 348,353 **** } ! if (elf_lookup_section(el, ".stab.index", &indexsh)) { ! if (!elf_lookup_section(el, ".stab.indexstr", &indexstrsh)) { errf("Found .stab.index section in %s but no " ".stab.indexstr strings section for it", el->path); --- 524,529 ---- } ! if (elf_lookup_section(el->debugel, ".stab.index", &indexsh)) { ! if (!elf_lookup_section(el->debugel, ".stab.indexstr", &indexstrsh)) { errf("Found .stab.index section in %s but no " ".stab.indexstr strings section for it", el->path); *************** *** 398,404 **** #endif if (*p_st_is == ST_STABS) { ! ex->file_syms_offset = elf_section_offset(el, symsh); ! ex->nsyms = elf_section_entries(el, symsh); ! ex->file_symstrings_offset = elf_section_offset(el, symstrsh); } else { --- 574,580 ---- #endif if (*p_st_is == ST_STABS) { ! ex->file_syms_offset = elf_section_offset(el->debugel, symsh); ! ex->nsyms = elf_section_entries(el->debugel, symsh); ! ex->file_symstrings_offset = elf_section_offset(el->debugel, symstrsh); } else { *************** *** 418,421 **** --- 594,602 ---- free_elfinfo(Elfinfo *el) { + if (el->debugel != el) { + close(el->debugel->fd); + free_elfinfo(el->debugel); + } + alloc_free_pool(el->apool); } Index: ao_elfsym.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_elfsym.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** ao_elfsym.c 16 Feb 2004 13:02:00 -0000 1.11 --- ao_elfsym.c 19 Feb 2004 12:48:39 -0000 1.12 *************** *** 980,984 **** #if WANT_DWARF if (st_is == ST_DWARF) { ! if ((rv = dwarf_init(fd, DW_DLC_READ, NULL, NULL, &dw_dbg, &dw_err) == DW_DLV_ERROR)) { dwf_fatal_error("dwarf_init", rv, NULL, dw_err); --- 980,984 ---- #if WANT_DWARF if (st_is == ST_DWARF) { ! if ((rv = dwarf_init(el->debugel->fd, DW_DLC_READ, NULL, NULL, &dw_dbg, &dw_err) == DW_DLV_ERROR)) { dwf_fatal_error("dwarf_init", rv, NULL, dw_err); Index: ao_elfpriv.h =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_elfpriv.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ao_elfpriv.h 16 Feb 2004 13:01:59 -0000 1.2 --- ao_elfpriv.h 19 Feb 2004 12:48:39 -0000 1.3 *************** *** 77,80 **** --- 77,82 ---- Elf_Shdr *pltsh; + + struct Elfinfo *debugel; }; |
From: <th...@us...> - 2004-02-18 15:44:02
|
Update of /cvsroot/ups/ups/ups In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30518 Modified Files: ao_target.c Log Message: Make calls to target functions from interpreted code work in x86-64 platforms. Index: ao_target.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_target.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** ao_target.c 16 Feb 2004 13:02:00 -0000 1.11 --- ao_target.c 18 Feb 2004 15:34:20 -0000 1.12 *************** *** 1003,1006 **** --- 1003,1010 ---- #endif + #ifdef ARCH_386_64 + #define N_REG_ARGS 6 + #endif + #ifdef ARCH_SUN4 #define N_REG_ARGS 6 *************** *** 1021,1024 **** --- 1025,1032 ---- #endif + #ifdef ARCH_386_64 + static const int argregs[N_REG_ARGS] = { 5, 4, 1, 2, 8, 9 }; + #endif + /* Call a function in the target. * *************** *** 1076,1079 **** --- 1084,1088 ---- breakpoint_t *bp; taddr_t realargs[40]; + int wordsize; if (nargs > sizeof realargs / sizeof *realargs) *************** *** 1083,1086 **** --- 1092,1096 ---- ip = GET_IPROC(xp); + wordsize = xp_get_addrsize(xp) / 8; #if defined(ARCH_SUN4) && !defined(OS_SUNOS_5) *************** *** 1241,1249 **** */ if (nargs < N_REG_ARGS || nargs % 2 == 0) ! sp -= 4; #endif for (i = nargs - 1; i >= N_REG_ARGS; --i) { ! sp -= 4; ! if (ps_write_data(ip, sp, (char *)&realargs[i], 4) != 0) { *p_mesg = "Can't write argument to the stack"; return -1; --- 1251,1259 ---- */ if (nargs < N_REG_ARGS || nargs % 2 == 0) ! sp -= wordsize; #endif for (i = nargs - 1; i >= N_REG_ARGS; --i) { ! sp -= wordsize; ! if (ps_write_data(ip, sp, (char *)&realargs[i], wordsize) != 0) { *p_mesg = "Can't write argument to the stack"; return -1; *************** *** 1260,1264 **** /* Push the arg count. */ ! sp -= 4; if (ps_write_data(ip, sp, (char *)&nargs, sizeof(nargs)) != 0) { *p_mesg = "Can't write the arg count to the stack"; --- 1270,1274 ---- /* Push the arg count. */ ! sp -= wordsize; if (ps_write_data(ip, sp, (char *)&nargs, sizeof(nargs)) != 0) { *p_mesg = "Can't write the arg count to the stack"; *************** *** 1275,1280 **** regval = xp_getreg(xp, i); ! sp -= 4; ! if (ps_write_data(ip, sp, (char *)®val, 4) != 0) { *p_mesg = "Can't push register value"; return -1; --- 1285,1290 ---- regval = xp_getreg(xp, i); ! sp -= wordsize; ! if (ps_write_data(ip, sp, (char *)®val, wordsize) != 0) { *p_mesg = "Can't push register value"; return -1; *************** *** 1303,1309 **** } #endif /* ARCH_VAX */ ! #if defined(ARCH_SUN3) || defined(ARCH_CLIPPER) || \ ! defined(ARCH_BSDI386) || defined(ARCH_LINUX386) || defined(ARCH_SOLARIS386) ! sp -= 4; if (ps_write_data(ip, sp, (char *)&retpc, sizeof(retpc)) != 0) { *p_mesg = "Can't push return address"; --- 1313,1318 ---- } #endif /* ARCH_VAX */ ! #if defined(ARCH_386) || defined(ARCH_CLIPPER) ! sp -= wordsize; if (ps_write_data(ip, sp, (char *)&retpc, sizeof(retpc)) != 0) { *p_mesg = "Can't push return address"; *************** *** 1337,1344 **** ps_setreg(ip, UPSREG_SP, sp); #endif /* ARCH_VAX */ ! #if defined(ARCH_SUN3) || defined(ARCH_BSDI386) || \ ! defined(ARCH_LINUX386) || defined(ARCH_SOLARIS386) ps_setreg(ip, UPSREG_SP, sp); #endif #ifdef ARCH_MIPS /* The first four integer arguments go in registers, but there --- 1346,1364 ---- ps_setreg(ip, UPSREG_SP, sp); #endif /* ARCH_VAX */ ! #if defined(ARCH_386) ps_setreg(ip, UPSREG_SP, sp); #endif + #ifdef ARCH_386_64 + /* The first six integer argument go in registers, with no + * space allocated for them on the stack. + * + * BUG: we assume that all the arguments are integer (not + * floating point). + */ + for (i = 0; i < nargs && i < N_REG_ARGS; ++i) { + if (ps_setreg(ip, argregs[i], realargs[i]) != 0) + panic("regno write failed in cf"); + } + #endif #ifdef ARCH_MIPS /* The first four integer arguments go in registers, but there *************** *** 1348,1352 **** * floating point). */ ! sp -= N_REG_ARGS * 4; if (ps_setreg(ip, MIPS_SP_REGNO, sp) != 0) { *p_mesg = "Can't set stack pointer for target function call"; --- 1368,1372 ---- * floating point). */ ! sp -= N_REG_ARGS * wordsize; if (ps_setreg(ip, MIPS_SP_REGNO, sp) != 0) { *p_mesg = "Can't set stack pointer for target function call"; *************** *** 1410,1414 **** *p_res = xp_getreg(xp, RETURN_REGNO); ! #ifdef ARCH_386 if (restype == TY_LONGLONG || restype == TY_ULONGLONG) p_res[1] = xp_getreg(xp, 2); --- 1430,1434 ---- *p_res = xp_getreg(xp, RETURN_REGNO); ! #if defined(ARCH_386) && !defined(ARCH_386_64) if (restype == TY_LONGLONG || restype == TY_ULONGLONG) p_res[1] = xp_getreg(xp, 2); |
From: <th...@us...> - 2004-02-18 15:16:18
|
Update of /cvsroot/ups/ups/ups In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24876 Modified Files: ao_pt_uarea.c ao_ptrace.c ao_ptrace.h wp.c Log Message: Made watchpoints work on x86-64 platforms, including taking advantage of the new support for eight byte hardware watchpoints. Index: ao_pt_uarea.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_pt_uarea.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ao_pt_uarea.c 16 Feb 2004 13:02:00 -0000 1.6 --- ao_pt_uarea.c 18 Feb 2004 15:06:39 -0000 1.7 *************** *** 385,389 **** ur = ip->ip_ptrace_info->uregs + ri; errno = 0; ! e_ptrace(PTRACE_POKEUSER, ip->ip_pid, (char *)(int)ur->ur_uaddr, (int)value); ur->ur_is_current = FALSE; return (errno == 0) ? 0 : -1; --- 385,389 ---- ur = ip->ip_ptrace_info->uregs + ri; errno = 0; ! e_ptrace(PTRACE_POKEUSER, ip->ip_pid, (char *)(int)ur->ur_uaddr, (long)value); ur->ur_is_current = FALSE; return (errno == 0) ? 0 : -1; *************** *** 608,612 **** ur = ip->ip_ptrace_info->udregs + ri; errno = 0; ! e_ptrace(PTRACE_POKEUSER, ip->ip_pid, (char *)(long)ur->ur_uaddr, (int)value); ur->ur_is_current = FALSE; return (errno == 0) ? 0 : -1; --- 608,612 ---- ur = ip->ip_ptrace_info->udregs + ri; errno = 0; ! e_ptrace(PTRACE_POKEUSER, ip->ip_pid, (char *)(long)ur->ur_uaddr, (long)value); ur->ur_is_current = FALSE; return (errno == 0) ? 0 : -1; Index: ao_ptrace.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_ptrace.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ao_ptrace.c 16 Feb 2004 14:04:59 -0000 1.7 --- ao_ptrace.c 18 Feb 2004 15:06:39 -0000 1.8 *************** *** 855,861 **** taddr_t control; unsigned flags; ! int i, watchnum; if (size == 8) { if ((watchnum = ptrace_install_watchpoint(ip, addr, 4)) < 0) return -1; --- 855,867 ---- taddr_t control; unsigned flags; ! int i; ! ! if (size > 8 || (size & (size - 1)) != 0 || addr % size != 0) ! return -1; + #ifndef ARCH_386_64 if (size == 8) { + int watchnum; + if ((watchnum = ptrace_install_watchpoint(ip, addr, 4)) < 0) return -1; *************** *** 871,877 **** return 0; } ! ! if (size == 3 || size > 4 || addr % size != 0) ! return -1; #if HAVE_I386_SET_WATCH --- 877,881 ---- return 0; } ! #endif #if HAVE_I386_SET_WATCH *************** *** 906,909 **** --- 910,918 ---- flags = DR_LEN_4 | DR_RW_WRITE; break; + #ifdef ARCH_386_64 + case 8: + flags = DR_LEN_8 | DR_RW_WRITE; + break; + #endif default: panic("invalid watchpoint size"); *************** *** 938,941 **** --- 947,954 ---- int i; + if (size > 8 || (size & (size - 1)) != 0 || addr % size != 0) + return -1; + + #ifndef ARCH_386_64 if (size == 8) { if (ptrace_uninstall_watchpoint(ip, addr, 4, watchnum) < 0) *************** *** 945,951 **** return 0; } ! ! if (size == 3 || size > 4 || addr % size != 0) ! return -1; #if HAVE_I386_CLR_WATCH --- 958,962 ---- return 0; } ! #endif #if HAVE_I386_CLR_WATCH *************** *** 969,972 **** --- 980,988 ---- flags = DR_LEN_4 | DR_RW_WRITE; break; + #ifdef ARCH_386_64 + case 8: + flags = DR_LEN_8 | DR_RW_WRITE; + break; + #endif default: panic("invalid watchpoint size"); *************** *** 1033,1037 **** int pid; char *addr; ! int data; { int res; --- 1049,1053 ---- int pid; char *addr; ! long data; { int res; Index: ao_ptrace.h =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_ptrace.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ao_ptrace.h 16 Feb 2004 13:02:00 -0000 1.6 --- ao_ptrace.h 18 Feb 2004 15:06:40 -0000 1.7 *************** *** 171,175 **** int ptrace_update_regs PROTO((target_t *xp)); int ptrace_update_dregs PROTO((target_t *xp)); ! int e_ptrace PROTO((ptracereq_t req, int pid, char *addr, int data)); --- 171,175 ---- int ptrace_update_regs PROTO((target_t *xp)); int ptrace_update_dregs PROTO((target_t *xp)); ! int e_ptrace PROTO((ptracereq_t req, int pid, char *addr, long data)); Index: wp.c =================================================================== RCS file: /cvsroot/ups/ups/ups/wp.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** wp.c 4 Nov 2002 14:56:20 -0000 1.2 --- wp.c 18 Feb 2004 15:06:40 -0000 1.3 *************** *** 203,210 **** if (xp_read_data(xp, wp->wp_addr, buf, wp->wp_size) < 0) { ! errf("Bad watch area 0x%x", wp->wp_addr); } else if (memcmp(buf, wp->wp_val, wp->wp_size) != 0) { ! errf("Watch area at 0x%x has changed", wp->wp_addr); return wp; } --- 203,210 ---- if (xp_read_data(xp, wp->wp_addr, buf, wp->wp_size) < 0) { ! errf("Bad watch area 0x%lx", wp->wp_addr); } else if (memcmp(buf, wp->wp_val, wp->wp_size) != 0) { ! errf("Watch area at 0x%lx has changed", wp->wp_addr); return wp; } |
From: <th...@us...> - 2004-02-18 11:32:37
|
Update of /cvsroot/ups/ups/ups In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15528 Modified Files: xc_machine.h Log Message: Fix the other instance of my stupid typo... Index: xc_machine.h =================================================================== RCS file: /cvsroot/ups/ups/ups/xc_machine.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** xc_machine.h 18 Feb 2004 11:04:22 -0000 1.4 --- xc_machine.h 18 Feb 2004 11:23:07 -0000 1.5 *************** *** 207,211 **** #define GETLONG(pc) (UBYTE(*(pc)) | UBYTE((pc)[1] << 8) | \ UBYTE((pc)[2] << 16) | UBYTE((pc)[3] << 24)) ! #if SIZEOF_LONG > 8 #define GETQUAD(pc) (UBYTE(*(pc)) | UBYTE((pc)[1] << 8) | \ UBYTE((pc)[2] << 16) | UBYTE((pc)[3] << 24) | \ --- 207,211 ---- #define GETLONG(pc) (UBYTE(*(pc)) | UBYTE((pc)[1] << 8) | \ UBYTE((pc)[2] << 16) | UBYTE((pc)[3] << 24)) ! #if SIZEOF_LONG > 4 #define GETQUAD(pc) (UBYTE(*(pc)) | UBYTE((pc)[1] << 8) | \ UBYTE((pc)[2] << 16) | UBYTE((pc)[3] << 24) | \ |
From: <th...@us...> - 2004-02-18 11:20:04
|
Update of /cvsroot/ups/ups/ups In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13236 Modified Files: ci_opcodes.c Log Message: Fix stupid typo. Index: ci_opcodes.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ci_opcodes.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ci_opcodes.c 18 Feb 2004 11:04:22 -0000 1.6 --- ci_opcodes.c 18 Feb 2004 11:10:34 -0000 1.7 *************** *** 131,135 **** long q; { ! #if SIZEOF_LONG > 8 ci_code_long(tx, q & 0xffffffff); ci_code_long(tx, (q >> 32) & 0xffffffff); --- 131,135 ---- long q; { ! #if SIZEOF_LONG > 4 ci_code_long(tx, q & 0xffffffff); ci_code_long(tx, (q >> 32) & 0xffffffff); |