26 Commits

Author SHA1 Message Date
Nicholas Nethercote
d463dd2292 Removed the VGA_/VGO_/VGP_ prefixes for arch/OS/platform-specific
things.  These made sense when the arch/OS/platform-specific code was in
one module, but as that code got mixed in with generic code the boundary
between generic and non-generic blurred, and the distinction made less
sense.  So let's get rid of them.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4002
2005-06-23 03:27:57 +00:00
Julian Seward
b36f48842a Simplify the implementation of m_trampoline and the stuff that refers
to it.  Now there are no more offsets and no copying of code into the
stack.  We just redirect directly to entry points in m_syscalls.S.

This will mess up pointercheck, since the redirect targets are now in
Valgrind's address space, not the client's.  But pointercheck is hosed
anyway, and I'd rather back off to something simple whilst ppc32 is
stabilised.  When the address space management stuff is overhauled
then pointercheck may or may not get reinstated, and if it does then
the trampoline stuff will need revisiting.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3977
2005-06-21 01:41:34 +00:00
Nicholas Nethercote
fc38860306 Don't #include pub_core_debuginfo.h in pub_core_aspacemgr.h. So have
to #include it explicitly in lots of other places, but at least the 
dependency is clear now.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3974
2005-06-21 00:28:11 +00:00
Cerion Armour-Brown
d5f7c8aed3 Finally, valgrind on ppc32.
Plenty still to do, but simple programs like ls seem to run ok

Thanks, Paul, for having your ppc port of valgrind 2.4 to work from!




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3969
2005-06-20 15:51:07 +00:00
Nicholas Nethercote
b2f4f4cba0 Get "make dist" closer to working again.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3946
2005-06-19 05:43:21 +00:00
Nicholas Nethercote
f174930b23 Final commit for the initial modularisation pass:
- Broke part of m_scheduler off into a new module m_threadstate.  It
  contains ThreadState, VG_(threads)[] and some basic operations on the
  thread table.  All simple stuff, the complex stuff stays in m_scheduler.
  This avoids lots of circular dependencies between m_scheduler and other
  modules.

- Managed to finally remove core.h and tool.h, double hurrah!

- Introduced pub_tool_basics.h and pub_core_basics.h, one of which is
  include by every single C file.

- Lots of little cleanups and changes related to the above.

- I even did a small amount of documentation updating.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3944
2005-06-19 01:24:32 +00:00
Nicholas Nethercote
2f407d612c Moved the code trampoline stuff into a new module, m_trampoline. Not
certain this was the right thing to do, but that stuff sure as hell
didn't fit in any of the existing modules.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3929
2005-06-18 03:27:58 +00:00
Nicholas Nethercote
1d0e2e6e41 Created m_machine, for various machine-related things.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3903
2005-06-13 04:21:38 +00:00
Nicholas Nethercote
eb2d0a7d06 Modularised assertions and panics in m_libcassert.
As part of this, killed the VG_STRINGIFY macro, which was used to expand
out names like "VG_(foo)" and "vgPlain_foo" in assertion failure
messages.  This is good since we actually want the "VG_(foo)" form used
in these messages.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3842
2005-06-04 19:16:06 +00:00
Nicholas Nethercote
dbc8c6d99c Modularise printing functions in m_libcprint.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3840
2005-06-03 03:08:39 +00:00
Nicholas Nethercote
fbcb21d4c4 Rename *ROUND* as VG_*ROUND* to be consistent with everything else. Also
make them tool-visible, so that Memcheck and Helgrind don't have to defined
their own versions!



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3839
2005-06-02 03:52:53 +00:00
Nicholas Nethercote
09980587a9 Started modularising vg_mylibc. Put all the standalone stuff -- ie. not
relying on any other modules -- in m_libcbase.

Also converted the 'size' parameters to functions like VG_(memcpy) and
VG_(strncpy) from Int to SizeT, as they should be.

Also removed VG_(atoll16) and VG_(toupper), which weren't being used.

