Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Mark Salter <msalter@redhat.com>
To: ac131313@cygnus.com
Cc: gdb-patches@sources.redhat.com
Subject: Re: remote watchpoint support
Date: Mon, 06 Nov 2000 05:51:00 -0000	[thread overview]
Message-ID: <200011061353.eA6Drmi30385@deneb.localdomain> (raw)
In-Reply-To: <3A069DB3.85902ACD@cygnus.com>

>>>>> Andrew Cagney writes:

> FYI, changelog entries should be separated out and not included in the
> diff.

Yup. I think I did that the last time, but had a relapse of expediency
this time.

>> Index: remote.c
>> ===================================================================
>> RCS file: /cvs/src/src/gdb/remote.c,v
>> retrieving revision 1.26
>> diff -p -r1.26 remote.c
>> *** remote.c    2000/10/23 22:49:28     1.26
>> --- remote.c    2000/11/01 21:06:29
>> *************** void _initialize_remote (void);
>> *** 204,209 ****
>> --- 204,216 ----
>> 
>> /* */
>> 
>> + /* This is set to the data address of the access causing the target
>> +  * to stop for a watchpoint. */
>> + static CORE_ADDR remote_watch_data_address;
>> +
>> + /* This is non-zero if taregt stopped for a watchpoint. */
>> + static int remote_stopped_by_watchpoint_p;
>> +

> I've strong reservations about the addition of these two ``global''
> variables.  Is it possible to modify things higher up so that their
> addition isn't required?

Without a doubt. It would just take time to sort everything out to
make sure existing support isn't broken.

> I'm also trying to understand how remote_stopped_data_address() et.al.
> gets called.

Good luck with that. ;-)

Its all part of bpstat_stop_status(). The inferior stops and gdb tries
to see if the user needs to informed, etc. bpstat_stop_status() walks
through the bp list and for write-only wathcpoints it reads the watched
memory to see if changed. For read-only and access watchpoints, it
calls target_stopped_data_address() which is a macro that usually gets
defined in a tm-xxx.h file. If we add the remote_stopped_by_watchpoint()
and remote_stopped_data_address functions, then the tm-xxx.h additions
for remote watchpoint suppport are pretty simple:

  /* Add HW watchpoint support */

  #define TARGET_HAS_HARDWARE_WATCHPOINTS

  #define TARGET_HW_WATCH_LIMIT 1

  #define TARGET_CAN_USE_HARDWARE_WATCHPOINT(type, cnt, ot) \
	xxx_check_watch_resources (type, cnt, ot)

  /* When a hardware watchpoint fires off the PC will be left at the
     instruction which caused the watchpoint.  It will be necessary for
     GDB to step over the watchpoint. */

  /* Comment out.  On this target, the memory access is issued before
     the watchpoint triggers.*/
  /*#define HAVE_STEPPABLE_WATCHPOINT 1*/

  #define STOPPED_BY_WATCHPOINT(W) \
     remote_stopped_by_watchpoint()

  /* Use these macros for watchpoint insertion/deletion.  */
  #define target_insert_watchpoint(addr, len, type) \
		remote_insert_watchpoint (addr, len, type)
  #define target_remove_watchpoint(addr, len, type) \
		remote_remove_watchpoint (addr, len, type)
  /* Use this to get the data address that triggered a watchpoint */
  #define target_stopped_data_address() \
		remote_stopped_data_address()

  extern int xxx_check_watch_resources (int type, int cnt, int ot);



>> *************** struct gdb_ext_thread_info
>> *** 963,969 ****
>> 
>> #define BUF_THREAD_ID_SIZE (OPAQUETHREADBYTES*2)
>> 
>> ! char *unpack_varlen_hex (char *buff, int *result);
>> 
>> static char *unpack_nibble (char *buf, int *val);
>> 
>> --- 970,976 ----
>> 
>> #define BUF_THREAD_ID_SIZE (OPAQUETHREADBYTES*2)
>> 
>> ! char *unpack_varlen_hex (char *buff, ULONGEST *result);
>> 
>> static char *unpack_nibble (char *buf, int *val);
>> 

> The ChangeLog doesn't mention this change?  Can I suggest this be
> submitted separatly with the tweek that follows:

Oops.

>> --- 2657,2682 ----
>> p, buf);
>> if (strncmp ((const char *) p, "thread", p1 - p) == 0)
>> {
> 		          ULONGEST thread_num;
>> !                       p_temp = unpack_varlen_hex (++p1, &ul);
>> !                       thread_num = ul;
>> record_currthread (thread_num);
>> p = (unsigned char *) p_temp;
>> }

> Suggest just making threadnum a LONGEST and being done with it.

Ok.

--Mark



  reply	other threads:[~2000-11-06  5:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200011012131.eA1LVa514840@deneb.localdomain>
2000-11-06  4:08 ` Andrew Cagney
2000-11-06  5:51   ` Mark Salter [this message]
2001-06-28 15:09 ` Andrew Cagney
2001-06-28 16:17   ` Mark Salter
     [not found] <200010301416.e9UEG6m18981@deneb.localdomain>
     [not found] ` <39FDCF55.46BD@redhat.com>
     [not found]   ` <200010302018.e9UKIr300876@deneb.localdomain>
2000-10-30 12:21     ` Remote " Michael Snyder
     [not found] ` <5mg0leoyg6.fsf@jtc.redback.com>
2000-10-31  1:07   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200011061353.eA6Drmi30385@deneb.localdomain \
    --to=msalter@redhat.com \
    --cc=ac131313@cygnus.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox