LCOV - code coverage report
Current view: top level - kernel/debug/kdb - kdb_bp.c (source / functions) Hit Total Coverage
Test: Real Lines: 12 181 6.6 %
Date: 2020-10-17 15:46:16 Functions: 0 11 0.0 %
Legend: Neither, QEMU, Real, Both Branches: 0 0 -

           Branch data     Line data    Source code
       1                 :            : /*
       2                 :            :  * Kernel Debugger Architecture Independent Breakpoint Handler
       3                 :            :  *
       4                 :            :  * This file is subject to the terms and conditions of the GNU General Public
       5                 :            :  * License.  See the file "COPYING" in the main directory of this archive
       6                 :            :  * for more details.
       7                 :            :  *
       8                 :            :  * Copyright (c) 1999-2004 Silicon Graphics, Inc.  All Rights Reserved.
       9                 :            :  * Copyright (c) 2009 Wind River Systems, Inc.  All Rights Reserved.
      10                 :            :  */
      11                 :            : 
      12                 :            : #include <linux/string.h>
      13                 :            : #include <linux/kernel.h>
      14                 :            : #include <linux/init.h>
      15                 :            : #include <linux/kdb.h>
      16                 :            : #include <linux/kgdb.h>
      17                 :            : #include <linux/smp.h>
      18                 :            : #include <linux/sched.h>
      19                 :            : #include <linux/interrupt.h>
      20                 :            : #include "kdb_private.h"
      21                 :            : 
      22                 :            : /*
      23                 :            :  * Table of kdb_breakpoints
      24                 :            :  */
      25                 :            : kdb_bp_t kdb_breakpoints[KDB_MAXBPT];
      26                 :            : 
      27                 :            : static void kdb_setsinglestep(struct pt_regs *regs)
      28                 :            : {
      29                 :          0 :         KDB_STATE_SET(DOING_SS);
      30                 :            : }
      31                 :            : 
      32                 :            : static char *kdb_rwtypes[] = {
      33                 :            :         "Instruction(i)",
      34                 :            :         "Instruction(Register)",
      35                 :            :         "Data Write",
      36                 :            :         "I/O",
      37                 :            :         "Data Access"
      38                 :            : };
      39                 :            : 
      40                 :            : static char *kdb_bptype(kdb_bp_t *bp)
      41                 :            : {
      42                 :          0 :         if (bp->bp_type < 0 || bp->bp_type > 4)
      43                 :            :                 return "";
      44                 :            : 
      45                 :          0 :         return kdb_rwtypes[bp->bp_type];
      46                 :            : }
      47                 :            : 
      48                 :          0 : static int kdb_parsebp(int argc, const char **argv, int *nextargp, kdb_bp_t *bp)
      49                 :            : {
      50                 :          0 :         int nextarg = *nextargp;
      51                 :            :         int diag;
      52                 :            : 
      53                 :          0 :         bp->bph_length = 1;
      54                 :          0 :         if ((argc + 1) != nextarg) {
      55                 :          0 :                 if (strncasecmp(argv[nextarg], "datar", sizeof("datar")) == 0)
      56                 :          0 :                         bp->bp_type = BP_ACCESS_WATCHPOINT;
      57                 :          0 :                 else if (strncasecmp(argv[nextarg], "dataw", sizeof("dataw")) == 0)
      58                 :          0 :                         bp->bp_type = BP_WRITE_WATCHPOINT;
      59                 :          0 :                 else if (strncasecmp(argv[nextarg], "inst", sizeof("inst")) == 0)
      60                 :          0 :                         bp->bp_type = BP_HARDWARE_BREAKPOINT;
      61                 :            :                 else
      62                 :            :                         return KDB_ARGCOUNT;
      63                 :            : 
      64                 :            :                 bp->bph_length = 1;
      65                 :            : 
      66                 :          0 :                 nextarg++;
      67                 :            : 
      68                 :          0 :                 if ((argc + 1) != nextarg) {
      69                 :            :                         unsigned long len;
      70                 :            : 
      71                 :          0 :                         diag = kdbgetularg((char *)argv[nextarg],
      72                 :            :                                            &len);
      73                 :          0 :                         if (diag)
      74                 :          0 :                                 return diag;
      75                 :            : 
      76                 :            : 
      77                 :          0 :                         if (len > 8)
      78                 :            :                                 return KDB_BADLENGTH;
      79                 :            : 
      80                 :          0 :                         bp->bph_length = len;
      81                 :          0 :                         nextarg++;
      82                 :            :                 }
      83                 :            : 
      84                 :          0 :                 if ((argc + 1) != nextarg)
      85                 :            :                         return KDB_ARGCOUNT;
      86                 :            :         }
      87                 :            : 
      88                 :          0 :         *nextargp = nextarg;
      89                 :          0 :         return 0;
      90                 :            : }
      91                 :            : 
      92                 :          0 : static int _kdb_bp_remove(kdb_bp_t *bp)
      93                 :            : {
      94                 :            :         int ret = 1;
      95                 :          0 :         if (!bp->bp_installed)
      96                 :            :                 return ret;
      97                 :          0 :         if (!bp->bp_type)
      98                 :          0 :                 ret = dbg_remove_sw_break(bp->bp_addr);
      99                 :            :         else
     100                 :          0 :                 ret = arch_kgdb_ops.remove_hw_breakpoint(bp->bp_addr,
     101                 :          0 :                          bp->bph_length,
     102                 :          0 :                          bp->bp_type);
     103                 :          0 :         if (ret == 0)
     104                 :          0 :                 bp->bp_installed = 0;
     105                 :          0 :         return ret;
     106                 :            : }
     107                 :            : 
     108                 :          0 : static void kdb_handle_bp(struct pt_regs *regs, kdb_bp_t *bp)
     109                 :            : {
     110                 :          0 :         if (KDB_DEBUG(BP))
     111                 :          0 :                 kdb_printf("regs->ip = 0x%lx\n", instruction_pointer(regs));
     112                 :            : 
     113                 :            :         /*
     114                 :            :          * Setup single step
     115                 :            :          */
     116                 :            :         kdb_setsinglestep(regs);
     117                 :            : 
     118                 :            :         /*
     119                 :            :          * Reset delay attribute
     120                 :            :          */
     121                 :          0 :         bp->bp_delay = 0;
     122                 :          0 :         bp->bp_delayed = 1;
     123                 :          0 : }
     124                 :            : 
     125                 :          0 : static int _kdb_bp_install(struct pt_regs *regs, kdb_bp_t *bp)
     126                 :            : {
     127                 :            :         int ret;
     128                 :            :         /*
     129                 :            :          * Install the breakpoint, if it is not already installed.
     130                 :            :          */
     131                 :            : 
     132                 :          0 :         if (KDB_DEBUG(BP))
     133                 :          0 :                 kdb_printf("%s: bp_installed %d\n",
     134                 :          0 :                            __func__, bp->bp_installed);
     135                 :          0 :         if (!KDB_STATE(SSBPT))
     136                 :          0 :                 bp->bp_delay = 0;
     137                 :          0 :         if (bp->bp_installed)
     138                 :            :                 return 1;
     139                 :          0 :         if (bp->bp_delay || (bp->bp_delayed && KDB_STATE(DOING_SS))) {
     140                 :          0 :                 if (KDB_DEBUG(BP))
     141                 :          0 :                         kdb_printf("%s: delayed bp\n", __func__);
     142                 :          0 :                 kdb_handle_bp(regs, bp);
     143                 :          0 :                 return 0;
     144                 :            :         }
     145                 :          0 :         if (!bp->bp_type)
     146                 :          0 :                 ret = dbg_set_sw_break(bp->bp_addr);
     147                 :            :         else
     148                 :          0 :                 ret = arch_kgdb_ops.set_hw_breakpoint(bp->bp_addr,
     149                 :          0 :                          bp->bph_length,
     150                 :          0 :                          bp->bp_type);
     151                 :          0 :         if (ret == 0) {
     152                 :          0 :                 bp->bp_installed = 1;
     153                 :            :         } else {
     154                 :          0 :                 kdb_printf("%s: failed to set breakpoint at 0x%lx\n",
     155                 :            :                            __func__, bp->bp_addr);
     156                 :          0 :                 if (!bp->bp_type) {
     157                 :          0 :                         kdb_printf("Software breakpoints are unavailable.\n"
     158                 :            :                                    "  Boot the kernel with rodata=off\n"
     159                 :            :                                    "  OR use hw breaks: help bph\n");
     160                 :            :                 }
     161                 :            :                 return 1;
     162                 :            :         }
     163                 :          0 :         return 0;
     164                 :            : }
     165                 :            : 
     166                 :            : /*
     167                 :            :  * kdb_bp_install
     168                 :            :  *
     169                 :            :  *      Install kdb_breakpoints prior to returning from the
     170                 :            :  *      kernel debugger.  This allows the kdb_breakpoints to be set
     171                 :            :  *      upon functions that are used internally by kdb, such as
     172                 :            :  *      printk().  This function is only called once per kdb session.
     173                 :            :  */
     174                 :          0 : void kdb_bp_install(struct pt_regs *regs)
     175                 :            : {
     176                 :            :         int i;
     177                 :            : 
     178                 :          0 :         for (i = 0; i < KDB_MAXBPT; i++) {
     179                 :          0 :                 kdb_bp_t *bp = &kdb_breakpoints[i];
     180                 :            : 
     181                 :          0 :                 if (KDB_DEBUG(BP)) {
     182                 :          0 :                         kdb_printf("%s: bp %d bp_enabled %d\n",
     183                 :          0 :                                    __func__, i, bp->bp_enabled);
     184                 :            :                 }
     185                 :          0 :                 if (bp->bp_enabled)
     186                 :          0 :                         _kdb_bp_install(regs, bp);
     187                 :            :         }
     188                 :          0 : }
     189                 :            : 
     190                 :            : /*
     191                 :            :  * kdb_bp_remove
     192                 :            :  *
     193                 :            :  *      Remove kdb_breakpoints upon entry to the kernel debugger.
     194                 :            :  *
     195                 :            :  * Parameters:
     196                 :            :  *      None.
     197                 :            :  * Outputs:
     198                 :            :  *      None.
     199                 :            :  * Returns:
     200                 :            :  *      None.
     201                 :            :  * Locking:
     202                 :            :  *      None.
     203                 :            :  * Remarks:
     204                 :            :  */
     205                 :          0 : void kdb_bp_remove(void)
     206                 :            : {
     207                 :            :         int i;
     208                 :            : 
     209                 :          0 :         for (i = KDB_MAXBPT - 1; i >= 0; i--) {
     210                 :          0 :                 kdb_bp_t *bp = &kdb_breakpoints[i];
     211                 :            : 
     212                 :          0 :                 if (KDB_DEBUG(BP)) {
     213                 :          0 :                         kdb_printf("%s: bp %d bp_enabled %d\n",
     214                 :          0 :                                    __func__, i, bp->bp_enabled);
     215                 :            :                 }
     216                 :          0 :                 if (bp->bp_enabled)
     217                 :          0 :                         _kdb_bp_remove(bp);
     218                 :            :         }
     219                 :          0 : }
     220                 :            : 
     221                 :            : 
     222                 :            : /*
     223                 :            :  * kdb_printbp
     224                 :            :  *
     225                 :            :  *      Internal function to format and print a breakpoint entry.
     226                 :            :  *
     227                 :            :  * Parameters:
     228                 :            :  *      None.
     229                 :            :  * Outputs:
     230                 :            :  *      None.
     231                 :            :  * Returns:
     232                 :            :  *      None.
     233                 :            :  * Locking:
     234                 :            :  *      None.
     235                 :            :  * Remarks:
     236                 :            :  */
     237                 :            : 
     238                 :          0 : static void kdb_printbp(kdb_bp_t *bp, int i)
     239                 :            : {
     240                 :          0 :         kdb_printf("%s ", kdb_bptype(bp));
     241                 :          0 :         kdb_printf("BP #%d at ", i);
     242                 :          0 :         kdb_symbol_print(bp->bp_addr, NULL, KDB_SP_DEFAULT);
     243                 :            : 
     244                 :          0 :         if (bp->bp_enabled)
     245                 :          0 :                 kdb_printf("\n    is enabled ");
     246                 :            :         else
     247                 :          0 :                 kdb_printf("\n    is disabled");
     248                 :            : 
     249                 :          0 :         kdb_printf("  addr at %016lx, hardtype=%d installed=%d\n",
     250                 :          0 :                    bp->bp_addr, bp->bp_type, bp->bp_installed);
     251                 :            : 
     252                 :          0 :         kdb_printf("\n");
     253                 :          0 : }
     254                 :            : 
     255                 :            : /*
     256                 :            :  * kdb_bp
     257                 :            :  *
     258                 :            :  *      Handle the bp commands.
     259                 :            :  *
     260                 :            :  *      [bp|bph] <addr-expression> [DATAR|DATAW]
     261                 :            :  *
     262                 :            :  * Parameters:
     263                 :            :  *      argc    Count of arguments in argv
     264                 :            :  *      argv    Space delimited command line arguments
     265                 :            :  * Outputs:
     266                 :            :  *      None.
     267                 :            :  * Returns:
     268                 :            :  *      Zero for success, a kdb diagnostic if failure.
     269                 :            :  * Locking:
     270                 :            :  *      None.
     271                 :            :  * Remarks:
     272                 :            :  *
     273                 :            :  *      bp      Set breakpoint on all cpus.  Only use hardware assist if need.
     274                 :            :  *      bph     Set breakpoint on all cpus.  Force hardware register
     275                 :            :  */
     276                 :            : 
     277                 :          0 : static int kdb_bp(int argc, const char **argv)
     278                 :            : {
     279                 :            :         int i, bpno;
     280                 :            :         kdb_bp_t *bp, *bp_check;
     281                 :            :         int diag;
     282                 :          0 :         char *symname = NULL;
     283                 :          0 :         long offset = 0ul;
     284                 :            :         int nextarg;
     285                 :          0 :         kdb_bp_t template = {0};
     286                 :            : 
     287                 :          0 :         if (argc == 0) {
     288                 :            :                 /*
     289                 :            :                  * Display breakpoint table
     290                 :            :                  */
     291                 :          0 :                 for (bpno = 0, bp = kdb_breakpoints; bpno < KDB_MAXBPT;
     292                 :          0 :                      bpno++, bp++) {
     293                 :          0 :                         if (bp->bp_free)
     294                 :          0 :                                 continue;
     295                 :          0 :                         kdb_printbp(bp, bpno);
     296                 :            :                 }
     297                 :            : 
     298                 :            :                 return 0;
     299                 :            :         }
     300                 :            : 
     301                 :          0 :         nextarg = 1;
     302                 :          0 :         diag = kdbgetaddrarg(argc, argv, &nextarg, &template.bp_addr,
     303                 :            :                              &offset, &symname);
     304                 :          0 :         if (diag)
     305                 :            :                 return diag;
     306                 :          0 :         if (!template.bp_addr)
     307                 :            :                 return KDB_BADINT;
     308                 :            : 
     309                 :            :         /*
     310                 :            :          * Find an empty bp structure to allocate
     311                 :            :          */
     312                 :          0 :         for (bpno = 0, bp = kdb_breakpoints; bpno < KDB_MAXBPT; bpno++, bp++) {
     313                 :          0 :                 if (bp->bp_free)
     314                 :            :                         break;
     315                 :            :         }
     316                 :            : 
     317                 :          0 :         if (bpno == KDB_MAXBPT)
     318                 :            :                 return KDB_TOOMANYBPT;
     319                 :            : 
     320                 :          0 :         if (strcmp(argv[0], "bph") == 0) {
     321                 :          0 :                 template.bp_type = BP_HARDWARE_BREAKPOINT;
     322                 :          0 :                 diag = kdb_parsebp(argc, argv, &nextarg, &template);
     323                 :          0 :                 if (diag)
     324                 :            :                         return diag;
     325                 :            :         } else {
     326                 :          0 :                 template.bp_type = BP_BREAKPOINT;
     327                 :            :         }
     328                 :            : 
     329                 :            :         /*
     330                 :            :          * Check for clashing breakpoints.
     331                 :            :          *
     332                 :            :          * Note, in this design we can't have hardware breakpoints
     333                 :            :          * enabled for both read and write on the same address.
     334                 :            :          */
     335                 :          0 :         for (i = 0, bp_check = kdb_breakpoints; i < KDB_MAXBPT;
     336                 :          0 :              i++, bp_check++) {
     337                 :          0 :                 if (!bp_check->bp_free &&
     338                 :          0 :                     bp_check->bp_addr == template.bp_addr) {
     339                 :          0 :                         kdb_printf("You already have a breakpoint at "
     340                 :            :                                    kdb_bfd_vma_fmt0 "\n", template.bp_addr);
     341                 :          0 :                         return KDB_DUPBPT;
     342                 :            :                 }
     343                 :            :         }
     344                 :            : 
     345                 :          0 :         template.bp_enabled = 1;
     346                 :            : 
     347                 :            :         /*
     348                 :            :          * Actually allocate the breakpoint found earlier
     349                 :            :          */
     350                 :          0 :         *bp = template;
     351                 :          0 :         bp->bp_free = 0;
     352                 :            : 
     353                 :          0 :         kdb_printbp(bp, bpno);
     354                 :            : 
     355                 :          0 :         return 0;
     356                 :            : }
     357                 :            : 
     358                 :            : /*
     359                 :            :  * kdb_bc
     360                 :            :  *
     361                 :            :  *      Handles the 'bc', 'be', and 'bd' commands
     362                 :            :  *
     363                 :            :  *      [bd|bc|be] <breakpoint-number>
     364                 :            :  *      [bd|bc|be] *
     365                 :            :  *
     366                 :            :  * Parameters:
     367                 :            :  *      argc    Count of arguments in argv
     368                 :            :  *      argv    Space delimited command line arguments
     369                 :            :  * Outputs:
     370                 :            :  *      None.
     371                 :            :  * Returns:
     372                 :            :  *      Zero for success, a kdb diagnostic for failure
     373                 :            :  * Locking:
     374                 :            :  *      None.
     375                 :            :  * Remarks:
     376                 :            :  */
     377                 :          0 : static int kdb_bc(int argc, const char **argv)
     378                 :            : {
     379                 :            :         unsigned long addr;
     380                 :            :         kdb_bp_t *bp = NULL;
     381                 :            :         int lowbp = KDB_MAXBPT;
     382                 :            :         int highbp = 0;
     383                 :            :         int done = 0;
     384                 :            :         int i;
     385                 :            :         int diag = 0;
     386                 :            : 
     387                 :            :         int cmd;                        /* KDBCMD_B? */
     388                 :            : #define KDBCMD_BC       0
     389                 :            : #define KDBCMD_BE       1
     390                 :            : #define KDBCMD_BD       2
     391                 :            : 
     392                 :          0 :         if (strcmp(argv[0], "be") == 0)
     393                 :            :                 cmd = KDBCMD_BE;
     394                 :          0 :         else if (strcmp(argv[0], "bd") == 0)
     395                 :            :                 cmd = KDBCMD_BD;
     396                 :            :         else
     397                 :            :                 cmd = KDBCMD_BC;
     398                 :            : 
     399                 :          0 :         if (argc != 1)
     400                 :            :                 return KDB_ARGCOUNT;
     401                 :            : 
     402                 :          0 :         if (strcmp(argv[1], "*") == 0) {
     403                 :            :                 lowbp = 0;
     404                 :            :                 highbp = KDB_MAXBPT;
     405                 :            :         } else {
     406                 :          0 :                 diag = kdbgetularg(argv[1], &addr);
     407                 :          0 :                 if (diag)
     408                 :            :                         return diag;
     409                 :            : 
     410                 :            :                 /*
     411                 :            :                  * For addresses less than the maximum breakpoint number,
     412                 :            :                  * assume that the breakpoint number is desired.
     413                 :            :                  */
     414                 :          0 :                 if (addr < KDB_MAXBPT) {
     415                 :            :                         bp = &kdb_breakpoints[addr];
     416                 :          0 :                         lowbp = highbp = addr;
     417                 :          0 :                         highbp++;
     418                 :            :                 } else {
     419                 :          0 :                         for (i = 0, bp = kdb_breakpoints; i < KDB_MAXBPT;
     420                 :          0 :                             i++, bp++) {
     421                 :          0 :                                 if (bp->bp_addr == addr) {
     422                 :          0 :                                         lowbp = highbp = i;
     423                 :          0 :                                         highbp++;
     424                 :          0 :                                         break;
     425                 :            :                                 }
     426                 :            :                         }
     427                 :            :                 }
     428                 :            :         }
     429                 :            : 
     430                 :            :         /*
     431                 :            :          * Now operate on the set of breakpoints matching the input
     432                 :            :          * criteria (either '*' for all, or an individual breakpoint).
     433                 :            :          */
     434                 :          0 :         for (bp = &kdb_breakpoints[lowbp], i = lowbp;
     435                 :            :             i < highbp;
     436                 :          0 :             i++, bp++) {
     437                 :          0 :                 if (bp->bp_free)
     438                 :          0 :                         continue;
     439                 :            : 
     440                 :          0 :                 done++;
     441                 :            : 
     442                 :          0 :                 switch (cmd) {
     443                 :            :                 case KDBCMD_BC:
     444                 :          0 :                         bp->bp_enabled = 0;
     445                 :            : 
     446                 :          0 :                         kdb_printf("Breakpoint %d at "
     447                 :            :                                    kdb_bfd_vma_fmt " cleared\n",
     448                 :            :                                    i, bp->bp_addr);
     449                 :            : 
     450                 :          0 :                         bp->bp_addr = 0;
     451                 :          0 :                         bp->bp_free = 1;
     452                 :            : 
     453                 :          0 :                         break;
     454                 :            :                 case KDBCMD_BE:
     455                 :          0 :                         bp->bp_enabled = 1;
     456                 :            : 
     457                 :          0 :                         kdb_printf("Breakpoint %d at "
     458                 :            :                                    kdb_bfd_vma_fmt " enabled",
     459                 :            :                                    i, bp->bp_addr);
     460                 :            : 
     461                 :          0 :                         kdb_printf("\n");
     462                 :          0 :                         break;
     463                 :            :                 case KDBCMD_BD:
     464                 :          0 :                         if (!bp->bp_enabled)
     465                 :            :                                 break;
     466                 :            : 
     467                 :          0 :                         bp->bp_enabled = 0;
     468                 :            : 
     469                 :          0 :                         kdb_printf("Breakpoint %d at "
     470                 :            :                                    kdb_bfd_vma_fmt " disabled\n",
     471                 :            :                                    i, bp->bp_addr);
     472                 :            : 
     473                 :          0 :                         break;
     474                 :            :                 }
     475                 :          0 :                 if (bp->bp_delay && (cmd == KDBCMD_BC || cmd == KDBCMD_BD)) {
     476                 :          0 :                         bp->bp_delay = 0;
     477                 :          0 :                         KDB_STATE_CLEAR(SSBPT);
     478                 :            :                 }
     479                 :            :         }
     480                 :            : 
     481                 :          0 :         return (!done) ? KDB_BPTNOTFOUND : 0;
     482                 :            : }
     483                 :            : 
     484                 :            : /*
     485                 :            :  * kdb_ss
     486                 :            :  *
     487                 :            :  *      Process the 'ss' (Single Step) command.
     488                 :            :  *
     489                 :            :  *      ss
     490                 :            :  *
     491                 :            :  * Parameters:
     492                 :            :  *      argc    Argument count
     493                 :            :  *      argv    Argument vector
     494                 :            :  * Outputs:
     495                 :            :  *      None.
     496                 :            :  * Returns:
     497                 :            :  *      KDB_CMD_SS for success, a kdb error if failure.
     498                 :            :  * Locking:
     499                 :            :  *      None.
     500                 :            :  * Remarks:
     501                 :            :  *
     502                 :            :  *      Set the arch specific option to trigger a debug trap after the next
     503                 :            :  *      instruction.
     504                 :            :  */
     505                 :            : 
     506                 :          0 : static int kdb_ss(int argc, const char **argv)
     507                 :            : {
     508                 :          0 :         if (argc != 0)
     509                 :            :                 return KDB_ARGCOUNT;
     510                 :            :         /*
     511                 :            :          * Set trace flag and go.
     512                 :            :          */
     513                 :          0 :         KDB_STATE_SET(DOING_SS);
     514                 :          0 :         return KDB_CMD_SS;
     515                 :            : }
     516                 :            : 
     517                 :            : /* Initialize the breakpoint table and register breakpoint commands. */
     518                 :            : 
     519                 :          3 : void __init kdb_initbptab(void)
     520                 :            : {
     521                 :            :         int i;
     522                 :            :         kdb_bp_t *bp;
     523                 :            : 
     524                 :            :         /*
     525                 :            :          * First time initialization.
     526                 :            :          */
     527                 :          3 :         memset(&kdb_breakpoints, '\0', sizeof(kdb_breakpoints));
     528                 :            : 
     529                 :          3 :         for (i = 0, bp = kdb_breakpoints; i < KDB_MAXBPT; i++, bp++)
     530                 :          3 :                 bp->bp_free = 1;
     531                 :            : 
     532                 :          3 :         kdb_register_flags("bp", kdb_bp, "[<vaddr>]",
     533                 :            :                 "Set/Display breakpoints", 0,
     534                 :            :                 KDB_ENABLE_FLOW_CTRL | KDB_REPEAT_NO_ARGS);
     535                 :          3 :         kdb_register_flags("bl", kdb_bp, "[<vaddr>]",
     536                 :            :                 "Display breakpoints", 0,
     537                 :            :                 KDB_ENABLE_FLOW_CTRL | KDB_REPEAT_NO_ARGS);
     538                 :          3 :         if (arch_kgdb_ops.flags & KGDB_HW_BREAKPOINT)
     539                 :          0 :                 kdb_register_flags("bph", kdb_bp, "[<vaddr>]",
     540                 :            :                 "[datar [length]|dataw [length]]   Set hw brk", 0,
     541                 :            :                 KDB_ENABLE_FLOW_CTRL | KDB_REPEAT_NO_ARGS);
     542                 :          3 :         kdb_register_flags("bc", kdb_bc, "<bpnum>",
     543                 :            :                 "Clear Breakpoint", 0,
     544                 :            :                 KDB_ENABLE_FLOW_CTRL);
     545                 :          3 :         kdb_register_flags("be", kdb_bc, "<bpnum>",
     546                 :            :                 "Enable Breakpoint", 0,
     547                 :            :                 KDB_ENABLE_FLOW_CTRL);
     548                 :          3 :         kdb_register_flags("bd", kdb_bc, "<bpnum>",
     549                 :            :                 "Disable Breakpoint", 0,
     550                 :            :                 KDB_ENABLE_FLOW_CTRL);
     551                 :            : 
     552                 :          3 :         kdb_register_flags("ss", kdb_ss, "",
     553                 :            :                 "Single Step", 1,
     554                 :            :                 KDB_ENABLE_FLOW_CTRL | KDB_REPEAT_NO_ARGS);
     555                 :            :         /*
     556                 :            :          * Architecture dependent initialization.
     557                 :            :          */
     558                 :          3 : }
    

Generated by: LCOV version 1.14