Also made VG_(atoll36) less flexible -- it now only does base-36 numbers
instead of any base in the range 2..36, since base-36 is the only one we
need.  As part of that, I fixed a horrible bug in it which caused it to
return incorrect answers for any number containing the digits 'A'..'I'!
(Eg. for "A; it would return 17 instead of 10!)

Had to disable the assertions in VG_(string_match), since this module can't
see vg_assert, which wasn't ideal but also isn't a disaster.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3838
2005-06-02 03:39:33 +00:00
Nicholas Nethercote
02df24345a Modularised vg_signals.c as m_signals.c.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3820
2005-05-31 01:00:08 +00:00
Tom Hughes
ccae44d317 Get rid of all the duplicated settings of AM_CFLAGS in the makefiles
for the various core modules and use a single global setting so that
the flags are actually consistent everywhere.

Also get rid of most the USE_PIE blocks in the makefiles by having
configure pass expand a variable in the new global AM_CFLAGS to one
of "-fpie" or "" depending on whether PIE is in use.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3760
2005-05-17 16:11:40 +00:00
Nicholas Nethercote
937a49ea05 Added module m_options for holding all the command-line option stuff.
Perhaps parts of process_cmd_line_option() should go in here, but I've
not done that for now.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3751
2005-05-16 23:31:24 +00:00
Nicholas Nethercote
247e241160 Modularised the core/tool interface ('details', 'needs' and VG_(tdict))
into a new module m_tooliface.  Pretty straightforward.  Touches a lot
of files because many files use this interface and so need to include
the headers for the new module.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3652
2005-05-10 04:37:01 +00:00
Nicholas Nethercote
89a26b8f71 Rename some _SIZE macros as _SZB to make their units clear. This change is
in response to a mixed-units (bytes and words) error we had involving
VGA_STACK_REDZONE_SIZE (which is now VGA_STACK_REDZONE_SZB).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3639
2005-05-08 17:49:37 +00:00
Nicholas Nethercote
fe432113e6 A crucial, crucial change: update my email address.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3632
2005-05-08 02:10:27 +00:00
Nicholas Nethercote
715351c3f8 Cleanups of syscall-related macros:
- Got rid of SET_THREAD_REG and some of the related macros, hallelujah.
  Replaced SET_SYSCALL_RETVAL with VGP_TRACK_SYSCALL_RETVAL, which avoids
  the redundant resetting of the syscall's return value.  The other
  remaining two related macros, SET_CLREQ_RETVAL and SET_CLCALL_RETVAL, were
  able to be moved to vg_scheduler.c rather than being global, hoorah.

- Passed the required syscall args to VG_(do_sys_sigaltstack)(), rather than
  grabbing them from within, removing its reliance on SYSCALL_ARG[12].
  It also makes the VG_(do_sys_sig*)() functions more consistent.

- As a result of these changes, was able to remove the SYSCALL_NUM,
  SYSCALL_RET and SYSCALL_ARG[123456] macros, yay.

- Replaced the implementations of VG_(set_return_from_syscall_shadow)() and
  VG_(get_exit_status_shadow)() with shorter ones that avoid using arch-state
  offsets.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3630
2005-05-08 02:04:49 +00:00
Tom Hughes
37aca15f81 Rework signal stack handling to avoid doing arithmetic on void pointers
and to avoid trashing the red zone while delivering a signal on the main
stack on amd64 systems.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3628
2005-05-07 17:57:39 +00:00
Tom Hughes
c01584824d It helps if my changes actually compile...
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3623
2005-05-05 08:26:14 +00:00
Tom Hughes
3552b6fa3b Allow for the red zone when generating new_mem_stack_signal and
die_mem_stack_signal events.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3622
2005-05-05 08:16:24 +00:00
Julian Seward
c862370c01 amd64 build fixes.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3567
2005-04-25 16:21:17 +00:00
Julian Seward
3f12fcbba8 Create a new module: ASpaceMgr, the address space manager. This
contains what was previously vg_memory.c and also vg_procselfmaps.c,
which is really just a helper for the address space manager.

This just moves code around and modularises it a bit.  It doesn't yet
resolve the circular dependencies between ASpaceMgr and various other
chunks of functionality (vg_malloc2, vg_symtab2).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3564
2005-04-25 11:11:44 +00:00
Julian Seward
0d4f070b04 Make amd64-linux build again after m_sigframe hackery.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3557
2005-04-24 14:31:29 +00:00
Julian Seward
48d6381e24 Create a new module, "sigframe", responsible for creating/destroying
signal frames.  This commit looks worse than it is -- really just a
load of moving-code-around.

This is the first multiple-implementation module, in that it has a
single interface (pub_core_sigframe.h) but multiple implementations,
depending on the os-cpu pair.  All the grotty details are hidden in
the implementation in m_sigframe/; callers need be aware only of the
interface.  Yay.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3556
2005-04-24 14:18:14 +00:00