added a callback function to check whether a given entity is a allocation call
[libfirm] / ir / debug / debugger.c
index 04bd0a0..a9e7ac4 100644 (file)
@@ -1,13 +1,28 @@
 /*
- * Project:     libFIRM
- * File name:   ir/debug/debugger.c
- * Purpose:     Helper function for integerated debug support
- * Author:      Michael Beck
- * Modified by:
- * Created:     2005
- * CVS-ID:      $Id$
- * Copyright:   (c) 2001-2007 Universität Karlsruhe
- * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
+ * Copyright (C) 1995-2007 University of Karlsruhe.  All right reserved.
+ *
+ * This file is part of libFirm.
+ *
+ * This file may be distributed and/or modified under the terms of the
+ * GNU General Public License version 2 as published by the Free Software
+ * Foundation and appearing in the file LICENSE.GPL included in the
+ * packaging of this file.
+ *
+ * Licensees holding valid libFirm Professional Edition licenses may use
+ * this file in accordance with the libFirm Commercial License.
+ * Agreement provided with the Software.
+ *
+ * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+ * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE.
+ */
+
+/**
+ * @file
+ * @brief     Helper function for integerated debug support
+ * @author    Michael Beck
+ * @date      2005
+ * @version   $Id$
  */
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -979,12 +994,19 @@ static unsigned get_token(void) {
 
                do {
                        c = next_char();
-               } while (c == '_' || isalnum(c));
+               } while (isgraph(c));
                unput();
                lexer.len = lexer.curr_pos - lexer.s;
                return tok_identifier;
-       } else if (isdigit(c)) {
+       } else if (isdigit(c) || c == '-') {
                unsigned number = 0;
+               unsigned sign   = 0;
+
+               /* we support negative numbers as well, so one can easily set all bits with -1 */
+               if (c == '-') {
+                       sign = 1;
+                       c    = next_char();
+               }
 
                if (c == '0') {
                        c = next_char();
@@ -1012,7 +1034,7 @@ static unsigned get_token(void) {
                        c = next_char();
                }
                unput();
-               lexer.number = number;
+               lexer.number = sign ? 0 - number : number;
                return tok_number;
        }
        else if (c == '\0')
@@ -1020,19 +1042,6 @@ static unsigned get_token(void) {
        return c;
 }  /* get_token */
 
-/**
- * returns the next token.
- */
-static unsigned next_token(void) {
-       if (! lexer.has_token) {
-               lexer.cur_token = get_token();
-               lexer.has_token = 1;
-       }
-       return lexer.cur_token;
-}  /* next_token */
-
-#define drop_token()  lexer.has_token = 0
-
 /**
  * High level function to use from debugger interface
  *