You can subscribe to this list here.
| 2001 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
(4) |
Jun
(5) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
|
| 2005 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(3) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Robert L. <ro...@sc...> - 2006-07-12 19:20:34
|
Kilau, Scott wrote: > fprintf(stderr, "Sorry, no mmap support on this target\n"); Committed. Thanx. It's interesting that 10 downloads this week puts KME into the 93'rd percentile of most active projects on sourceforge... RJL |
|
From: Kilau, S. <Sco...@di...> - 2006-07-12 15:56:13
|
Oops, obviously I meant:
=20
Which is:
=20
#if !HAVE_MMAP
fprintf("Sorry, no mmap support on this target\n");
exit(1);
#endif
=20
Which should be changed to:
=20
fprintf(stderr, "Sorry, no mmap support on this target\n");
=20
Scott
=20
=20
-----Original Message-----
From: kme...@li...
[mailto:kme...@li...] On Behalf Of Kilau,
Scott
Sent: Wednesday, July 12, 2006 10:45 AM
To: kme...@li...
Subject: [Kme-misc] Quick change/patch
=09
=09
Hi everyone,
=20
I am compiling kme under CYGWIN, and get this error:
=20
gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -c kmed.c
kmed.c: In function `coreinfo':
kmed.c:148: warning: passing arg 1 of `fprintf' from
incompatible pointer type
kmed.c:148: error: too few arguments to function `fprintf'
make[1]: *** [kmed.o] Error 1
=20
=20
Which is:
=20
#if !HAVE_MMAP
fprintf(stderr, "Sorry, no mmap support on this
target\n");
exit(1);
#endif
=20
Quick change to:
=20
=09
fprintf(stderr, "Sorry, no mmap support on this
target\n");
=20
=20
Of course, this doesn't bode well that I get into that #if ...
Hopefully KME under CYGWIN will work assuming the driver has the
needed ioctls, (which is does).
=20
Scott
=20
|
|
From: Kilau, S. <Sco...@di...> - 2006-07-12 15:45:11
|
Hi everyone,
=20
I am compiling kme under CYGWIN, and get this error:
=20
gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -c kmed.c
kmed.c: In function `coreinfo':
kmed.c:148: warning: passing arg 1 of `fprintf' from incompatible
pointer type
kmed.c:148: error: too few arguments to function `fprintf'
make[1]: *** [kmed.o] Error 1
=20
=20
Which is:
=20
#if !HAVE_MMAP
fprintf(stderr, "Sorry, no mmap support on this
target\n");
exit(1);
#endif
=20
Quick change to:
=20
fprintf(stderr, "Sorry, no mmap support on this
target\n");
=20
=20
Of course, this doesn't bode well that I get into that #if ...
Hopefully KME under CYGWIN will work assuming the driver has the needed
ioctls, (which is does).
=20
Scott
=20
|
|
From: Robert L. <rob...@us...> - 2005-01-15 04:51:37
|
I just had a problem report in KME that blossomed into a real pain in the neck. I autoconfiscated KME years ago and it worked swimmingly at the time. It turns out that automake/autoconf/autoheader and friends have changed in maddeningly (and from what I can tell, gratituously) incompatible ways and since most of us aren't using it on RedHat 5, and at least some of us were being chomped by problems, I updated it. I have just checked in a slew of fixes to try to bring it up to date. It now works as expected on FC2 (albeit with some warnings about autoconf headers that aren't ours and we don't even use) and FC3 and UW711. Merge conflicts on your next update are almost inevitable. Be prepared for a process vaguely resembling: make distclean rm -f config.h* config.status configure configure.ac acl* Makefile.in cvs up And then, if you don't have autoconf on your system, be prepared to touch aclocal.m4 Makefile.in configure config.h.in I should also confess that while I've gone to great pains to keep it as compatible with the old schemes by diffing the generated config.h's with the old and new schemd and **thinking** the new set of #defines is a superset of the old ones on a reasonably robus host, it's not beyond believe that your favorite header/library/support logic will get configured out now. If this happens, let me know and we'll work it through. When you're done, you will be rewarded with a 279KB shell script named "configure" that takes my system 13 seconds to run to set things to build a 155K executable in 2.5 seconds. I'm not amused. RJL |
|
From: Robert L. <rob...@us...> - 2005-01-11 05:17:54
|
Hello, KME groupies.
I have just committed two new features to KME.
The requirements were rather more involved than described here, but the
punchline is that there are two improvements now available to those
doing host-based debugging:
-I signal (which is most useful when combined with -P pid) tells KME
that when the program it's watching receives `signal' (which can be
specified either numerically or by name ("SIGHUP") that the target process
shall remain frozen, exactly one screen refresh will be done and then
the host screen will remain halted until a key is pressed, but the target
process will be resumed as quickly as it can.
I've informally called this "freeze frame" mode becuase I'm a child of
the 80's and kept hearing J. Geils band in my head while working on
this:
There were no defects to be found
Snap shot image froze without a sound
This feature lets you freeze an image of your running process to
locate potential defects without the subject you're stalking, err,
photographing being distracted by the sound of your shutter.
The goal for this is to allow non-intrusive monitoring of a mostly
realtime(ish) process. Just crank your update time down low (so
you aren't stopping and resuming the process 10x a second, as per
the default) and arrange the program to get a "magic" signal upon
interesting event either externally or via some kind of internal
instrumentation ala "kill(getpid(), SIGWINCH);".
Measurements of real-time turbulence -on a decidedly non-girly dual
processor system- show just under a millisecond of smacking the process
around with ptrace and thrashing the scheduler before it's resumed
with 10Ms being possible with fairly contrived (dozens of lines with
hundreds of display entries in an 170x56 xterm over a network) kme
displays. If you're attempting real-time and using KME in this mode
over non-deterministice protocols like, say, remote C/X over a lossy
sync link or GDB protocols you deserve the punishment you are likely to
get.
kme -I SIGWINCH -n tp -P 22887 -u 300
will stop the program currently running on PID 22887, using the symbol
table from 'tp' every 30 seconds (whether it needs it or not) and
refresh the screen and resume the target. Additionally, if the program
receives a SIGWINCH, the KME screen will be refreshed once immediately
(in my testing, I was able to get a max of two opcodes past the call
to signal, though I could probably squeak a few more in by tinkering
with system load and scheduling just due to the asynch nature of UNIX
signals) with that screen remaining frozen until I press a key.
-C corefile (yes, I know we've already used that term in KME, but UNIX
gets "prior art" on this one) will read a coredump of a process. This
does require libelf -see the man page for hints on Fedora- but if you know
that /tmnp/core.3893 was created by the program /tmp/x,
kme -C /tmp/core.3893 -n /tmp/x
will let you examine the corefile that /tmp/x left before it died.
No pretense of supporting cross architecture corefiles is made. If you
have a system robust enough to capture an ELF corefile, you probably
have a system robust enough to run KME. :-) It would be possible to do
cross-architecture debugging of cross files (Linux/IA32 hosted, embedded
mips.
Enjoy this crunchy KME goodness. I'll probably make KME 2.1.0 within
the next day or two. (That's likely a non-event to this crowd since
you're running from CVS anyway...)
RJL
|
|
From: Robert L. <rob...@us...> - 2004-11-29 15:36:17
|
> Glad to hear you agree. It sure looks nicer that way. Do you think we > could consider making it default, and making people with old kme_defs > widen their screens a bit, or use -w8? I wouldn't have deep troubles with that. The person I can think of that's most likely to scream probably can't right now. I think that even Rick uses those newfangled resizable xterm-like substances these days, though. If you wanted to get froggy, add a version header (probably a crafted comment at the top) to the KME defs whose presence indicates that it's a "wide mode" kme_defs. When reading one of those kme_defs, it could adjust itself to use -w8. If we wanted to be less froggy, we could make it a 'configure' option. > Idea is that you can follow pointers. You pick the line you want to follow > pointers with "=". Then you find a pointer somewhere and type "*" over it. > Voilla! the marked line now displays the address under the "*". Aaah. Got it. Now that you mention it, I fell out of love with KME when I quit doing memory management staticly by hand and started chasing dynamically allocated pointers out of linked lists and such. Since my foo->bar->bletch->blah->blerf[23] thingies were all of different types, chasing them with KME was never very practical to recurse. > Yea, it breaks now on Linux. Never occurred to me at the time that anyone > would define constants with anything other than CPP, but Linux now uses > an enumeration for that, and the numbers are different than those in the I see. That's a reasonable reason to drop that crutch anyway. (enums over preprocessing have some advantages, but that's a different subject.) > Thought it was time to add some enhancements to get some buy-in with a > skeptical group. That's kind of how it went with my group of skeptics, too. > I had similar problems. I don't really understand automake all that well, > so I just typed "make clean" and ran it again, and it was okay. That's the ticket. Thanx. automake, configure, and friends have ruined a generation of programmers, but that's still another off-topic rant... RJL |
|
From: Gene O. <gen...@th...> - 2004-11-28 02:26:21
|
Robert, I am afraid my old habit of taking forever to answer email is still with me. Sorry about that.... On Mon, Nov 22, 2004 at 09:43:02AM -0600, Robert Lipe wrote: > > Hello, Gene. All is well here. I hope the world is treating you well. Hey, not bad. > I hope you don't mind that I moved this to the kme_misc list for the > benefit of the other KME groupies. Of course its fine! > > Also made the kme column width adjustable. Got some newbies to use it > > and they complain a lot. Width 9 looks *much* better with 32 bit and > > 64 bit quantities. > > I agree. Those things made sense in the old days when 32 bits were the > exception and we were all sitting in front of Wyse 60's for a living. Glad to hear you agree. It sure looks nicer that way. Do you think we could consider making it default, and making people with old kme_defs widen their screens a bit, or use -w8? > > Added a "*" and "=" command also. I'm intersted to see if the doco and > > the operation make sense to you. > > I'm still absorbing the morning coffee, but I can't say they do. Perhaps > an example (here or in the doc) would help. Idea is that you can follow pointers. You pick the line you want to follow pointers with "=". Then you find a pointer somewhere and type "*" over it. Voilla! the marked line now displays the address under the "*". We have some difficult programmers who really wanted that.... > Did you have a reason to nuke the block for: > > - * Compensate for lame systems that support ptrace, but > - * have no <sys/ptrace.h> > > Since I very rarely need KME on said lame system (and we've finally > fixed the stupid headers in the next version anyway) I'm not in a fizz > about it, but wondered if there was a problem. Yea, it breaks now on Linux. Never occurred to me at the time that anyone would define constants with anything other than CPP, but Linux now uses an enumeration for that, and the numbers are different than those in the defines. So now the defines override the enumeration, giving the wrong value. I had a real mental block about that.... > > Curious if you are still using this program and find the stuff useful. > > I use it from time to time. In my embedded days, I used to use it about > every day but don't need it as much any more. It's like any other tool > in the toolbox. It's good to have that circle cutter when you know you > really need a perfect circle cut, but it's not something I do every day > any longer. I use it every few years, it seems, but I am now working with an embedded project over at Xiotech, and it could add some real value to the debugging suite in use there. Thought it was time to add some enhancements to get some buy-in with a skeptical group. > What version of automake did you use? It doesn't seem to place > nice with FC2: > > $ make > cd . && automake --gnu Makefile > configure.in:3: your implementation of AM_INIT_AUTOMAKE comes from an > configure.in:3: old Automake version. You should recreate aclocal.m4 > configure.in:3: with aclocal and run automake again. > Makefile.am:19: `LDFLAGS' is a user variable, you should not override it; > Makefile.am:19: use `AM_LDFLAGS' instead. > $ rpm -qf $(which automake) > automake-1.8.3-1 I had similar problems. I don't really understand automake all that well, so I just typed "make clean" and ran it again, and it was okay. I could return my "fixed" (really just compiled) changes if you like... gene -------------------------- Gene Olson Technical Director ThinSoft Corporation voice: +1 612 414 4590 email: gen...@th... |
|
From: Robert L. <rob...@us...> - 2004-11-22 15:43:32
|
Gene Olson wrote: > Long time, no chat. World is different now. Hope you are well. Hello, Gene. All is well here. I hope the world is treating you well. > Been messing around with kme of late. I hope you don't mind that I moved this to the kme_misc list for the benefit of the other KME groupies. > Created a new kme_defs generator, then noticed you already had one :-( Yeah, but mine sucks. > I added mine anyway, since I like it. Generates kme_defs directly from > an elf binary, no intermediate steps, no source files, just compile the > binary with -g and go. Doco: "perldoc elf2kme" Yes, yours is definitely more ambitious. Thanx. > Also made the kme column width adjustable. Got some newbies to use it > and they complain a lot. Width 9 looks *much* better with 32 bit and > 64 bit quantities. I agree. Those things made sense in the old days when 32 bits were the exception and we were all sitting in front of Wyse 60's for a living. > Added a "*" and "=" command also. I'm intersted to see if the doco and > the operation make sense to you. I'm still absorbing the morning coffee, but I can't say they do. Perhaps an example (here or in the doc) would help. > Also fixed a bunch of minor bugs. Did you have a reason to nuke the block for: - * Compensate for lame systems that support ptrace, but - * have no <sys/ptrace.h> Since I very rarely need KME on said lame system (and we've finally fixed the stupid headers in the next version anyway) I'm not in a fizz about it, but wondered if there was a problem. > Curious if you are still using this program and find the stuff useful. I use it from time to time. In my embedded days, I used to use it about every day but don't need it as much any more. It's like any other tool in the toolbox. It's good to have that circle cutter when you know you really need a perfect circle cut, but it's not something I do every day any longer. > No doubt I added some bugs, don't have enough field test time in yet. Seems > to work in the tests I did with application programs. God bless CVS. Just by inspection, it seems to be in the game. What version of automake did you use? It doesn't seem to place nice with FC2: $ make cd . && automake --gnu Makefile configure.in:3: your implementation of AM_INIT_AUTOMAKE comes from an configure.in:3: old Automake version. You should recreate aclocal.m4 configure.in:3: with aclocal and run automake again. Makefile.am:19: `LDFLAGS' is a user variable, you should not override it; Makefile.am:19: use `AM_LDFLAGS' instead. $ rpm -qf $(which automake) automake-1.8.3-1 Thanx! RJL |
|
From: Robert L. <ro...@ca...> - 2002-05-10 16:34:05
|
Christoph Hellwig kindly volunteered to handle the mechanics of spinning a release (which I thoroughly hate to do) if I'd do the announcements. Sounded like a bargain at twice the price, so we did it. KME 2.0.1 is now officially released. Other than the version number and the NEWS files, it hasn't changed so if you've updated in the last quarter or two, don't expect to see anything different. From NEWS: NEWS - list of user-visible changes between releases of kme New in 2.0.1 - 2002-05-10: * Allow autogenerating RPM packages. * Display data addresses more sensibly on narrow screens. * Ported to Cygwin and Linux/IA64 support. * Support for Linux /proc/ksyms, Solaris /dev/kmem and UnixWare getksym(). * New display option <f> for floating point variables. * Improved network access code, made /etc/services unnecessary. * POSIX termios support. * New extension for displaying value/mask pairs. * Add support for 'long long' types. * Add support for 64-bit hosts. * Fixes for FreeBSD and HP-UX. * Misc. code cleanup. |
|
From: Robert L. <ro...@ca...> - 2002-04-01 17:23:14
|
Christoph has contributed patches to allow generatioon of distribution tarballs and RPMs to KME. I've committed those. Thanx, Christoph! RJL |
|
From: Robert L. <ro...@sc...> - 2001-06-11 04:50:34
|
> Doesn't build UW 7.1.1: Fixed by deleting the offending lines. Declaring system prototypes yourself is almost never the correct thing to do... Thanx, Scott. RJL |
|
From: Feldman, S. <sco...@in...> - 2001-06-10 23:36:35
|
I grabbed tot to build on Linux/IA-64, but thought I'd try it on Linux/IA-32 and Unixware/IA-32 first, and ran into a build issue. Does build on RH 7.1/2.4.2. Doesn't build UW 7.1.1: # make clean test -z "kme kmed" || rm -f kme kmed rm -f *.o core *.core # make cc -DHAVE_CONFIG_H -I. -I. -I. -g -c kme.c cc -DHAVE_CONFIG_H -I. -I. -I. -g -c vi.c UX:acomp: ERROR: "vi.c", line 75: identifier redeclared: malloc UX:acomp: ERROR: "vi.c", line 76: identifier redeclared: realloc make: *** [vi.o] Error 1 # -scott |
|
From: Robert L. <ro...@sc...> - 2001-06-08 18:37:23
|
I just built KME on one of the Caldera IA64 Linuxen. It worked pretty well, but I made some generic fixes to improve the portability anyway. In particular, I adjusted the "show me 64 bit address" mode to sort of mimic the decimal modes: If it's going to truncate the address to make it fit on an 80 column screen, prepend a "+" to let you know it's doing it. Of course, if you want all 64 bits displayed in the address, you have to resize your xterm to be wider than 80 columns. (I was impressed that SIGWINCHES were correctly propogated.) Big memory maps worked fine. The following are equivalent: ./kme -M 1=e000000004af62c0/l ./kme -M0xe000000000000000:0xffffffff 1=0000000004af62c0/l Inputs and base and all that sort of thing seem to work fine on the 64 bit addresses. Enjoy. RJL |
|
From: Robert L. <ro...@sc...> - 2001-06-03 23:54:29
|
I've been kicking this idea around in my head for about two years. Today I finally slung some code to implement it, but it's sorta funky. The problem is that silicon guys smoosh all sorts of unrelated things together in registers. KME will display that register easily enough. On simple parts, experienced programmers will 'just know' what the registers mean, but parts are getting complicated at the same time my memory is fading. I cabbaged together a KME plugin that hands a set of bytes to udi_vsnprintf(). This is sort of C89 sprintf with some added functions to handle symbolic names for bit fields. The full doc for it is at: http://uw7doc.sco.com/cgi-bin/man/man?udi%5Fsnprintf+3udi Most of it makes no sense at all for KME, but bit fields are nice. Start KME thusly: Starting program: /home/robertl/src/kme/./kme -c /tmp/blah -r -L udiprintf.so "1=0/!udiprintf/1%<0=odd,~0=even,4-7=Top Nybble,0-1=Bottom Two Bits:0=Zero:1=One:2=Two:3=Three,0-7=All>" The first byte (that's the "1" after udiprintf; we have to tell the formatter how many bytes to look at) of /tmp/blah contains an ASCII "2" for demonstration. It displays: 1| 0/!udiprintf/1%<0=odd,~0=even,4-7=Top Nybble,0-1=Bottom Two Bits:0=Zero 2| 000000 <even,Top Nybble=3,Bottom Two Bits=Two,All=32> 3| While this case is sort of boring, it shows how labels can be assigned to bits. If I had this while working on <code name for large chip project deleted> I would have been a much saner guy. Now the catch: I've been having problems with the nested parsers getting them to play nicely with things. It would be convenient to be able to define: !chip_thingy !udiprintf/4blahblah !udiprintf/4blahblah !udiprintf/4blahblah !udiprintf/4blahblah But this seems to run afoul of the rules about nesting long defs names. Rick, how effectively are you doing this with your dynamic extensions? I don't know that this is a show stopper. Is this worth cleaning up and tossing in? I did have to change the interface between the core code and the dynamic modules slightly, so it will break those (sorry) but we can't have that large of an installed base. In fact, given the errors I found in the sample, I'm guessing we don't have anyone but Rick doing it. ;-) It's not a small piece of code. I lifted it from the udi reference tree, but it's under BSD license, so that's OK. RJL |
|
From: Robert L. <ro...@sc...> - 2001-06-01 04:50:01
|
I think we've got the low hanging fruit in the bag. If you're on an architecture where a kme_addr_t can represent your address space, I think you're mostly home free on 64-bit architectures. So for UltraSparc with native compilers, this means "CC="cc -xarch=v9" ./configure" and it looks pretty good. Other 64 bit environments (I have no idea what AIX or Linux do on IA64, Sparc, MIPS, etc.) will probably also require some fanagling. I've now used KME to attach to a running v9 binary (which maps all data above 4G), read the symbol table, and successfully modified variables in a running program which is pretty good assurance that we aren't flagrantly tossing the upper bits any more. I don't even want to think about teaching it about PAE on IA32. Bug reports to the list, please. RJL |
|
From: Robert L. <ro...@sc...> - 2001-05-31 21:54:47
|
> > I have no doubt that the 64 bit addressing stuff has problems. All I > > can suggest is try it out and let us know about them... > > We tried KME on Linux/64 and it almost worked. 64-bit data seemed to be > displayed, 64-bit data was the stuff I committed earlier this week from Rick. > but entering a 64-bit address didn't work. It would chop off the > upper 32-bits. I *think* it was actually doing the right thing (at least it seems to on my UltraSparc when building in 64-bit mode) but the address was displayed incorrectly. I made it work mo' better today. So if you were looking at address abcd.abcd.1234.1234 it would actually read that address but display on the screen as '12341234'. Are things like the -M or 'b' base commands perfect? Probably not. Let me know. RJL |
|
From: Feldman, S. <sco...@in...> - 2001-05-31 21:43:22
|
Robert, > I have no doubt that the 64 bit addressing stuff has problems. All I > can suggest is try it out and let us know about them... We tried KME on Linux/64 and it almost worked. 64-bit data seemed to be displayed, but entering a 64-bit address didn't work. It would chop off the upper 32-bits. -scott |
|
From: Robert L. <ro...@sc...> - 2001-05-31 21:29:32
|
I just applied a tag to kme. If KME acts funny, revert to
'before64bitstuff'.
I put somewhat of a hurt on KME's internal data types. Even though
the "I know that a short is 16 bits and an int and a long are both
32 bits" lasted from 286 through 386, it just doesn't work on modern
architectures. Work with KME on sparcv9 and watch it combust.
I tried to separate things up internally and used fixed types when
they're available on the host (courtesy C99; tested on UW7, Solaris
8, RH 7.1) with fallbacks to the old definitions when they're not
(i.e. OpenServer without the current UDK installed, Stun/OS, etc.)
I started down the road of making an 'addr_t' represent any internal
address and a 'data_t' representing any internal data, but I weenied out
before getting that over the finish line. Maybe some other day when
kernel compiles are slow I'll get back to it...
I also added an optional display mode (see RJL64 in the code) that
allows all 64 physical address bits to be displayed if you're into that
sort of thing. It pretty well lays an 80 column screen to waste so I
need to come up with some clever way of autosensing that. (Or accepting
that people debugging 64-bit systems aren't doing it on a wyse 30.)
I have no doubt that the 64 bit addressing stuff has problems. All I
can suggest is try it out and let us know about them...
RJL
? a.out
? xx
? q
Index: config.h.in
===================================================================
RCS file: /cvsroot/kme/kme/config.h.in,v
retrieving revision 1.7
diff -c -5 -p -u -r1.7 config.h.in
--- config.h.in 2001/05/31 17:41:33 1.7
+++ config.h.in 2001/05/31 21:21:43
@@ -46,10 +46,13 @@
#undef HAVE_FCNTL_H
/* Define if you have the <getopt.h> header file. */
#undef HAVE_GETOPT_H
+/* Define if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
/* Define if you have the <libelf/nlist.h> header file. */
#undef HAVE_LIBELF_NLIST_H
/* Define if you have the <nlist.h> header file. */
#undef HAVE_NLIST_H
Index: configure
===================================================================
RCS file: /cvsroot/kme/kme/configure,v
retrieving revision 1.6
diff -c -5 -p -u -r1.6 configure
--- configure 2001/05/30 19:53:17 1.6
+++ configure 2001/05/31 21:21:45
@@ -1560,11 +1560,11 @@ if test $ac_cv_header_stdc = yes; then
#define STDC_HEADERS 1
EOF
fi
-for ac_hdr in libelf/nlist.h nlist.h elf.h getopt.h string.h strings.h fcntl.h stropts.h sys/ksym.h sys/ptrace.h sys/time.h stdlib.h termio.h termios.h unistd.h wait.h
+for ac_hdr in libelf/nlist.h nlist.h elf.h getopt.h inttypes.h string.h strings.h fcntl.h stropts.h sys/ksym.h sys/ptrace.h sys/time.h stdlib.h termio.h termios.h unistd.h wait.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:1570: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
Index: configure.in
===================================================================
RCS file: /cvsroot/kme/kme/configure.in,v
retrieving revision 1.7
diff -c -5 -p -u -r1.7 configure.in
--- configure.in 2001/05/30 19:51:40 1.7
+++ configure.in 2001/05/31 21:21:45
@@ -21,11 +21,11 @@ case "$LIBS" in
*) AC_CHECK_LIB(curses, initscr);;
esac
dnl Checks for header files.
AC_HEADER_STDC
-AC_CHECK_HEADERS(libelf/nlist.h nlist.h elf.h getopt.h string.h strings.h fcntl.h stropts.h sys/ksym.h sys/ptrace.h sys/time.h stdlib.h termio.h termios.h unistd.h wait.h)
+AC_CHECK_HEADERS(libelf/nlist.h nlist.h elf.h getopt.h string.h strings.h fcntl.h stropts.h sys/ksym.h sys/ptrace.h sys/time.h stdlib.h termio.h termios.h unistd.h wait.h inttypes.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_OFF_T
AC_HEADER_TIME
AC_MSG_CHECKING(for long long support in compiler)
Index: kme.c
===================================================================
RCS file: /cvsroot/kme/kme/kme.c,v
retrieving revision 1.11
diff -c -5 -p -u -r1.11 kme.c
--- kme.c 2001/05/30 19:51:40 1.11
+++ kme.c 2001/05/31 21:21:48
@@ -1,5 +1,6 @@
+#define RJL64 0
/*
* Kernel Memory Editor (KME)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -123,21 +124,46 @@ it's useful.
#if HAVE_LIBDL
# include <dlfcn.h>
#endif
+#if HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+
+/*
+ * Now try to set up internal typedefs for things that *have* to be
+ * a fixed size. Use the C99 types if we can.
+ */
+#if HAVE_INTTYPES_H
+typedef uint8_t kme_uint8_t ;
+typedef uint16_t kme_uint16_t;
+typedef uint32_t kme_uint32_t;
+typedef uint64_t kme_uint64_t;
+#else
+typedef unsigned char kme_uint8_t ;
+typedef unsigned short kme_uint16_t;
+typedef unsigned long kme_uint32_t;
+ #if CC_HAS_LONG_LONG
+ typedef unsigned long long kme_uint64_t;
+ #endif
+#endif
+
+
/*
* Unsigned variables. This form makes them impervious
* to similar defs in sys/types.h.
*/
#define uchar unsigned char
-#define ushort unsigned short
#define ulong unsigned long
-#if CC_HAS_LONG_LONG
-#define uquad unsigned long long
-#endif
+
+/*
+ * This is the (currently incorrect) type of all target addresses
+ * used internally.
+ */
+typedef ulong addr_t;
#if HAVE_SOCKET
#if HAVE_STROPTS_H
# include <stropts.h>
#endif /* HAVE_STROPTS_H */
@@ -224,11 +250,11 @@ typedef struct
char* a_disp; /* Display string */
int a_size; /* Number of bytes */
int a_grow; /* Automatically unobscure itself */
} a_field;
-ulong addr_mask = -1UL; /* All addresses read from a symbol
+addr_t addr_mask = -1UL; /* All addresses read from a symbol
file are masked with this */
#define NADR 400 /* Max number of addresses */
a_field afield[NADR]; /* Address fields */
a_field bfield[NADR]; /* Address buffer */
@@ -237,11 +263,11 @@ a_field bfield[NADR]; /* Address buffe
* Data field definition.
*/
typedef struct
{
- ulong d_addr; /* Address */
+ addr_t d_addr; /* Address */
int d_type; /* Type */
} d_field;
#define NDATA (66 * 12) /* Max number of data columns */
@@ -252,11 +278,15 @@ d_field dfield[NDATA]; /* Column field
/*
* Field row/column positioning.
*/
#define FROW(r) ((r) - frow)
+#if RJL64
+#define FCOL(c) ((c) ? (8 * (c) + 15) : 5)
+#else
#define FCOL(c) ((c) ? (8 * (c) + 7) : 5)
+#endif
int initial_display_row; /* To track order of automatic
insertions */
/*
@@ -408,11 +438,11 @@ char keyformat[26]; /* Format entered
typedef struct
{
char * name; /* Name entered from command or kbd */
char * format; /* Display formatting strings */
- char *(*dlfunc)(ulong *addrp, int dlarg); /* Function */
+ char *(*dlfunc)(addr_t *addrp, int dlarg); /* Function */
int dlarg; /* User defined function argument */
} d_fmt;
int fmt_cnt;
int dl_fmt_cnt;
@@ -430,26 +460,26 @@ char hexnum[] = "0123456789abcdefghijklm
* Core memory access.
*/
char *coredev; /* Core file parameter */
-ulong base; /* Base address */
-ulong addr; /* Memory address being displayed */
-ulong faddr; /* First address this display item */
+addr_t base; /* Base address */
+addr_t addr; /* Memory address being displayed */
+addr_t faddr; /* First address this display item */
int lboard; /* Last board number */
int lconc; /* Last conc number */
-ulong laddr; /* Low read address */
-ulong haddr; /* High read address */
+addr_t laddr; /* Low read address */
+addr_t haddr; /* High read address */
int memfd; /* Core file descriptor */
long mem[128]; /* Memory array */
#if HAVE_MMAP
-ulong mempa; /* Memory phys addr */
-ulong memlen; /* Memory length */
+addr_t mempa; /* Memory phys addr */
+addr_t memlen; /* Memory length */
uchar *memva; /* Virtual address */
#endif
#define ALIGNED(ADDR,BYTES) (! (((int) ADDR) & (BYTES-1)))
@@ -499,20 +529,20 @@ int bigendian()
/************************************************************************
* swaps - Swap short operand.
************************************************************************/
-ushort
-always_swaps(ushort mval)
+kme_uint16_t
+always_swaps(kme_uint16_t mval)
{
mval = (((mval >> 8) & 0xff) | ((mval << 8) & 0xff00));
return (mval);
}
-ushort
-swaps(ushort mval)
+kme_uint16_t
+swaps(kme_uint16_t mval)
{
if (swapflag)
{
mval = always_swaps(mval);
}
@@ -523,23 +553,23 @@ swaps(ushort mval)
/************************************************************************
* swapl - Swap long operand.
************************************************************************/
-ulong
-always_swapl(ulong mval)
+kme_uint32_t
+always_swapl(kme_uint32_t mval)
{
mval = (((mval >> 24) & 0x000000ff) |
((mval >> 8) & 0x0000ff00) |
((mval << 8) & 0x00ff0000) |
((mval << 24) & 0xff000000));
return(mval);
}
-ulong
-swapl(ulong mval)
+kme_uint32_t
+swapl(kme_uint32_t mval)
{
if (swapflag)
mval = always_swapl(mval);
return (mval);
@@ -548,12 +578,12 @@ swapl(ulong mval)
#if CC_HAS_LONG_LONG
/************************************************************************
* swapq - Swap quadword operand.
************************************************************************/
-uquad
-always_swapq(uquad mval)
+kme_uint64_t
+always_swapq(kme_uint64_t mval)
{
mval = ( ((mval & 0x00000000000000ffULL) << 56) |
((mval & 0x000000000000ff00ULL) << 40) |
((mval & 0x0000000000ff0000ULL) << 24) |
@@ -566,12 +596,12 @@ always_swapq(uquad mval)
return(mval);
}
-uquad
-swapq(uquad mval)
+kme_uint64_t
+swapq(kme_uint64_t mval)
{
if (swapflag)
mval = always_swapq(mval);
return (mval);
@@ -637,11 +667,11 @@ find_format(char* s)
* FIXME: should build hash table (index?) hinted at above...
************************************************************************/
void
add_format(char *name, char *format,
- char * (*dlfunc)(ulong *addrp, int dlarg), int dlarg)
+ char * (*dlfunc)(addr_t *addrp, int dlarg), int dlarg)
{
dfmt[fmt_cnt].name = stralloc(name);
dfmt[fmt_cnt].format = format ? stralloc(format) : NULL;
dfmt[fmt_cnt].dlfunc = dlfunc;
dfmt[fmt_cnt].dlarg = dlarg;
@@ -676,11 +706,10 @@ getbase(char* s, ulong* value, int b)
/* Handle float */
if (b == -4)
{
float f;
- char c;
char *ss = s;
while ('0' <= *s && *s <= '9')
s++;
@@ -1498,11 +1527,10 @@ getmem(unsigned nbyte)
*/
if (pid)
{
int buf[2];
- int i;
#if 0
fprintf(stderr, "read(%d, %x, %d)\n", pid, a, nbyte);
#endif
@@ -1714,11 +1742,11 @@ void setup()
*/
while (crow <= orow && crow < erow)
{
initline();
- printw("%06x", addr / addrscale);
+ printw("%06lx", addr / addrscale);
}
/*
* Position to the next field, and determine if it is
* on the screen.
@@ -1935,13 +1963,13 @@ void display(char* fp)
if (!getmem(width))
*(ulong *) mem = 0;
switch (width)
{
- case 1: temp[count] = *(uchar *) mem; break;
- case 2: temp[count] = *(ushort *) mem; break;
- case 4: temp[count] = *(ulong *) mem; break;
+ case 1: temp[count] = *(kme_uint8_t *) mem; break;
+ case 2: temp[count] = *(kme_uint16_t *) mem; break;
+ case 4: temp[count] = *(kme_uint32_t *) mem; break;
}
break;
/*
* Set width parameter (Used by &, ^)
@@ -2070,77 +2098,77 @@ void display(char* fp)
/* ASCII */
case 'a':
if (onscreen)
{
- if (!getmem(sizeof(uchar)))
+ if (!getmem(sizeof(kme_uint8_t)))
printw("??");
else
{
- printchar((int)*(uchar *)mem & 0x7f);
+ printchar((int)*(kme_uint8_t *)mem & 0x7f);
}
}
- addr += sizeof(uchar);
+ addr += sizeof(kme_uint8_t);
break;
/* Hex byte */
case 'b':
if (onscreen)
{
- if (!getmem(sizeof(uchar)))
+ if (!getmem(sizeof(kme_uint8_t)))
printw("??");
else
- printw("%02x", *(uchar *)mem);
+ printw("%02x", *(kme_uint8_t *)mem);
}
- addr += sizeof(uchar);
+ addr += sizeof(kme_uint8_t);
break;
/* Character */
case 'c':
if (onscreen)
{
- if (!getmem(sizeof(uchar)))
+ if (!getmem(sizeof(kme_uint8_t)))
printw("??");
else
{
- printchar((int)*(uchar *)mem);
+ printchar((int)*(kme_uint8_t *)mem);
}
}
- addr += sizeof(uchar);
+ addr += sizeof(kme_uint8_t);
break;
/* Signed decimal word */
case 'd':
if (onscreen)
{
- if (!getmem(sizeof(ushort)))
+ if (!getmem(sizeof(kme_uint16_t)))
printw("????");
else
- printw("%d", swaps(*(ushort *)mem));
+ printw("%d", swaps(*(kme_uint16_t *)mem));
}
- addr += sizeof(ushort);
+ addr += sizeof(kme_uint16_t);
break;
/* Decimal longword */
case 'e':
if (onscreen)
{
- ulong mval;
- if (!getmem(sizeof(ulong)))
+ kme_uint32_t mval;
+ if (!getmem(sizeof(kme_uint32_t)))
printw("????????");
else
{
- mval = swapl(*(ulong *)mem);
+ mval = swapl(*(kme_uint32_t *)mem);
printw("%ld", mval % 10000000);
if (mval / 10000000) printw("+");
}
}
- addr += sizeof(ulong);
+ addr += sizeof(kme_uint32_t);
break;
/* Single precision floating point */
case 'f':
@@ -2164,115 +2192,115 @@ void display(char* fp)
/* Decimal quadword */
case 'g':
if (onscreen)
{
- uquad mval;
+ kme_uint64_t mval;
char buf[32];
- if (!getmem(sizeof(uquad)))
+ if (!getmem(sizeof(kme_uint64_t)))
sprintf(buf, "????????????????");
else
{
- mval = swapq(*(uquad *)mem);
+ mval = swapq(*(kme_uint64_t *)mem);
sprintf(buf, "%lld", mval % 1000000000000000);
if (mval / 1000000000000000) strcat(buf, "+");
}
printw("%.8s", buf);
setup();
if (strlen(buf) > 8)
printw("%.8s", buf+8);
}
else
setup();
- addr += sizeof(uquad);
+ addr += sizeof(kme_uint64_t);
break;
#endif /* CC_HAS_LONG_LONG */
/* FEP input buffer */
case 'i':
if (onscreen)
{
- if (!getmem(sizeof(ushort)))
+ if (!getmem(sizeof(kme_uint16_t)))
{
printw("?? ??");
}
else
{
- printw("%02x ", *((uchar *)mem + 1));
- printchar((int)*(uchar *)mem & 0x7f);
+ printw("%02x ", *((kme_uint8_t *)mem + 1));
+ printchar((int)*(kme_uint8_t *)mem & 0x7f);
}
}
- addr += sizeof(ushort);
+ addr += sizeof(kme_uint16_t);
break;
/* HEX longword */
case 'l':
if (onscreen)
{
- ulong mval;
- if (!getmem(sizeof(ulong)))
+ kme_uint32_t mval;
+ if (!getmem(sizeof(kme_uint32_t)))
printw("????????");
else
{
- mval = swapl(*(ulong *)mem);
+ mval = swapl(*(kme_uint32_t *)mem);
printw("%04lx", mval);
}
}
- addr += sizeof(ulong);
+ addr += sizeof(kme_uint32_t);
break;
#if CC_HAS_LONG_LONG
/* Hex quadword */
case 'q':
if (onscreen)
{
- uquad mval;
+ kme_uint64_t mval;
char buf[32];
- if (!getmem(sizeof(uquad)))
+ if (!getmem(sizeof(kme_uint64_t)))
sprintf(buf, "????????????????");
else
{
- mval = swapq(*(uquad *)mem);
+ mval = swapq(*(kme_uint64_t *)mem);
sprintf(buf, "%016llx", mval);
}
printw("%.8s", buf);
setup();
printw("%.8s", buf+8);
}
else
setup();
- addr += sizeof(uquad);
+ addr += sizeof(kme_uint64_t);
break;
#endif
/* Unsigned decimal byte */
case 't':
if (onscreen)
{
- if (!getmem(sizeof(uchar)))
+ if (!getmem(sizeof(kme_uint8_t)))
printw("????");
else
- printw("%d", *(uchar *)mem);
+ printw("%d", *(kme_uint8_t *)mem);
}
- addr += sizeof(uchar);
+ addr += sizeof(kme_uint8_t);
break;
/* Hex word */
case 'x':
if (onscreen)
{
- if (!getmem(sizeof(ushort)))
+ if (!getmem(sizeof(kme_uint16_t)))
printw("????");
else
- printw("%04x", swaps(*(ushort *)mem));
+ printw("%04x", swaps(*(kme_uint16_t *)mem));
}
- addr += sizeof(ushort);
+ addr += sizeof(kme_uint16_t);
break;
/* Unsigned decimal word */
case 'u':
@@ -2280,27 +2308,27 @@ void display(char* fp)
{
if (!getmem(sizeof(short)))
printw("????");
else
{
- printw("%d", swaps(*(ushort *)mem));
+ printw("%d", swaps(*(kme_uint16_t *)mem));
}
}
addr += sizeof(short);
break;
/* Decimal longword */
case 'z':
if (onscreen)
{
- if (!getmem(sizeof(ulong)))
+ if (!getmem(sizeof(kme_uint32_t)))
printw("????????");
else
- printw("%ld", swapl(*(ulong *)mem));
+ printw("%ld", swapl(*(kme_uint32_t *)mem));
}
- addr += sizeof(ulong);
+ addr += sizeof(kme_uint32_t);
break;
}
if (onscreen)
{
register d_field *dp;
@@ -2618,24 +2646,24 @@ expr(int pri)
v = ~expr(10);
break;
case '*':
addr = expr(10) & addr_mask;
- if (!getmem(sizeof(ulong))) goto fail;
- v = swapl(*(ulong *)mem);
+ if (!getmem(sizeof(kme_uint32_t))) goto fail;
+ v = swapl(*(kme_uint32_t *)mem);
break;
case '@':
addr = expr(10) & addr_mask;
- if (!getmem(sizeof(ushort))) goto fail;
- v = swaps(*(ushort *)mem);
+ if (!getmem(sizeof(kme_uint16_t))) goto fail;
+ v = swaps(*(kme_uint16_t *)mem);
break;
case '#':
addr = expr(10) & addr_mask;
- if (!getmem(sizeof(uchar))) goto fail;
- v = *(uchar *)mem;
+ if (!getmem(sizeof(kme_uint8_t))) goto fail;
+ v = *(kme_uint8_t *)mem;
break;
case '$':
v = expr(10);
if ((unsigned)v >= TEMP_MAX) goto fail;
@@ -2832,23 +2860,23 @@ expr(int pri)
v += expr(0);
inparen--;
if (*str != ']') goto fail;
str++;
addr = v & addr_mask;
- if (!getmem(sizeof(ulong))) goto fail;
- v = swapl(*(ulong *)mem);
+ if (!getmem(sizeof(kme_uint32_t))) goto fail;
+ v = swapl(*(kme_uint32_t *)mem);
break;
case '{':
inparen++;
v += expr(0);
inparen--;
if (*str != '}') goto fail;
str++;
addr = v & addr_mask;
- if (!getmem(sizeof(ushort))) goto fail;
- v = swaps(*(ushort *)mem);
+ if (!getmem(sizeof(kme_uint16_t))) goto fail;
+ v = swaps(*(kme_uint16_t *)mem);
break;
case ':':
case ')':
case ']':
@@ -3010,27 +3038,27 @@ indata(char* buf)
{
case 'a':
case 'b':
case 'c':
case 't':
- size = sizeof(uchar);
- *(uchar *)mem = v;
+ size = sizeof(kme_uint8_t);
+ *(kme_uint8_t *)mem = v;
break;
case 'd':
case 'i':
case 'x':
case 's':
- size = sizeof(ushort);
- *(ushort *)mem = swaps((ushort)v);
+ size = sizeof(kme_uint16_t);
+ *(kme_uint16_t *)mem = swaps((kme_uint16_t)v);
break;
case 'e':
case 'l':
case 'z':
- size = sizeof(ulong);
- *(ulong *)mem = swapl(v);
+ size = sizeof(kme_uint32_t);
+ *(kme_uint32_t *)mem = swapl(v);
break;
case 'f':
size = sizeof(float);
*(ulong *)mem = swapl(v);
@@ -3272,11 +3300,10 @@ indata(char* buf)
#endif
#if HAVE_PTRACE
if (pid)
{
- char *cm = (char *) mem;
int i;
int nw;
int buf[2];
if (!stopchild())
|
|
From: Robert L. <ro...@sc...> - 2001-05-30 19:50:56
|
I've just applied the termios patch I posted some time ago. This enables KME to run on systems that have termios but not system V termio such as FreeBSD... RJL |
|
From: Robert L. <ro...@sc...> - 2001-04-16 21:42:03
|
> struct foo {
> char *name_of_thing;
> struct foo *foo_next;
> };
Here's one possible way, but it spans both kme_defs and your display...
!interface
"name" "next" n
1$ 2(l.) n
Then in the display after the display of blah/!interface (and before any
other that may nuke your temp var):
*$1/10s
Then when you walk through the array, this is displayed. It still
isn't diplayed "correctly" as a C string, but it beats nothing.
RJL
P.S. Why aren't these lists archived? (Not like there's been a lot
of traffic on them...)
|
|
From: Robert L. <ro...@sc...> - 2001-04-16 21:15:55
|
Hi, KME-ers.
Somewhere in the sourceforge release, we managed to not include any
sample kme_defs files for KME. There are a lot of points that are so
subtle that even I've forgotten how to do them. (I knew all those brain
cells I'd been killing might come in handy some day...)
struct foo {
char *name_of_thing;
struct foo *foo_next;
};
If 'name_of_thing' is a normal null-terminated string of characters,
how can you display it? the '*', '@', and '#' operators will indirect
and give you an int, but is there perhaps some game you can play with
temporary vars to get it so you can display it as a bag of bytes?
Walking the linked list with '+' (and '-' for doubly linked lists) would
be handy. I'm pretty sure KME can't currently do this, but I'm not
adverse to adding it if we can agree on the defs file syntax. Any ideas
how we could express that?
RJL
|