This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [PATCH] S/390 port modernization 2/4
- From: Jim Blandy <jimb at redhat dot com>
- To: Ulrich Weigand <weigand at i1 dot informatik dot uni-erlangen dot de>
- Cc: gdb-patches at sources dot redhat dot com, uweigand at de dot ibm dot com
- Date: 04 Dec 2003 17:25:33 -0500
- Subject: Re: [PATCH] S/390 port modernization 2/4
- References: <200312042006.VAA07709@faui1d.informatik.uni-erlangen.de>
> ! static void
> ! s390_fix_watch_points (void)
> {
> + int tid = s390_inferior_tid ();
> +
> per_struct per_info;
> ptrace_area parea;
>
> + CORE_ADDR watch_lo_addr = 0, watch_hi_addr = (CORE_ADDR)-1;
> + struct watch_area *area;
> +
> + for (area = watch_base; area; area = area->next)
> + {
> + watch_lo_addr = min (watch_lo_addr, area->lo_addr);
> + watch_hi_addr = max (watch_hi_addr, area->hi_addr);
> + }
> +
Is this correct? Since CORE_ADDR is unsigned, the initial value of
watch_hi_addr will compare greater than any watch area's hi_addr, so
the 'max' will never change its value. Same for watch_lo_addr. Don't
you want to set watch_lo_addr to (CORE_ADDR) -1, and watch_hi_addr to
0?